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.217.237.68


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/QpPattern-BhWuk_Lt.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-C4_RfpBA.js";import{a as f,p as oe,s as de}from"./sem-CXAFzSxe.js";import{g as re,a as pe,b as ce,c as ue,u as me}from"./UploadQpPattern-B2HqbeyB.js";import{g as b,s as y}from"./datatable-D83CbIWk.js";import{U as C,R as S}from"./UploadOutlined-DFTwLtuD.js";import{S as xe}from"./index-Da66nqB5.js";import{R as he}from"./HomeOutlined-BjNGf_Fh.js";import{R as O,C as u}from"./row-0E5WM-xF.js";import{F as ge}from"./Table-DlwpUkXd.js";import"./index-Cmx5BmCw.js";import"./index-CDEHAyGL.js";import"./DeleteOutlined-CLZ90JEj.js";import"./responsiveObserver-BeOFwn5G.js";import"./index-CYcvNNv5.js";const fe=a=>{const[g,T]=l.useState(""),[q,R]=l.useState("All"),[j,E]=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(""),[G,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"&&(R(t),a.getQpcode(g,t)),e==="qpcode"&&E(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("")}}},$=(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),Y(!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,...de],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=>$(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(xe,{children:s.jsx(ie,{to:"/",children:s.jsxs(p,{type:"primary",danger:!0,children:[s.jsx(he,{})," 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:"Degree Group"}),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"})]})]}),G&&s.jsx(ge,{style:{marginTop:"20px"},dataSource:U,scroll:{y:300,x:1300},bordered:!0,columns:ae,size:"small",pagination:oe})]})},be=a=>({deggrp:a.deggrp,board:a.board,qpcode:a.qpcode,tempcodes:a.tempcodes,patternDetails:a.patternDetails,univcode:a.loginfo.userData.funivcode}),ve=le(be,{getQpDeggrp:re,getQpBoard:pe,getQpcode:ce,getQpPatternUpdDetails:ue,uploadQpPattern:me})(fe);export{ve as default};