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.43.92
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-C8M3lyNu.js";import{a as h,c as J,s as V}from"./sem-xL-Ac5nH.js";import{g as W,d as Y,e as K}from"./UploadQpPattern-kidoxO1-.js";import{a as U,b as X}from"./SelectFinalQP-Mlkonpjy.js";import{g as p,s as g}from"./datatable-Pcc3qusZ.js";import{S as Z}from"./index-Bhb34QNg.js";import{R as ee}from"./SaveOutlined-CtFciPoQ.js";import{R as te}from"./HomeOutlined-C5ZSuxRe.js";import{R as w,C as o}from"./row-B_crsxDb.js";import{F as ae,C as se}from"./Table-CCr-bhsx.js";import{R as re}from"./FilePdfOutlined-DZ7XPEq8.js";import"./responsiveObserver-iG098kB7.js";import"./index-C1EEZ13m.js";const ne=s=>{const[x,C]=n.useState(""),[f,Q]=n.useState("All"),[u,D]=n.useState("All"),[b,P]=n.useState("All"),[S,O]=n.useState("All"),[m,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"&&P(e),t==="degree"&&D(e),t==="status"&&O(e)},F=async()=>{if(x===""){H("info","please select degree group");return}const e={deggrp:x,qpcode:f,degree:u,sem:b,status:S};await s.getPreparedOmrQns(e),v(!0)},y=(e,t,r)=>{const i=m;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=m.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,...V],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"},{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(se,{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(Z,{children:[a.jsxs(c,{type:"primary",onClick:()=>k(),children:[a.jsx(ee,{})," Save"]}),a.jsx(z,{to:"/",children:a.jsxs(c,{type:"primary",danger:!0,children:[a.jsx(te,{})," 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:x,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(ae,{scroll:{x:1300,y:300},dataSource:m,columns:L,size:"small"})]})},oe=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}),ye=N(oe,{getQpDeggrp:W,getAvailableSubjects:Y,getQpDegree:K,getPreparedOmrQns:U,saveOMRFinalPaper:X})(ne);export{ye as default};
|