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