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.117.77
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/UploadQuestionPaper-CDn7vK8l.js |
import{v as A,M as K,E as c,x as B,r as i,y as z,t,B as h,D as M,L as Y,G as H}from"./index-QZTwIYNH.js";import{U as b,R as k}from"./UploadOutlined-wJVKD4ta.js";import{S as V}from"./index-BuLi212C.js";import{R as W}from"./HomeOutlined-Dqkr2h5y.js";import{R as $,C as G}from"./row-CcxksV_2.js";import{F as J}from"./Table-Cc25zE5h.js";import"./index-DBO0RidY.js";import"./index-DOQp1pcZ.js";import"./DeleteOutlined-yJJ5vXqV.js";import"./responsiveObserver-DIcRJoDZ.js";import"./index-CM8Sh-uj.js";const X=(l,x)=>async(s,g)=>{try{const r=g();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(){l("/qpsettings/bank-details")},onCancel(){console.log("Cancelled")}});else if(typeof p.data!="object")c("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:{}}),c("Info","No data found")}catch(r){console.log(r.message)}},Z=(l,x)=>async(s,g)=>{try{let r=localStorage.getItem("dbname");s({type:"SET_LOADER"});const o=await A.post("app.php?a=uploadQuestionPaper&db="+r,l);s({type:"UNSET_LOADER"}),o.data.error_code===0?(c("success",o.data.data.msg),x()):c("info",o.data.data.msg)}catch(r){c("Error",r.message)}},ee=l=>{const x="https://qp-scheme.s3.ap-south-1.amazonaws.com/",s="https://qp-upd.s3.ap-south-1.amazonaws.com/",[g,r]=i.useState([]),[o,p]=i.useState([]),[m,y]=i.useState([]),[f,S]=i.useState([]),[E,w]=i.useState([]),[q,F]=i.useState([]),[C,_]=i.useState([]),[ae,U]=i.useState(""),[R,P]=i.useState(""),[le,L]=i.useState(""),[D,v]=i.useState("Pending"),Q=z(),I="https://universitysolutions.in/univadmin/QP_Details/"+l.user.funivcode+"_QP_Setting_Remuneration_Format.docx";i.useEffect(()=>{l.getQpUploadDetails(Q,D)},[]),i.useEffect(()=>{r(l.qpUpdData)},[l.qpUpdData]);const j=async(a,e,u)=>{if(u==="anskey"){const d={...o};if(a.fileList.length>0){const n=a.fileList[0].name.split(".").pop();if(n!=="docx"&&n!=="doc"&&n!=="pdf"){c("info","Select word / pdf file only");return}d[e.key]=a.fileList,p(d),U(e.key),w("Yes")}else{const n={...o,[e.key]:[]};p(n),U(""),w("No")}}else if(u==="qp"){const d={...m};if(a.fileList.length>0){const n=a.fileList[0].name.split(".").pop();if(n!=="docx"&&n!=="doc"){c("info","Select word file only");return}d[e.key]=a.fileList,y(d),P(e.key),F("Yes")}else{const n={...d,[e.key]:[]};y(n),P(""),F("No")}}else if(u==="rem"){const d={...f};if(a.fileList.length>0){const n=a.fileList[0].name.split(".").pop();if(n!=="docx"&&n!=="doc"){c("info","Select word file only");return}d[e.key]=a.fileList,S(d),L(e.key),_("Yes")}else{const n={...d,[e.key]:[]};S(n),L(""),_("No")}}},T=[{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){c("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",l.user.fregno),e.append("collcode",l.user.fcollcode),e.append("mobileno",l.user.fmobile),e.append("univcode",l.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 l.uploadQuestionPaper(e,l.getQpUploadDetails)},N=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"3%"},{title:"QP. Code",dataIndex:"fqpcode",align:"center",width:"5%"},{title:"Subject Name",render:(a,e)=>t.jsx("span",{children:e.fsubname+" - "+e.FSUBSHORT}),width:"20%"},{title:"Max. Marks",dataIndex:"fvalmax",align:"center",hidden:l.user.funivcode=="030"&&!0,width:"3%"},{title:"Set No.",dataIndex:"fset",align:"center",width:"5%"},{title:"Type",dataIndex:"ftype",align:"center",width:"5%"},{title:"Syllabus with CO's",render:(a,e)=>t.jsx("a",{href:x+e.FQPSYLLABUS,target:"_blank",download:!0,children:"Download"}),align:"center",width:"10%"},{title:"QP Pattern",render:(a,e)=>t.jsx("a",{href:x+e.FQPPATREN,target:"_blank",download:!0,children:"Download"}),align:"center",width:"10%"},{title:"Uploaded Date",dataIndex:"qpupd",align:"center",width:"10%"},{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",width:"5%"},{title:"Upload Ans Key",render:(a,e)=>t.jsxs("div",{children:[t.jsx(b,{onClick:()=>p([]),fileList:o[e.key]||[],onChange:u=>j(u,e,"anskey"),beforeUpload:()=>!1,children:t.jsx(h,{size:"medium",disabled:e.flastdate_status=="T",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:l.user.funivcode=="040"&&!0,width:"10%"},{title:"Upload QP",render:(a,e)=>t.jsxs("div",{children:[t.jsx(b,{onClick:()=>y([]),fileList:m[e.key]||[],onChange:u=>j(u,e,"qp"),beforeUpload:()=>!1,children:t.jsx(h,{size:"medium",icon:t.jsx(k,{}),disabled:e.flastdate_status=="T",children:"Select File"})}),e.fqpfilepath!==""&&t.jsx("a",{href:s+e.fqpfilepath,target:"_blank",download:!0,children:"View"})]}),align:"center",width:"10%"},{title:"Remuneration Det.",render:(a,e)=>t.jsxs("div",{children:[t.jsx("a",{href:I,target:"_blank",download:!0,children:"Rem. Form"}),t.jsx("br",{}),t.jsx(b,{onClick:()=>S([]),fileList:f[e.key]||[],onChange:u=>j(u,e,"rem"),beforeUpload:()=>!1,children:t.jsx(h,{size:"medium",disabled:e.flastdate_status=="T",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:l.user.funivcode!="040"&&!0,width:"10%"},{title:"Action",render:(a,e)=>t.jsx("div",{children:e.flastdate_status=="F"?t.jsx(h,{size:"medium",style:{background:"green",color:"#fff"},onClick:()=>O(e),children:t.jsx(k,{})}):t.jsx("span",{style:{color:"red"},children:"Last Date Over"})}),align:"center",width:"14%"}];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(h,{type:"primary",danger:!0,children:[t.jsx(W,{})," Exit"]})})}),children:[l.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:l.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:T,onChange:a=>{v(a),l.getQpUploadDetails(Q,a)}})]})}),t.jsx(J,{bordered:!0,dataSource:g,columns:N,pagination:!1,scroll:{x:1300}})]})},te=l=>({user:l.loginfo.userData,qpUpdData:l.qpUpdData,qpUpdNote:l.qpUpdNote}),xe=B(te,{getQpUploadDetails:X,uploadQuestionPaper:Z})(ee);export{xe as default};
|