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.147.46.174
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/ViewFinalQP-8QIEba--.js |
import{x as oe,r,t as l,D as de,B as m,L as ce,G as S,F as N,E as P,aE as fe}from"./index-CAvdhLGp.js";import{a as pe,s as xe}from"./ViewQPScr-U2Rod7n_.js";import{g as I,s as Q}from"./datatable-D5cr6YDQ.js";import{g as ue,a as ge,d as me,e as he}from"./UploadQpPattern-CgkmT2NZ.js";import{S as ye}from"./index-Bthn8aXT.js";import{R as be}from"./StopOutlined-BEG6BTui.js";import{R as je}from"./HomeOutlined-CsEPm3IA.js";import{R as U,C as f}from"./row-B9GdCjYT.js";import{F as Se}from"./Table-UOfxwYBm.js";import{U as z,R as H}from"./UploadOutlined-B5WcHIAP.js";import{R as ke}from"./SaveOutlined-Bos2u4YC.js";import"./responsiveObserver-CtD7KI5g.js";import"./index-D4XjlJqh.js";import"./index-BX9F7V_3.js";import"./index-DmG-UXL6.js";import"./DeleteOutlined-CJCYzgSk.js";const Ae=a=>{localStorage.getItem("dbname");const[h,C]=r.useState(""),[q,F]=r.useState("All"),[O,y]=r.useState("All"),[B,k]=r.useState("All"),[R,p]=r.useState("All"),[T,c]=r.useState("All"),[w,o]=r.useState([]),[_,d]=r.useState(!1),[$,we]=r.useState("https://moderator-upd.s3.ap-south-1.amazonaws.com/"),[x,D]=r.useState([]),[G,V]=r.useState(""),[u,v]=r.useState([]),[J,E]=r.useState("");r.useEffect(()=>{a.getQpDeggrp()},[]),r.useEffect(()=>{o(a.viewQPData)},[a.viewQPData]);const g=(e,t)=>{t=="deggrp"&&(C(e),F("All"),k("All"),y("All"),p("All"),c(""),a.getQpBoard(e),a.getAvailableSubjects(e,"All"),a.getQpDegree(e),o([]),d(!1)),t=="board"&&(F(e),k("All"),y("All"),p("All"),c(""),o([]),d(!1),a.getAvailableSubjects(h,e)),t=="fdegree"&&(k(e),y("All"),p("All"),c(""),o([]),d(!1)),t=="qpcode"&&(y(e),p("All"),c(""),o([]),d(!1)),t=="fexamno"&&(p(e),c(""),o([]),d(!1)),t=="ffinaldate"&&(c(e),o([]),d(!1))},b=async e=>{window.open($+e)},K=async(e,t)=>{let n="";e.target.checked==!0?n="T":e.target.checked==!1&&(n="F");const s=w.map(i=>(t.fqpcode==i.fqpcode&&t.fyear==i.fyear&&t.fset==i.fset&&(i.ffinalqpstatus=n),i));o(s)},M=async(e,t,n)=>{if(n=="FINQP"){const s={...x};if(e.fileList.length>0){if(e.fileList[0].name.split(".").pop()!=="pdf"){P("info","Select pdf only");return}s[t.key]=e.fileList,D(s),V(t.key)}else{const i={...x,[t.key]:[]};D(i),V("")}}else if(n=="FINANS"){const s={...u};if(e.fileList.length>0){if(e.fileList[0].name.split(".").pop()!=="pdf"){P("info","Select pdf only");return}s[t.key]=e.fileList,v(s),E(t.key)}else{const i={...u,[t.key]:[]};v(i),E("")}}},L=async()=>{if(h==""){P("error","Select Exam");return}const e=new FormData;e.append("exam",h),e.append("board",q),e.append("degree",B),e.append("qpcode",O),e.append("sem",R),e.append("ffinaldate",T),await a.getFinalQPData(e),d(!0)},X=async(e,t,n,s)=>{const i=w.map(j=>(e.fqpcode==j.fqpcode&&e.fyear==j.fyear&&e.fset==j.fset&&(j.fremarks=s),j));o(i)},W=async e=>{if(e.fremarks==""&&e.ffinalqpstatus==""&&x==""&&u=="")return;let t="",n="";x!=[]&&e.key===G&&(t=x[e.key][0].originFileObj),u!=[]&&e.key===J&&(n=u[e.key][0].originFileObj);const s=new FormData;s.append("univcode",a.user.funivcode),s.append("exam",h),s.append("userID",a.userId),s.append("finQPFile",t),s.append("finAnsFile",n),s.append("data",JSON.stringify(e)),await a.saveFinQPAnsDet(s),L()},Y=[{title:"Sl. No.",render:(e,t,n)=>n+1,align:"center",width:"3rem"},{title:l.jsx("div",{style:{textAlign:"center"},children:"Degree"}),dataIndex:"fdegree",...I("fdegree","degree"),sorter:(e,t)=>Q(e,t,"fdegree"),sortDirections:["descend","ascend"],width:"5rem",align:"center"},{title:"QP",dataIndex:"fqpcode",align:"center",...I("fqpcode","qpcode"),sorter:(e,t)=>Q(e,t,"fqpcode"),sortDirections:["descend","ascend"],width:"5rem"},{title:l.jsx("div",{style:{textAlign:"center"},children:"Subject Name"}),dataIndex:"fsubname",...I("fsubname","subname"),sorter:(e,t)=>Q(e,t,"fsubname"),sortDirections:["descend","ascend"],width:"16rem"},{title:"Date Time",dataIndex:"ffinalpaperdate",align:"center",width:"6rem"},{title:"Q.P.",render:(e,t)=>l.jsx("p",{style:{cursor:"pointer",color:"blue"},onMouseOver:n=>n.target.style.textDecoration="underline",onMouseOut:n=>n.target.style.textDecoration="none",onClick:n=>b(t.fmodqpupd),children:"View"}),align:"center",width:"3rem"},{title:"Ans. Key",render:(e,t)=>l.jsx("p",{style:{cursor:"pointer",color:"blue"},onMouseOver:n=>n.target.style.textDecoration="underline",onMouseOut:n=>n.target.style.textDecoration="none",onClick:n=>b(t.fmodanskey),children:"View"}),align:"center",width:"3rem"},{title:"Mod Form",render:(e,t)=>l.jsx("p",{style:{cursor:"pointer",color:"blue"},onMouseOver:n=>n.target.style.textDecoration="underline",onMouseOut:n=>n.target.style.textDecoration="none",onClick:n=>b(t.fmodform),children:"View"}),align:"center",width:"3rem"},{title:"Upload Final QP",render:(e,t)=>l.jsxs("div",{children:[l.jsx(z,{onClick:()=>D([]),fileList:x[t.key]||[],onChange:n=>M(n,t,"FINQP"),beforeUpload:()=>!1,disabled:t.ffinl=="T",children:l.jsx(m,{size:"medium",icon:l.jsx(H,{}),children:"Select File"})}),l.jsx("br",{}),t.ffinalqppath!==""&&l.jsx("p",{style:{cursor:"pointer",color:"blue"},onMouseOver:n=>n.target.style.textDecoration="underline",onMouseOut:n=>n.target.style.textDecoration="none",onClick:n=>b(t.ffinalqppath),children:"View"})]}),align:"center",width:"8rem"},{title:"Upload Final Ans Key",render:(e,t)=>l.jsxs("div",{children:[l.jsx(z,{onClick:()=>v([]),fileList:u[t.key]||[],onChange:n=>M(n,t,"FINANS"),beforeUpload:()=>!1,disabled:t.ffinl=="T",children:l.jsx(m,{size:"medium",icon:l.jsx(H,{}),children:"Select File"})}),l.jsx("br",{}),t.ffinalanspath!==""&&l.jsx("p",{style:{cursor:"pointer",color:"blue"},onMouseOver:n=>n.target.style.textDecoration="underline",onMouseOut:n=>n.target.style.textDecoration="none",onClick:n=>b(t.ffinalanspath),children:"View"})]}),align:"center",width:"8rem"},{title:"Remarks",render:(e,t,n)=>l.jsx("div",{children:l.jsx(fe,{type:"text",disabled:t.ffinl=="T",value:t.fremarks,onChange:s=>X(t,n,"fremarks",s.target.value)})}),align:"center",width:"12rem"},{title:"Final",render:(e,t)=>l.jsx(N,{type:"checkbox",onChange:n=>K(n,t),value:t.ffinalqpstatus,checked:t.ffinalqpstatus=="T",disabled:t.ffinl=="T"}),align:"center",width:"3rem"},{title:"Action",render:(e,t)=>l.jsxs(m,{size:"medium",style:{background:"green",color:"#fff"},onClick:n=>W(t),disabled:t.ffinl=="T",children:[l.jsx(ke,{}),"Save"]}),align:"center",width:"6rem"}],A=[{key:"All",value:"All",label:"All"}],Z=a.deggrp.map(e=>({key:e.fdeggrp,value:e.fdeggrp,label:e.fdescpn})),ee=a.board.map(e=>({key:e.fboardcode,value:e.fboardcode,label:e.fboardname})),te=[...A,...ee],le=a.degree.map(e=>({key:e.fdegree,value:e.fdegree,label:e.fdescpn})),ne=[...A,...le],ae=a.qpcode.map(e=>({key:e.fqpcode,value:e.fqpcode,label:e.fsubname})),se=[...A,...ae],re=[{key:"A",value:"A",label:"I Semester"},{key:"B",value:"B",label:"II Semester"},{key:"C",value:"C",label:"III Semester"},{key:"D",value:"D",label:"IV Semester"},{key:"E",value:"E",label:"V Semester"},{key:"F",value:"F",label:"VI Semester"},{key:"G",value:"G",label:"VII Semester"},{key:"H",value:"H",label:"VIII Semester"},{key:"I",value:"I",label:"IX Semester"},{key:"J",value:"J",label:"X Semester"}],ie=[...A,...re];return l.jsxs(de,{style:{margin:"6rem 10px 10px"},title:l.jsx("h6",{children:"View Final Question Paper"}),extra:l.jsxs(ye,{children:[l.jsx(m,{type:"primary",icon:l.jsx(be,{}),style:{backgroundColor:"#1b1c1d"},onClick:()=>{C(""),F("All"),k("All"),y("All"),p("All"),c(""),o([]),d(!1)},size:"medium",children:"Clear"}),l.jsx(ce,{to:"/",children:l.jsx(m,{type:"primary",icon:l.jsx(je,{}),danger:!0,size:"medium",children:"Exit"})})]}),children:[l.jsxs(U,{gutter:16,children:[l.jsxs(f,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[l.jsx("label",{children:"Exam"}),l.jsx(S,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:h,options:Z,onChange:e=>g(e,"deggrp")})]}),l.jsxs(f,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[l.jsx("label",{children:"Board"}),l.jsx(S,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:q,options:te,onChange:e=>g(e,"board")})]}),l.jsxs(f,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[l.jsx("label",{children:"QP Code"}),l.jsx(S,{showSearch:!0,className:"ant-select-item-option-content",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:O,options:se,onChange:e=>g(e,"qpcode")})]})]}),l.jsxs(U,{gutter:16,children:[l.jsxs(f,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[l.jsx("label",{children:"Degree"}),l.jsx(S,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:B,options:ne,onChange:e=>g(e,"fdegree")})]}),l.jsxs(f,{xs:24,sm:24,md:12,lg:4,xl:4,xxl:4,children:[l.jsx("label",{children:"Sem"}),l.jsx(S,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:R,options:ie,onChange:e=>g(e,"fexamno")})]}),l.jsxs(f,{xs:24,sm:24,md:12,lg:4,xl:4,xxl:4,children:[l.jsx("label",{children:"Date"}),l.jsx(N,{type:"date",value:T,onChange:e=>g(e.target.value,"ffinaldate")})]}),l.jsxs(f,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[l.jsx("p",{style:{marginTop:"20px"}}),l.jsx(m,{type:"primary",style:{marginBottom:"10px"},onClick:()=>L(),children:"Submit"})]})]}),_==!0?l.jsx(Se,{dataSource:w,columns:Y,pagination:!0,bordered:!0,size:"small",scroll:{x:1300,y:300}}):null]})},Fe=a=>({user:a.loginfo.userData,userId:a.loginfo.userData.fregno,deggrp:a.deggrp,board:a.board,qpcode:a.availableSubjects,degree:a.degree,viewQPData:a.viewFinalQP}),Ue=oe(Fe,{getFinalQPData:pe,saveFinQPAnsDet:xe,getQpDeggrp:ue,getQpBoard:ge,getAvailableSubjects:me,getQpDegree:he})(Ae);export{Ue as default};
|