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


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

import{x as ae,r as n,t as s,D as ne,L as ie,B as r,G as c,E as m}from"./index-CvUjCcnC.js";import{a as b,p as oe,s as de}from"./sem-BK69X1ab.js";import{g as pe,a as re,b as ce,c as me,u as ue}from"./UploadQpPattern-D63zyykw.js";import{g as q,s as D}from"./datatable-Cq5oUA82.js";import{S as xe}from"./index-cBpPe4Bv.js";import{R as he}from"./HomeOutlined-Ch4dEWnc.js";import{R,C as u}from"./row-BjYGaq9p.js";import{F as ge}from"./Table-Bjn0CUkG.js";import{U as L,R as y}from"./UploadOutlined-D6DChkKD.js";import"./responsiveObserver-DEIyf_nc.js";import"./index-Bcns0PqO.js";import"./index-B2bo5HG1.js";import"./index-Ox-82G5m.js";import"./DeleteOutlined-DfZVJcYo.js";const fe=l=>{const[x,E]=n.useState(""),[S,I]=n.useState("All"),[f,v]=n.useState("All"),[j,N]=n.useState("All"),[F,z]=n.useState("pending"),[U,A]=n.useState([]),[d,k]=n.useState([]),[p,P]=n.useState([]),[o,w]=n.useState([]),[H,B]=n.useState(""),[_,T]=n.useState(""),[V,O]=n.useState(""),[Y,G]=n.useState(!1),Q="https://qp-scheme.s3.ap-south-1.amazonaws.com/";n.useEffect(()=>{l.getQpDeggrp()},[]),n.useEffect(()=>{A(l.patternDetails)},[l.patternDetails]);const h=async(e,t)=>{e==="deggrp"&&(E(t),await l.getQpBoard(t),await l.getQpcode(t,"All")),e==="board"&&(I(t),l.getQpcode(x,t)),e==="qpcode"&&v(t),e==="sem"&&N(t),e==="status"&&z(t)},C=async(e,t,a)=>{if(a==="scheme"){const i={...o};if(e.fileList.length>0)i[t.key]=e.fileList,w(i),O(t.key);else{const g={...o,[t.key]:[]};w(g),O("")}}else if(a==="qp"){const i={...p};if(e.fileList.length>0)i[t.key]=e.fileList,P(i),T(t.key);else{const g={...i,[t.key]:[]};P(g),T("")}}else if(a==="syllabus"){const i={...d};if(e.fileList.length>0)i[t.key]=e.fileList,k(i),B(t.key);else{const g={...i,[t.key]:[]};k(g),B("")}}},$=(e,t)=>{const a=U;a[e.key].ftempcode=t,A([...a])},J=async()=>{if(x===""){m("info","Select degree group");return}if(f===""){m("info","Select Subject");return}const e=new FormData;e.append("deggrp",x),e.append("board",S),e.append("qpcode",f),e.append("sem",j),e.append("status",F),await l.getQpPatternUpdDetails(e),G(!0)},W=async e=>{if(e.tempcode==""&&p.length==0&&d.length==0&&o.length==0){m("info","failed to upload");return}if(l.funivcode==="030"&&(p===null||d===null||o===null)){m("info","upload all the documents");return}if((p==""||e.FQPPATREN=="")&&(o==""||e.FSCHPATTERN=="")&&(d==""||e.FQPSYLLABUS=="")&&e.ftempcode!=""){m("info","Upload all the files");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),p[e.key]&&p[e.key][0]&&t.append("qpFile",p[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));const a={deggrp:x,board:S,qpcode:f,sem:j,status:F};await l.uploadQpPattern(t,a,l.getQpPatternUpdDetails)}else{m("info","Please upload QP Pattern or Syllabus file");return}},K=l.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),M=l.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),X=[...b,...M],Z=l.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname+" ["+e.fqpcode+"]",value:e.fqpcode})),ee=[...b,...Z],te=[...b,...de],se=[...b,{key:"pending",label:"Pending",value:"pending"},{key:"uploaded",label:"Uploaded",value:"uploaded"}],le=[{title:"Sl. No",dataIndex:"slno",align:"center",width:"3%"},{title:"Qp Code",dataIndex:"fqpcode",...q("fqpcode","qpcode"),sorter:(e,t)=>D(e,t,"fqpcode"),sortDirections:["descend","ascend"],align:"center",width:"7%"},{title:"Subject Name",dataIndex:"fsubname",...q("fsubname","subname"),sorter:(e,t)=>D(e,t,"fsubname"),sortDirections:["descend","ascend"],width:"30%"},{title:"Upload Scheme Pattern",render:(e,t)=>s.jsxs("div",{children:[s.jsx(L,{onClick:()=>w([]),fileList:o[t.key]||[],onChange:a=>C(a,t,"scheme"),beforeUpload:()=>!1,children:s.jsx(r,{size:"medium",icon:s.jsx(y,{}),children:"Select File"})}),t.FSCHPATTERN!==""&&s.jsx("a",{target:"_blank",href:Q+t.FSCHPATTERN,children:"View"})]}),align:"center",width:"14%"},{title:"Upload QP Pattern",render:(e,t)=>s.jsxs("div",{children:[s.jsx(L,{onClick:()=>P([]),fileList:p[t.key]||[],onChange:a=>C(a,t,"qp"),beforeUpload:()=>!1,children:s.jsx("div",{children:s.jsx(r,{size:"medium",icon:s.jsx(y,{}),children:"Select File"})})}),t.FQPPATREN!==""&&s.jsx("a",{target:"_blank",href:Q+t.FQPPATREN,children:"View"})]}),width:"14%",align:"center"},{title:"Upload Qp Syllabus",render:(e,t)=>s.jsxs("div",{children:[s.jsx(L,{onClick:()=>k([]),fileList:d[t.key]||[],onChange:a=>C(a,t,"syllabus"),beforeUpload:()=>!1,children:s.jsx("div",{children:s.jsx(r,{size:"medium",icon:s.jsx(y,{}),children:"Select File"})})}),t.FQPSYLLABUS!==""&&s.jsx("a",{target:"_blank",href:Q+t.FQPSYLLABUS,children:"View"})]}),align:"center",width:"14%"},{title:"Temp. Code",dataIndex:"ftempcode",...q("ftempcode","tempcode"),sorter:(e,t)=>D(e,t,"ftempcode"),sortDirections:["descend","ascend"],render:(e,t)=>s.jsx("div",{children:s.jsx(c,{size:"medium",showSearch:!0,style:{width:"100%"},options:l.tempcodes,value:t.ftempcode,onChange:a=>$(t,a)})}),width:"10%",align:"center"},{title:"Action",render:(e,t)=>s.jsxs(r,{onClick:()=>W(t),size:"medium",style:{background:"green",color:"#fff"},children:[s.jsx(y,{})," 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(r,{type:"primary",danger:!0,children:[s.jsx(he,{})," Exit"]})})}),children:[s.jsxs(R,{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:x,onChange:e=>h("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:S,options:X,onChange:e=>h("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:f,options:ee,onChange:e=>h("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:j,onChange:e=>h("sem",e)})]})]}),s.jsxs(R,{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:F,options:se,onChange:e=>h("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(r,{type:"primary",style:{marginBottom:"10px"},onClick:()=>J(),children:"Submit"})]})]}),Y&&s.jsx(ge,{style:{marginTop:"20px"},dataSource:U,scroll:{x:1300},bordered:!0,columns:le,size:"small",pagination:oe})]})},be=l=>({deggrp:l.deggrp,board:l.board,qpcode:l.qpcode,tempcodes:l.tempcodes,patternDetails:l.patternDetails,univcode:l.loginfo.userData.funivcode}),Be=ae(be,{getQpDeggrp:pe,getQpBoard:re,getQpcode:ce,getQpPatternUpdDetails:me,uploadQpPattern:ue})(fe);export{Be as default};