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


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/QpPattern-DBbNnzpN.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-B1vCiLdb.js";import{a as f,p as oe,s as de}from"./sem-BK69X1ab.js";import{g as re,a as pe,b as ce,c as ue,u as me}from"./UploadQpPattern-DKIQcOZK.js";import{g as b,s as y}from"./datatable-CUbHEgW_.js";import{U as C,R as S}from"./UploadOutlined-BRk-8zRt.js";import{S as xe}from"./index-Bg4J2mA-.js";import{R as he}from"./HomeOutlined-URzAi1xv.js";import{R as O,C as u}from"./row-BpBokYu2.js";import{F as ge}from"./Table-DAx1ImL3.js";import"./index-BYuc-nPv.js";import"./index-Bk72D_Kc.js";import"./DeleteOutlined-Df0cjl3o.js";import"./responsiveObserver-MZZXoO8e.js";import"./index-CQr3Towi.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,A]=l.useState(""),[_,v]=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),v(t.key);else{const x={...i,[t.key]:[]};k(x),v("")}}else if(n==="syllabus"){const i={...d};if(e.fileList.length>0)i[t.key]=e.fileList,F(i),A(t.key);else{const x={...i,[t.key]:[]};F(x),A("")}}},$=(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"&&!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}),Ae=le(be,{getQpDeggrp:re,getQpBoard:pe,getQpcode:ce,getQpPatternUpdDetails:ue,uploadQpPattern:me})(fe);export{Ae as default};