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.145.41
import{x as de,r as i,t as l,D as ce,B as g,L as fe,G as S,F as N,E as I,az as pe,O as xe}from"./index-Is9XtHie.js";import{a as ue,s as me}from"./ViewQPScr-So82r9IR.js";import{g as P,s as Q}from"./datatable-DsD0V4Jt.js";import{g as ge,a as he,d as ye,e as be}from"./UploadQpPattern-CiLxI6yM.js";import{p as je}from"./sem-BK69X1ab.js";import{S as Se}from"./index-CSi-MGd8.js";import{R as ke}from"./StopOutlined-Ca_uOtxC.js";import{R as Ae}from"./HomeOutlined-CjAzSN_j.js";import{R as z,C as f}from"./row-B8thTKGU.js";import{F as we}from"./Table-B_maB7cA.js";import{U,R as H}from"./UploadOutlined-Crz47Nkf.js";import{R as Fe}from"./SaveOutlined-Dssk_YmS.js";import"./responsiveObserver--Upg3Sxi.js";import"./index-DSeK6DxR.js";import"./index-Dc-kPuzY.js";import"./index-BwH0cby2.js";import"./DeleteOutlined-DjGgr-GW.js";const De=n=>{localStorage.getItem("dbname");const[h,C]=i.useState(""),[q,w]=i.useState("All"),[O,y]=i.useState("All"),[R,k]=i.useState("All"),[B,p]=i.useState("All"),[T,c]=i.useState("All"),[F,o]=i.useState([]),[_,d]=i.useState(!1),[$,Ie]=i.useState("https://moderator-upd.s3.ap-south-1.amazonaws.com/"),[x,D]=i.useState([]),[G,V]=i.useState(""),[u,v]=i.useState([]),[J,M]=i.useState("");i.useEffect(()=>{n.getQpDeggrp()},[]),i.useEffect(()=>{o(n.viewQPData)},[n.viewQPData]);const m=(e,t)=>{t=="deggrp"&&(C(e),w("All"),k("All"),y("All"),p("All"),c(""),n.getQpBoard(e),n.getAvailableSubjects(e,"All"),n.getQpDegree(e),o([]),d(!1)),t=="board"&&(w(e),k("All"),y("All"),p("All"),c(""),o([]),d(!1),n.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 a="";e.target.checked==!0?a="T":e.target.checked==!1&&(a="F");const s=F.map(r=>(t.fqpcode==r.fqpcode&&t.fyear==r.fyear&&t.fset==r.fset&&(r.ffinalqpstatus=a),r));o(s)},E=async(e,t,a)=>{if(a=="FINQP"){const s={...x};if(e.fileList.length>0){if(e.fileList[0].name.split(".").pop()!=="pdf"){I("info","Select pdf only");return}s[t.key]=e.fileList,D(s),V(t.key)}else{const r={...x,[t.key]:[]};D(r),V("")}}else if(a=="FINANS"){const s={...u};if(e.fileList.length>0){if(e.fileList[0].name.split(".").pop()!=="pdf"){I("info","Select pdf only");return}s[t.key]=e.fileList,v(s),M(t.key)}else{const r={...u,[t.key]:[]};v(r),M("")}}},L=async()=>{if(h==""){I("error","Select Exam");return}const e=new FormData;e.append("exam",h),e.append("board",q),e.append("degree",R),e.append("qpcode",O),e.append("sem",B),e.append("ffinaldate",T),await n.getFinalQPData(e),d(!0)},X=async(e,t,a,s)=>{const r=F.map(j=>(e.fqpcode==j.fqpcode&&e.fyear==j.fyear&&e.fset==j.fset&&(j.fremarks=s),j));o(r)},W=async e=>{if(e.fremarks==""&&e.ffinalqpstatus==""&&x==""&&u=="")return;let t="",a="";x!=[]&&e.key===G&&(t=x[e.key][0].originFileObj),u!=[]&&e.key===J&&(a=u[e.key][0].originFileObj);const s=new FormData;s.append("univcode",n.user.funivcode),s.append("exam",h),s.append("userID",n.userId),s.append("finQPFile",t),s.append("finAnsFile",a),s.append("data",JSON.stringify(e)),await n.saveFinQPAnsDet(s),L()},Y=e=>{let t=localStorage.getItem("dbname");window.open(xe+"/app.php?a=getOmrQpReport&univcode="+n.user.funivcode+"&db="+t+"&qpcode="+e.fqpcode+"&year="+e.fyear+"&mode="+e.fexamtype+"&teachcode="+e.fteachcode+"&noqp="+e.fset+"&type="+e.ftype)},Z=[{title:"Sl. No.",render:(e,t,a)=>a+1,align:"center",width:"3rem"},{title:l.jsx("div",{style:{textAlign:"center"},children:"Degree"}),dataIndex:"fdegree",...P("fdegree","degree"),sorter:(e,t)=>Q(e,t,"fdegree"),sortDirections:["descend","ascend"],width:"5rem",align:"center"},{title:"QP",dataIndex:"fqpcode",align:"center",...P("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",...P("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:a=>a.target.style.textDecoration="underline",onMouseOut:a=>a.target.style.textDecoration="none",onClick:a=>t.fpretype==="online"?Y(t):b(t.fmodqpupd),children:"View"}),align:"center",width:"3rem"},{title:"Ans. Key",render:(e,t)=>l.jsx("p",{style:{cursor:"pointer",color:"blue"},onMouseOver:a=>a.target.style.textDecoration="underline",onMouseOut:a=>a.target.style.textDecoration="none",onClick:a=>b(t.fmodanskey),children:"View"}),align:"center",width:"3rem"},{title:"Mod Form",render:(e,t)=>l.jsx("p",{style:{cursor:"pointer",color:"blue"},onMouseOver:a=>a.target.style.textDecoration="underline",onMouseOut:a=>a.target.style.textDecoration="none",onClick:a=>b(t.fmodform),children:"View"}),align:"center",width:"3rem"},{title:"Upload Final QP",render:(e,t)=>l.jsxs("div",{children:[l.jsx(U,{onClick:()=>D([]),fileList:x[t.key]||[],onChange:a=>E(a,t,"FINQP"),beforeUpload:()=>!1,disabled:t.ffinl=="T",children:l.jsx(g,{size:"medium",icon:l.jsx(H,{}),children:"Select File"})}),l.jsx("br",{}),t.ffinalqppath!==""&&l.jsx("p",{style:{cursor:"pointer",color:"blue"},onMouseOver:a=>a.target.style.textDecoration="underline",onMouseOut:a=>a.target.style.textDecoration="none",onClick:a=>b(t.ffinalqppath),children:"View"})]}),align:"center",width:"8rem"},{title:"Upload Final Ans Key",render:(e,t)=>l.jsxs("div",{children:[l.jsx(U,{onClick:()=>v([]),fileList:u[t.key]||[],onChange:a=>E(a,t,"FINANS"),beforeUpload:()=>!1,disabled:t.ffinl=="T",children:l.jsx(g,{size:"medium",icon:l.jsx(H,{}),children:"Select File"})}),l.jsx("br",{}),t.ffinalanspath!==""&&l.jsx("p",{style:{cursor:"pointer",color:"blue"},onMouseOver:a=>a.target.style.textDecoration="underline",onMouseOut:a=>a.target.style.textDecoration="none",onClick:a=>b(t.ffinalanspath),children:"View"})]}),align:"center",width:"8rem"},{title:"Remarks",render:(e,t,a)=>l.jsx("div",{children:l.jsx(pe,{type:"text",disabled:t.ffinl=="T",value:t.fremarks,onChange:s=>X(t,a,"fremarks",s.target.value)})}),align:"center",width:"12rem"},{title:"Final",render:(e,t)=>l.jsx(N,{type:"checkbox",onChange:a=>K(a,t),value:t.ffinalqpstatus,checked:t.ffinalqpstatus=="T",disabled:t.ffinl=="T"}),align:"center",width:"3rem"},{title:"Action",render:(e,t)=>l.jsxs(g,{size:"medium",style:{background:"green",color:"#fff"},onClick:a=>W(t),disabled:t.ffinl=="T",children:[l.jsx(Fe,{}),"Save"]}),align:"center",width:"6rem"}],A=[{key:"All",value:"All",label:"All"}],ee=n.deggrp.map(e=>({key:e.fdeggrp,value:e.fdeggrp,label:e.fdescpn})),te=n.board.map(e=>({key:e.fboardcode,value:e.fboardcode,label:e.fboardname})),le=[...A,...te],ae=n.degree.map(e=>({key:e.fdegree,value:e.fdegree,label:e.fdescpn})),ne=[...A,...ae],se=n.qpcode.map(e=>({key:e.fqpcode,value:e.fqpcode,label:e.fsubname})),ie=[...A,...se],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"}],oe=[...A,...re];return l.jsxs(ce,{style:{margin:"6rem 10px 10px"},title:l.jsx("h6",{children:"View Final Question Paper"}),extra:l.jsxs(Se,{children:[l.jsx(g,{type:"primary",icon:l.jsx(ke,{}),style:{backgroundColor:"#1b1c1d"},onClick:()=>{C(""),w("All"),k("All"),y("All"),p("All"),c(""),o([]),d(!1)},size:"medium",children:"Clear"}),l.jsx(fe,{to:"/",children:l.jsx(g,{type:"primary",icon:l.jsx(Ae,{}),danger:!0,size:"medium",children:"Exit"})})]}),children:[l.jsxs(z,{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:ee,onChange:e=>m(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:le,onChange:e=>m(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:ie,onChange:e=>m(e,"qpcode")})]})]}),l.jsxs(z,{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:R,options:ne,onChange:e=>m(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:B,options:oe,onChange:e=>m(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=>m(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(g,{type:"primary",style:{marginBottom:"10px"},onClick:()=>L(),children:"Submit"})]})]}),_==!0?l.jsx(we,{dataSource:F,columns:Z,pagination:je,bordered:!0,size:"small",scroll:{x:1300,y:300}}):null]})},ve=n=>({user:n.loginfo.userData,userId:n.loginfo.userData.fregno,deggrp:n.deggrp,board:n.board,qpcode:n.availableSubjects,degree:n.degree,viewQPData:n.viewFinalQP}),$e=de(ve,{getFinalQPData:ue,saveFinQPAnsDet:me,getQpDeggrp:ge,getQpBoard:he,getAvailableSubjects:ye,getQpDegree:be})(De);export{$e as default};
|