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 : 18.117.101.250


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/QpPattern-DS6867oa.js

import{x as le,r as l,t as s,B as p,G as c,D as ne,L as ie,E as h}from"./index-CYIKbhnb.js";import{a as f,s as oe}from"./sem-Dd1ri5Qb.js";import{g as de,a as re,b as pe,c as ce,u as ue}from"./UploadQpPattern-tIwNgfKP.js";import{g as b,s as y}from"./datatable-TmeU5lzm.js";import{U as C,R as S}from"./UploadOutlined-B6X-fFeF.js";import{S as me}from"./index-D47VtnHA.js";import{R as xe}from"./HomeOutlined-CvmI8okJ.js";import{R as O,C as u}from"./row-Dqg1Zeqa.js";import{F as he}from"./Table-D14CbZ5x.js";import"./index-CBvvA-3u.js";import"./index-C_kgUC9x.js";import"./DeleteOutlined-4VB14N2q.js";import"./responsiveObserver-DfClcaWx.js";import"./index-D-2byGsL.js";const ge=a=>{const[g,T]=l.useState(""),[q,E]=l.useState("All"),[j,R]=l.useState("All"),[D,z]=l.useState("All"),[L,N]=l.useState("pending"),[U,B]=l.useState([]),[d,F]=l.useState([]),[r,k]=l.useState([]),[o,w]=l.useState([]),[H,v]=l.useState(""),[_,A]=l.useState(""),[V,I]=l.useState(""),[Y,$]=l.useState(!1),P="https://qp-scheme.s3.ap-south-1.amazonaws.com/";l.useEffect(()=>{a.getQpDeggrp()},[]),l.useEffect(()=>{B(a.patternDetails)},[a.patternDetails]);const m=async(e,t)=>{e==="deggrp"&&(T(t),await a.getQpBoard(t),await a.getQpcode(t,"All")),e==="board"&&(E(t),a.getQpcode(g,t)),e==="qpcode"&&R(t),e==="sem"&&z(t),e==="status"&&N(t)},Q=async(e,t,n)=>{if(n==="scheme"){const i={...o};if(e.fileList.length>0)i[t.key]=e.fileList,w(i),I(t.key);else{const x={...o,[t.key]:[]};w(x),I("")}}else if(n==="qp"){const i={...r};if(e.fileList.length>0)i[t.key]=e.fileList,k(i),A(t.key);else{const x={...i,[t.key]:[]};k(x),A("")}}else if(n==="syllabus"){const i={...d};if(e.fileList.length>0)i[t.key]=e.fileList,F(i),v(t.key);else{const x={...i,[t.key]:[]};F(x),v("")}}},G=(e,t)=>{const n=U;n[e.key].ftempcode=t,B([...n])},J=async()=>{if(g===""){h("info","Select degree group");return}if(j===""){h("info","Select Subject");return}const e=new FormData;e.append("deggrp",g),e.append("board",q),e.append("qpcode",j),e.append("sem",D),e.append("status",L),await a.getQpPatternUpdDetails(e),$(!0)},W=async e=>{if(e.tempcode==""&&r.length==0&&d.length==0&&o.length==0){h("info","failed to upload");return}if(a.funivcode==="030"&&(r===null||d===null||o===null)){h("info","upload all the documents");return}if(e.key===_||e.key===H||e.key===V){const t=new FormData;o[e.key]&&o[e.key][0]&&t.append("schemeFile",o[e.key][0].originFileObj),r[e.key]&&r[e.key][0]&&t.append("qpFile",r[e.key][0].originFileObj),d[e.key]&&d[e.key][0]&&t.append("syllabusFile",d[e.key][0].originFileObj),t.append("data",JSON.stringify(e)),await a.uploadQpPattern(t)}else{h("info","Please upload QP Pattern or Syllabus file");return}},K=a.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),M=a.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),X=[...f,...M],Z=a.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname+" ["+e.fqpcode+"]",value:e.fqpcode})),ee=[...f,...Z],te=[...f,...oe],se=[...f,{key:"pending",label:"Pending",value:"pending"},{key:"uploaded",label:"Uploaded",value:"uploaded"}],ae=[{title:"Sl. No",dataIndex:"slno",align:"center",width:"5%"},{title:"Qp Code",dataIndex:"fqpcode",...b("fqpcode","qpcode"),sorter:(e,t)=>y(e,t,"fqpcode"),sortDirections:["descend","ascend"],align:"center",width:"10%"},{title:"Subject Name",dataIndex:"fsubname",...b("fsubname","subname"),sorter:(e,t)=>y(e,t,"fsubname"),sortDirections:["descend","ascend"],width:"25%"},{title:"Board",dataIndex:"fboard",...b("fboard","board"),sorter:(e,t)=>y(e,t,"fboard"),sortDirections:["descend","ascend"],align:"center",width:"10%",hidden:a.univcode=="051"&&!0},{title:"Upload Scheme Pattern",render:(e,t)=>s.jsxs("div",{children:[s.jsx(C,{onClick:()=>w([]),fileList:o[t.key]||[],onChange:n=>Q(n,t,"scheme"),beforeUpload:()=>!1,children:s.jsx(p,{size:"medium",icon:s.jsx(S,{}),children:"Select File"})}),t.FSCHPATTERN!==""&&s.jsx("a",{target:"_blank",href:P+t.FSCHPATTERN,children:"View"})]}),align:"center",width:"10%",hidden:(a.univcode=="030"||a.univcode=="051")&&!0},{title:"Upload QP Pattern",render:(e,t)=>s.jsxs("div",{children:[s.jsx(C,{onClick:()=>k([]),fileList:r[t.key]||[],onChange:n=>Q(n,t,"qp"),beforeUpload:()=>!1,children:s.jsx("div",{children:s.jsx(p,{size:"medium",icon:s.jsx(S,{}),children:"Select File"})})}),t.FQPPATREN!==""&&s.jsx("a",{target:"_blank",href:P+t.FQPPATREN,children:"View"})]}),width:"11%",align:"center"},{title:"Upload Qp Syllabus",render:(e,t)=>s.jsxs("div",{children:[s.jsx(C,{onClick:()=>F([]),fileList:d[t.key]||[],onChange:n=>Q(n,t,"syllabus"),beforeUpload:()=>!1,children:s.jsx("div",{children:s.jsx(p,{size:"medium",icon:s.jsx(S,{}),children:"Select File"})})}),t.FQPSYLLABUS!==""&&s.jsx("a",{target:"_blank",href:P+t.FQPSYLLABUS,children:"View"})]}),align:"center",width:"10%"},{title:"Temp. Code",dataIndex:"ftempcode",...b("ftempcode","tempcode"),sorter:(e,t)=>y(e,t,"ftempcode"),sortDirections:["descend","ascend"],render:(e,t)=>s.jsx("div",{children:s.jsx(c,{size:"medium",showSearch:!0,style:{width:"100%"},options:a.tempcodes,value:t.ftempcode,onChange:n=>G(t,n)})}),width:"10%",align:"center"},{title:"Action",render:(e,t)=>s.jsxs(p,{onClick:()=>W(t),size:"medium",style:{background:"green",color:"#fff"},children:[s.jsx(S,{})," Upload"]}),align:"center",width:"9%"}];return s.jsxs(ne,{style:{margin:"6rem 10px 10px"},title:s.jsx("h6",{children:"Upload QP Pattern"}),extra:s.jsx(me,{children:s.jsx(ie,{to:"/",children:s.jsxs(p,{type:"primary",danger:!0,children:[s.jsx(xe,{})," Exit"]})})}),children:[s.jsxs(O,{gutter:10,children:[s.jsxs(u,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[s.jsx("label",{children:"Exam"}),s.jsx(c,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:K,value:g,onChange:e=>m("deggrp",e)})]}),s.jsxs(u,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[s.jsx("label",{children:"Board"}),s.jsx(c,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:q,options:X,onChange:e=>m("board",e)})]}),s.jsxs(u,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[s.jsx("label",{children:"Qp Code"}),s.jsx(c,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:j,options:ee,onChange:e=>m("qpcode",e)})]}),s.jsxs(u,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[s.jsx("label",{children:"Sem"}),s.jsx(c,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:te,value:D,onChange:e=>m("sem",e)})]})]}),s.jsxs(O,{gutter:10,children:[s.jsxs(u,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[s.jsx("label",{children:"Status"}),s.jsx(c,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:L,options:se,onChange:e=>m("status",e)})]}),s.jsxs(u,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[s.jsx("p",{style:{marginTop:"20px"}}),s.jsx(p,{type:"primary",style:{marginBottom:"10px"},onClick:()=>J(),children:"Submit"})]})]}),Y&&s.jsx(he,{style:{marginTop:"20px"},dataSource:U,scroll:{y:300,x:1300},bordered:!0,columns:ae,size:"small"})]})},fe=a=>({deggrp:a.deggrp,board:a.board,qpcode:a.qpcode,tempcodes:a.tempcodes,patternDetails:a.patternDetails,univcode:a.loginfo.userData.funivcode}),Be=le(fe,{getQpDeggrp:de,getQpBoard:re,getQpcode:pe,getQpPatternUpdDetails:ce,uploadQpPattern:ue})(ge);export{Be as default};