0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.145.186.132


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/SelectFinalMCQQp-Bq0urcjQ.js

import{x as N,r as n,t as a,D as $,B as c,L as z,G as d,E as H,F as _,O as G}from"./index-CvUjCcnC.js";import{a as h,c as J,p as V,s as W}from"./sem-BK69X1ab.js";import{g as Y,d as K,e as U}from"./UploadQpPattern-D63zyykw.js";import{a as X,b as Z}from"./SelectFinalQP-CIIjCXYn.js";import{g as p,s as g}from"./datatable-Cq5oUA82.js";import{S as ee}from"./index-cBpPe4Bv.js";import{R as te}from"./SaveOutlined-vQtQuQmS.js";import{R as ae}from"./HomeOutlined-Ch4dEWnc.js";import{R as w,C as o}from"./row-BjYGaq9p.js";import{F as se}from"./Table-Bjn0CUkG.js";import{R as re}from"./FilePdfOutlined-34Il5H1k.js";import{C as ne}from"./index-Bcns0PqO.js";import"./responsiveObserver-DEIyf_nc.js";import"./index-Ox-82G5m.js";import"./index-B2bo5HG1.js";const oe=s=>{const[m,C]=n.useState(""),[f,Q]=n.useState("All"),[u,D]=n.useState("All"),[b,O]=n.useState("All"),[S,P]=n.useState("All"),[x,j]=n.useState([]),[q,v]=n.useState(!1);n.useEffect(()=>{s.getQpDeggrp()},[]),n.useEffect(()=>{j(s.getPreparedOmrQp)},[s.getPreparedOmrQp]);const l=async(e,t)=>{t==="deggrp"&&(C(e),await s.getAvailableSubjects(e,"All"),await s.getQpDegree(e)),t==="qpcode"&&Q(e),t==="sem"&&O(e),t==="degree"&&D(e),t==="status"&&P(e)},F=async()=>{if(m===""){H("info","please select degree group");return}const e={deggrp:m,qpcode:f,degree:u,sem:b,status:S};await s.getPreparedOmrQns(e),v(!0)},y=(e,t,r)=>{const i=x;r==="fversions"?/^[2-4]*$/.test(e.target.value)==!0&&(i[t.key][r]=e.target.value,i[t.key].changeStatus="T"):r==="ffinalpaper"&&(i[t.key][r]=e.target.checked?"T":"F",i[t.key].changeStatus="T"),j([...i])},k=async()=>{let e=x.filter(r=>r.changeStatus==="T");const t=new FormData;t.append("data",JSON.stringify(e)),await s.saveOMRFinalPaper(t)},R=e=>{const t=localStorage.getItem("dbname");window.open(G+"/app.php?a=getOmrQpReport&db="+t+"&univcode="+s.user.funivcode+"&qpcode="+e.fqpcode+"&year="+e.fyear+"&mode="+e.fexamtype+"&teachcode="+e.fteachcode+"&noqp="+e.fnoqp+"&type=MCQ")},I=s.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),A=s.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname,value:e.fqpcode})),T=[...h,...A],E=s.degree.map(e=>({key:e.fdegree,label:e.fdescpn,value:e.fdegree})),B=[...h,...E],M=[...h,...W],L=[{title:"Sl. No",dataIndex:"fslno",width:"5%",align:"center"},{title:"Exam Date",dataIndex:"fexamdate",...p("fexamdate","Exam Date"),sorter:(e,t)=>g(e,t,"fexamdate"),sortDirections:["descend","ascend"],width:"15%"},{title:"Qp Code",dataIndex:"fqpcode",...p("fqpcode","QP Code"),sorter:(e,t)=>g(e,t,"fqpcode"),sortDirections:["descend","ascend"],width:"10%",align:"center"},{title:"Subject Name",dataIndex:"fsubname",...p("fsubname","Subject Name"),sorter:(e,t)=>g(e,t,"fsubname"),sortDirections:["descend","ascend"],width:"21%"},{title:"Set",dataIndex:"fnoqp",width:"5%",align:"center"},{title:"Year/Mode",render:(e,t)=>a.jsx("span",{children:t.fyear+"/"+t.fexamtype}),width:"7%",align:"center",hidden:!0},{title:"Teacher Code",dataIndex:"fteachcode",...p("fteachcode","Teacher Code"),sorter:(e,t)=>g(e,t,"fteachcode"),sortDirections:["descend","ascend"],width:"10%",align:"center"},{title:"No .of Versions",render:(e,t)=>a.jsx(_,{size:"small",maxLength:1,style:{textAlign:"center"},value:t.fversions,onChange:r=>y(r,t,"fversions")}),width:"6%",align:"center"},{title:"Date",dataIndex:"ffinaldate",width:"8%",align:"center"},{title:"Report",render:(e,t)=>a.jsxs(c,{size:"medium",style:{background:"green",color:"white"},onClick:()=>R(t),children:[a.jsx(re,{}),"Report"]}),width:"8%",align:"center"},{title:"Action",render:(e,t)=>a.jsx(ne,{checked:t.ffinalpaper==="T",onChange:r=>y(r,t,"ffinalpaper")}),width:"5%",align:"center"}];return a.jsxs($,{style:{margin:"6rem 10px 10px"},title:a.jsx("h6",{children:"Select Final MCQ Question Paper"}),extra:a.jsxs(ee,{children:[a.jsxs(c,{type:"primary",onClick:()=>k(),children:[a.jsx(te,{})," Save"]}),a.jsx(z,{to:"/",children:a.jsxs(c,{type:"primary",danger:!0,children:[a.jsx(ae,{})," Exit"]})})]}),children:[a.jsxs(w,{gutter:10,children:[a.jsxs(o,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[a.jsx("label",{children:"Exam"}),a.jsx(d,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:m,options:I,onChange:e=>l(e,"deggrp")})]}),a.jsxs(o,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[a.jsx("label",{children:"QP Code"}),a.jsx(d,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:f,options:T,onChange:e=>l(e,"qpcode")})]}),a.jsxs(o,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[a.jsx("label",{children:"Degree"}),a.jsx(d,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:u,options:B,onChange:e=>l(e,"degree")})]}),a.jsxs(o,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[a.jsx("label",{children:"Sem"}),a.jsx(d,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:b,options:M,onChange:e=>l(e,"sem")})]})]}),a.jsxs(w,{gutter:10,children:[a.jsxs(o,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[a.jsx("label",{children:"Status"}),a.jsx(d,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:S,options:J,onChange:e=>l(e,"status")})]}),a.jsxs(o,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[a.jsx("p",{style:{marginTop:"20px"}}),a.jsx(c,{type:"primary",style:{marginBottom:"10px"},loading:s.btnLoading,onClick:()=>F(),children:"Submit"})]})]}),q&&a.jsx(se,{scroll:{x:1300,y:300},dataSource:x,columns:L,size:"small",pagination:V})]})},le=s=>({deggrp:s.deggrp,examnames:s.examnames,board:s.board,qpcode:s.availableSubjects,degree:s.degree,btnLoading:s.loader.btnLoading,getPreparedOmrQp:s.getPreparedOmrQp,user:s.loginfo.userData}),Qe=N(le,{getQpDeggrp:Y,getAvailableSubjects:K,getQpDegree:U,getPreparedOmrQns:X,saveOMRFinalPaper:Z})(oe);export{Qe as default};