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.119.116.125
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/QpPattern-CZrjlYBL.js |
import{x as ie,r as n,t as s,D as oe,B as r,L as de,G as c,E as m}from"./index-CT0MCJRS.js";import{s as pe,a as F,p as re,b as ce}from"./sem-DLpF_ddZ.js";import{g as me,a as ue,b as ge,c as xe,u as he}from"./UploadQpPattern-DElAccNE.js";import{f as u,g as O,s as B}from"./datatable-DHQpgOL0.js";import{S as fe}from"./index-BXd_zj4l.js";import{R as be}from"./StopOutlined-BC1K77n5.js";import{R as ye}from"./HomeOutlined-tFTk3wpO.js";import{R as _,C as g}from"./row-kYbFF_mS.js";import{F as Se}from"./Table-hKK0LBJN.js";import{U as R,R as k}from"./UploadOutlined-BV_BmvNp.js";import"./responsiveObserver-zv9EbOz7.js";import"./index-Deb-I35J.js";import"./index-CyeMQuwW.js";import"./index-BIuGNSBg.js";import"./DeleteOutlined-C7WWyiMl.js";const je=l=>{const[x,T]=n.useState("Select"),[w,I]=n.useState("All"),[b,E]=n.useState("All"),[P,v]=n.useState("All"),[Q,N]=n.useState("pending"),[z,C]=n.useState([]),[d,y]=n.useState([]),[p,S]=n.useState([]),[o,j]=n.useState([]),[V,q]=n.useState(""),[Y,A]=n.useState(""),[$,D]=n.useState(""),[G,H]=n.useState(!1),L="https://qp-scheme.s3.ap-south-1.amazonaws.com/";n.useEffect(()=>{l.getQpDeggrp()},[]),n.useEffect(()=>{C(l.patternDetails)},[l.patternDetails]);const h=async(e,t)=>{e==="deggrp"&&(T(t),await l.getQpBoard(t),await l.getQpcode(t,"All")),e==="board"&&(I(t),l.getQpcode(x,t)),e==="qpcode"&&E(t),e==="sem"&&v(t),e==="status"&&N(t)},U=async(e,t,a)=>{if(a==="scheme"){const i={...o};if(e.fileList.length>0)i[t.key]=e.fileList,j(i),D(t.key);else{const f={...o,[t.key]:[]};j(f),D("")}}else if(a==="qp"){const i={...p};if(e.fileList.length>0)i[t.key]=e.fileList,S(i),A(t.key);else{const f={...i,[t.key]:[]};S(f),A("")}}else if(a==="syllabus"){const i={...d};if(e.fileList.length>0)i[t.key]=e.fileList,y(i),q(t.key);else{const f={...i,[t.key]:[]};y(f),q("")}}},J=(e,t)=>{const a=z;a[e.key].ftempcode=t,C([...a])},W=async()=>{if(x==="Select"){m("info","Select degree group");return}if(b===""){m("info","Select Subject");return}const e=new FormData;e.append("deggrp",x),e.append("board",w),e.append("qpcode",b),e.append("sem",P),e.append("status",Q),await l.getQpPatternUpdDetails(e),H(!0)},K=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===Y||e.key===V||e.key===$){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:w,qpcode:b,sem:P,status:Q};await l.uploadQpPattern(t,a,l.getQpPatternUpdDetails)}else{m("info","Please upload QP Pattern or Syllabus file");return}},M=[...l.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),...pe],X=l.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),Z=[...F,...X],ee=l.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname+" ["+e.fqpcode+"]",value:e.fqpcode})),te=[...F,...ee],se=[...F,...ce],le=[...F,{key:"pending",label:"Pending",value:"pending"},{key:"uploaded",label:"Uploaded",value:"uploaded"}],ae=[{title:"Sl. No",dataIndex:"slno",align:"center",width:"3%"},{title:"Qp Code",dataIndex:"fqpcode",...O("fqpcode","qpcode"),sorter:(e,t)=>B(e,t,"fqpcode"),sortDirections:["descend","ascend"],align:"center",width:"7%"},{title:"Subject Name",dataIndex:"fsubname",...O("fsubname","subname"),sorter:(e,t)=>B(e,t,"fsubname"),sortDirections:["descend","ascend"],width:"30%"},{title:"Upload Scheme Pattern",render:(e,t)=>s.jsxs("div",{children:[s.jsx(R,{onClick:()=>j([]),fileList:o[t.key]||[],onChange:a=>U(a,t,"scheme"),beforeUpload:()=>!1,children:s.jsx(r,{size:"medium",icon:s.jsx(k,{}),children:"Select File"})}),t.FSCHPATTERN!==""&&s.jsx("a",{target:"_blank",href:L+t.FSCHPATTERN,children:"View"})]}),align:"center",width:"14%"},{title:"Upload QP Pattern",render:(e,t)=>s.jsxs("div",{children:[s.jsx(R,{onClick:()=>S([]),fileList:p[t.key]||[],onChange:a=>U(a,t,"qp"),beforeUpload:()=>!1,children:s.jsx("div",{children:s.jsx(r,{size:"medium",icon:s.jsx(k,{}),children:"Select File"})})}),t.FQPPATREN!==""&&s.jsx("a",{target:"_blank",href:L+t.FQPPATREN,children:"View"})]}),width:"14%",align:"center"},{title:"Upload Qp Syllabus",render:(e,t)=>s.jsxs("div",{children:[s.jsx(R,{onClick:()=>y([]),fileList:d[t.key]||[],onChange:a=>U(a,t,"syllabus"),beforeUpload:()=>!1,children:s.jsx("div",{children:s.jsx(r,{size:"medium",icon:s.jsx(k,{}),children:"Select File"})})}),t.FQPSYLLABUS!==""&&s.jsx("a",{target:"_blank",href:L+t.FQPSYLLABUS,children:"View"})]}),align:"center",width:"14%"},{title:"Temp. Code",dataIndex:"ftempcode",...O("ftempcode","tempcode"),sorter:(e,t)=>B(e,t,"ftempcode"),sortDirections:["descend","ascend"],render:(e,t)=>s.jsx("div",{children:s.jsx(c,{filterOption:u,size:"medium",showSearch:!0,style:{width:"100%"},options:l.tempcodes,value:t.ftempcode,onChange:a=>J(t,a)})}),width:"10%",align:"center"},{title:"Action",render:(e,t)=>s.jsxs(r,{onClick:()=>K(t),size:"medium",style:{background:"green",color:"#fff"},children:[s.jsx(k,{})," Upload"]}),align:"center",width:"9%"}],ne=()=>{T("Select"),I("All"),E("All"),v("All"),N("pending"),C([]),y([]),S([]),j([]),q(""),A(""),D(""),H(!1)};return s.jsxs(oe,{style:{margin:"6rem 10px 10px"},title:s.jsx("h6",{children:"Upload QP Pattern"}),extra:s.jsxs(fe,{children:[s.jsxs(r,{style:{background:"black",color:"white"},onClick:()=>ne(),children:[s.jsx(be,{})," Clear"]}),s.jsx(de,{to:"/",children:s.jsxs(r,{type:"primary",danger:!0,children:[s.jsx(ye,{})," Exit"]})})]}),children:[s.jsxs(_,{gutter:10,children:[s.jsxs(g,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[s.jsx("label",{children:"Degree Group"}),s.jsx(c,{filterOption:u,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:M,value:x,onChange:e=>h("deggrp",e)})]}),s.jsxs(g,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[s.jsx("label",{children:"Board"}),s.jsx(c,{filterOption:u,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:w,options:Z,onChange:e=>h("board",e)})]}),s.jsxs(g,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[s.jsx("label",{children:"Qp Code"}),s.jsx(c,{filterOption:u,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:b,options:te,onChange:e=>h("qpcode",e)})]}),s.jsxs(g,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[s.jsx("label",{children:"Sem"}),s.jsx(c,{filterOption:u,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:se,value:P,onChange:e=>h("sem",e)})]})]}),s.jsxs(_,{gutter:10,children:[s.jsxs(g,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[s.jsx("label",{children:"Status"}),s.jsx(c,{filterOption:u,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:Q,options:le,onChange:e=>h("status",e)})]}),s.jsxs(g,{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:()=>W(),children:"Submit"})]})]}),G&&s.jsx(Se,{style:{marginTop:"20px"},dataSource:z,scroll:{x:1300},bordered:!0,columns:ae,size:"small",pagination:re})]})},Fe=l=>({deggrp:l.deggrp,board:l.board,qpcode:l.qpcode,tempcodes:l.tempcodes,patternDetails:l.patternDetails,univcode:l.loginfo.userData.funivcode}),ve=ie(Fe,{getQpDeggrp:me,getQpBoard:ue,getQpcode:ge,getQpPatternUpdDetails:xe,uploadQpPattern:he})(je);export{ve as default};
|