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.191.192.250
import{v as A,M as K,E as u,x as B,r as i,y as z,t,B as g,D as M,L as Y,G as H}from"./index-DoOhtRM-.js";import{U as b,R as k}from"./UploadOutlined-BywrhFSM.js";import{S as V}from"./index-DAtDV0BY.js";import{R as W}from"./HomeOutlined-RRy07SvX.js";import{R as $,C as G}from"./row-B8SdGvkB.js";import{F as J}from"./Table-Dzx3CwGy.js";import"./index-Dp7SaHdv.js";import"./index-Gneb6Krm.js";import"./DeleteOutlined-BL8kPxK9.js";import"./responsiveObserver-BniLz5dQ.js";import"./index-BKpnzzI6.js";const X=(n,x)=>async(s,h)=>{try{const r=h();let o=localStorage.getItem("dbname");s({type:"SET_LOADER"});const p=await A.get("app.php?a=getQpUploadDetails&db="+o+"&userid="+r.loginfo.userData.fregno+"&fstatus="+x);if(s({type:"UNSET_LOADER"}),p.data.error_code===-2)K.confirm({title:"Warning",content:"Please update bank details before you proceed, Click ok to update bank details",okButtonProps:{style:{backgroundColor:"#8231d3",borderColor:"#8231d3"}},onOk(){n("/qpsettings/bank-details")},onCancel(){console.log("Cancelled")}});else if(typeof p.data!="object")u("Error","Something Went wrong, please try again later");else if(p.data.error_code===0){let m=p.data.data.result.map((y,f)=>({...y,key:f,fslno:f+1}));s({type:"SET_QP_UPLOAD_DETAILS",payload:m}),s({type:"QP_UPD_NOTE",payload:p.data.data.fnote})}else s({type:"CLEAR_SET_QP_UPLOAD_DETAILS",payload:[]}),s({type:"CLEAR_QP_UPD_NOTE",payload:{}}),u("Info","No data found")}catch(r){console.log(r.message)}},Z=(n,x)=>async(s,h)=>{try{let r=localStorage.getItem("dbname");s({type:"SET_LOADER"});const o=await A.post("app.php?a=uploadQuestionPaper&db="+r,n);s({type:"UNSET_LOADER"}),o.data.error_code===0?(u("success",o.data.data.msg),x()):u("info",o.data.data.msg)}catch(r){u("Error",r.message)}},ee=n=>{const x="https://qp-scheme.s3.ap-south-1.amazonaws.com/",s="https://qp-upd.s3.ap-south-1.amazonaws.com/",[h,r]=i.useState([]),[o,p]=i.useState([]),[m,y]=i.useState([]),[f,S]=i.useState([]),[E,F]=i.useState([]),[q,U]=i.useState([]),[C,P]=i.useState([]),[ae,_]=i.useState(""),[R,L]=i.useState(""),[ne,w]=i.useState(""),[D,I]=i.useState("Pending"),Q=z(),v="https://universitysolutions.in/univadmin/QP_Details/"+n.user.funivcode+"_QP_Setting_Remuneration_Format.docx";i.useEffect(()=>{n.getQpUploadDetails(Q,D)},[]),i.useEffect(()=>{r(n.qpUpdData)},[n.qpUpdData]);const j=async(a,e,c)=>{if(c==="anskey"){const d={...o};if(a.fileList.length>0){const l=a.fileList[0].name.split(".").pop();if(l!=="docx"&&l!=="doc"){u("info","Select word file only");return}d[e.key]=a.fileList,p(d),_(e.key),F("Yes")}else{const l={...o,[e.key]:[]};p(l),_(""),F("No")}}else if(c==="qp"){const d={...m};if(a.fileList.length>0){const l=a.fileList[0].name.split(".").pop();if(l!=="docx"&&l!=="doc"){u("info","Select word file only");return}d[e.key]=a.fileList,y(d),L(e.key),U("Yes")}else{const l={...d,[e.key]:[]};y(l),L(""),U("No")}}else if(c==="rem"){const d={...f};if(a.fileList.length>0){const l=a.fileList[0].name.split(".").pop();if(l!=="docx"&&l!=="doc"){u("info","Select word file only");return}d[e.key]=a.fileList,S(d),w(e.key),P("Yes")}else{const l={...d,[e.key]:[]};S(l),w(""),P("No")}}},N=[{key:"All",label:"All",value:"All"},{key:"Uploaded",label:"Uploaded",value:"Uploaded"},{key:"Pending",label:"Pending",value:"Pending"}],O=async a=>{if(a.key!=R){u("info","Please select the files to upload");return}const e=new FormData;e.append("qpcode",a.fqpcode),e.append("set",a.fset),e.append("yearmode",a.fexam),e.append("type",a.ftype),e.append("userid",n.user.fregno),e.append("collcode",n.user.fcollcode),e.append("mobileno",n.user.fmobile),e.append("univcode",n.user.funivcode),e.append("ansstatus",E),e.append("qpstatus",q),e.append("remstatus",C),f[a.key]&&f[a.key][0]&&e.append("remfile",f[a.key][0].originFileObj),m[a.key]&&m[a.key][0]&&e.append("qpfile",m[a.key][0].originFileObj),o[a.key]&&o[a.key][0]&&e.append("anskeyfile",o[a.key][0].originFileObj),await n.uploadQuestionPaper(e,n.getQpUploadDetails)},T=[{title:"Sl. No.",dataIndex:"fslno",align:"center"},{title:"QP. Code",dataIndex:"fqpcode",align:"center"},{title:"Subject Name",render:(a,e)=>t.jsx("span",{children:e.fsubname+" - "+e.FSUBSHORT})},{title:"Max. Marks",dataIndex:"fvalmax",align:"center",hidden:n.user.funivcode=="030"&&!0},{title:"Set No.",dataIndex:"fset",align:"center"},{title:"Type",dataIndex:"ftype",align:"center"},{title:"Syllabus with CO's",render:(a,e)=>t.jsx("a",{href:x+e.FQPSYLLABUS,target:"_blank",download:!0,children:"Download"}),align:"center"},{title:"QP Pattern",render:(a,e)=>t.jsx("a",{href:x+e.FQPPATREN,target:"_blank",download:!0,children:"Download"}),align:"center"},{title:"Uploaded Date",dataIndex:"qpupd",align:"center"},{title:"Status",render:(a,e)=>t.jsx("p",{children:e.qpupd!=""?t.jsx("span",{style:{color:"green"},children:" Completed "}):t.jsx("span",{style:{color:"red"},children:" Pending"})}),align:"center"},{title:"Upload Ans Key",render:(a,e)=>t.jsxs("div",{children:[t.jsx(b,{onClick:()=>p([]),fileList:o[e.key]||[],onChange:c=>j(c,e,"anskey"),beforeUpload:()=>!1,children:t.jsx(g,{size:"medium",icon:t.jsx(k,{}),children:"Select File"})}),e.fanskeypath!==""&&t.jsx("a",{href:s+e.fanskeypath,target:"_blank",download:!0,children:"View"})]}),align:"center",hidden:n.user.funivcode=="040"&&!0},{title:"Upload QP",render:(a,e)=>t.jsxs("div",{children:[t.jsx(b,{onClick:()=>y([]),fileList:m[e.key]||[],onChange:c=>j(c,e,"qp"),beforeUpload:()=>!1,children:t.jsx(g,{size:"medium",icon:t.jsx(k,{}),children:"Select File"})}),e.fqpfilepath!==""&&t.jsx("a",{href:s+e.fqpfilepath,target:"_blank",download:!0,children:"View"})]}),align:"center"},{title:"Remuneration Det.",render:(a,e)=>t.jsxs("div",{children:[t.jsx("a",{href:v,target:"_blank",download:!0,children:"Rem. Form"}),t.jsx("br",{}),t.jsx(b,{onClick:()=>S([]),fileList:f[e.key]||[],onChange:c=>j(c,e,"rem"),beforeUpload:()=>!1,children:t.jsx(g,{size:"medium",icon:t.jsx(k,{}),children:"Select File"})}),e.fremfile!==""&&t.jsx("a",{href:s+e.fremfile,target:"_blank",download:!0,children:"View"})]}),align:"center",hidden:n.user.funivcode!="040"&&!0},{title:"Action",render:(a,e)=>t.jsx(g,{size:"medium",style:{background:"green",color:"#fff"},onClick:()=>O(e),children:t.jsx(k,{})}),align:"center"}];return t.jsxs(M,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Upload Question Paper"}),extra:t.jsx(V,{children:t.jsx(Y,{to:"/",children:t.jsxs(g,{type:"primary",danger:!0,children:[t.jsx(W,{})," Exit"]})})}),children:[n.user.funivcode=="040"?t.jsxs("p",{children:[t.jsx("b",{style:{color:"red",textAlign:"justify"},children:"Attention: "}),"Only one bill will be considered. Additional bills uploaded will not be taken into account."]}):t.jsx("div",{style:{color:"red",marginBottom:"20px"},dangerouslySetInnerHTML:{__html:n.qpUpdNote.fnote}}),t.jsx($,{gutter:10,children:t.jsxs(G,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Status"}),t.jsx(H,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:D,options:N,onChange:a=>{I(a),n.getQpUploadDetails(Q,a)}})]})}),t.jsx(J,{dataSource:h,columns:T,pagination:!1,scroll:{x:1300}})]})},te=n=>({user:n.loginfo.userData,qpUpdData:n.qpUpdData,qpUpdNote:n.qpUpdNote}),xe=B(te,{getQpUploadDetails:X,uploadQuestionPaper:Z})(ee);export{xe as default};
|