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.118.24.176
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/ModQpDetailsOffline-CV8NwXNE.js |
import{x as O,r as l,t as e,B as f,E as b,M as N,D as T,L as V,G as $,R as B}from"./index-ChT0xYiY.js";import{a as Y,u as K,b as G}from"./ModQpDetails-wcqxVLj0.js";import{p as v}from"./sem-DLpF_ddZ.js";import{U as S,R as j}from"./UploadOutlined-sdLPsBuJ.js";import{F as C}from"./Table-74BLe3me.js";import{g as U}from"./datatable-Pmr3nCys.js";import{S as H}from"./index-CCqRUA_e.js";import{R as J}from"./ArrowLeftOutlined-U4IR5KB7.js";import{R as W}from"./HomeOutlined-C_Cn3B9w.js";import{R as X,C as Z}from"./row-BiiVUFlR.js";import"./index-BDLcy6G-.js";import"./index-cEGmOHHy.js";import"./DeleteOutlined-CPPj1lhl.js";import"./index-G2j282sA.js";import"./responsiveObserver-CMjrehYy.js";const ee=t=>{const[w,D]=l.useState([]),[c,x]=l.useState([]),[r,h]=l.useState([]),[m,g]=l.useState([]),[p,y]=l.useState([]),[M,u]=l.useState(""),[o,q]=l.useState(""),[P,L]=l.useState(""),[_,Q]=l.useState(""),k="https://moderator-upd.s3.ap-south-1.amazonaws.com/",R="https://universitysolutions.in/univadmin/QP_Details/051/Q.P.moderation_format_14.03.2023.docx",z="https://universitysolutions.in/univadmin/QP_Details/"+t.user.funivcode+"_QP_Setting_Remuneration_Format.docx";l.useEffect(()=>{const i={fqpcode:t.element.fqpcode,fteachcode:t.element.fteachcode,fset:t.element.fset,fyear:t.element.fyear,fexamtype:t.element.fexamtype,ftype:t.element.ftype};t.getModUpdData(i)},[]),l.useEffect(()=>{D(t.modUpdData)},[t.modUpdData]);const F=async(i,a,s)=>{if(s==="anskey"){const d={...r};if(i.fileList.length>0){const n=i.fileList[0].name.split(".").pop();if(n!=="docx"&&n!=="doc"&&n!=="pdf"){b("info","Select word or pdf file only");return}d[a.key]=i.fileList,h(d),q("Yes")}else{const n={...r,[a.key]:[]};h(n),q("No")}}else if(s==="qp"){const d={...c};if(i.fileList.length>0){const n=i.fileList[0].name.split(".").pop();if(n!=="docx"&&n!=="doc"&&n!=="pdf"){b("info","Select word or pdf file only");return}d[a.key]=i.fileList,x(d),u("Yes")}else{const n={...d,[a.key]:[]};x(n),u("No")}}else if(s==="mod"){const d={...m};if(i.fileList.length>0){const n=i.fileList[0].name.split(".").pop();if(n!=="docx"&&n!=="doc"&&n!=="pdf"){b("info","Select word or pdf file only");return}d[a.key]=i.fileList,g(d),L("Yes")}else{const n={...d,[a.key]:[]};g(n),L("No")}}else if(s==="rem"){const d={...p};if(i.fileList.length>0){const n=i.fileList[0].name.split(".").pop();if(n!=="docx"&&n!=="doc"&&n!=="pdf"){b("info","Select word or pdf file only");return}d[a.key]=i.fileList,y(d),Q("Yes")}else{const n={...d,[a.key]:[]};y(n),Q("No")}}},A=async i=>{N.confirm({title:"Upload",content:"Are you sure ?",onOk(){I(i)}})},I=async i=>{const a={univcode:t.user.funivcode,fqpcode:t.element.fqpcode,fset:t.element.fset,fteachcode:t.element.fteachcode,fyear:t.element.fyear,fexamtype:t.element.fexamtype,ftype:t.element.ftype,userid:t.user.fregno},s=new FormData;s.append("data",JSON.stringify(a)),s.append("ansstatus",o),s.append("qpstatus",M),s.append("modstatus",P),s.append("remstatus",_),m[i.key]&&m[i.key][0]&&s.append("modFromFile",m[i.key][0].originFileObj),c[i.key]&&c[i.key][0]&&s.append("qpfile",c[i.key][0].originFileObj),r[i.key]&&r[i.key][0]&&s.append("anskeyfile",r[i.key][0].originFileObj),p[i.key]&&p[i.key][0]&&s.append("remfile",p[i.key][0].originFileObj),await t.uploadModQpData(s,t.getModUpdData,a)},E=[{title:"Sl. No",dataIndex:"fslno",align:"center",width:"6%"},{title:"QP File",render:(i,a)=>e.jsxs("div",{children:[e.jsx("a",{href:"https://qp-upd.s3.ap-south-1.amazonaws.com/"+a.fqpfilepath,target:"_blank",children:"Download Qp File"}),e.jsx("br",{}),e.jsx(S,{onClick:()=>x([]),fileList:c[a.key]||[],onChange:s=>F(s,a,"qp"),beforeUpload:()=>!1,children:e.jsx(f,{size:"medium",icon:e.jsx(j,{}),children:"Select File"})}),a.fmodqpupd!==""&&e.jsx("a",{target:"_blank",href:k+a.fmodqpupd,children:"View"})]}),align:"center",width:"28%"},{title:"Ans Key File",render:(i,a)=>e.jsxs("div",{children:[e.jsx("a",{href:"https://qp-upd.s3.ap-south-1.amazonaws.com/"+a.fanskeypath,children:"Download Ans File"}),e.jsx("br",{}),e.jsx(S,{onClick:()=>h([]),fileList:r[a.key]||[],onChange:s=>F(s,a,"anskey"),beforeUpload:()=>!1,children:e.jsx(f,{size:"medium",icon:e.jsx(j,{}),children:"Select File"})}),a.fmodanskey!==""&&e.jsx("a",{target:"_blank",href:k+a.fmodanskey,children:"View"})]}),align:"center",width:"28%",hidden:t.user.funivcode=="040"&&!0},{title:"QP Mod Form",render:(i,a)=>e.jsxs("div",{children:[e.jsx("a",{href:R,target:"_blank",download:!0,children:"Download Moderator Form"}),e.jsx("br",{}),e.jsx(S,{onClick:()=>g([]),fileList:m[a.key]||[],onChange:s=>F(s,a,"mod"),beforeUpload:()=>!1,children:e.jsx(f,{size:"medium",icon:e.jsx(j,{}),children:"Select File"})}),a.fmodform!==""&&e.jsx("a",{target:"_blank",href:k+a.fmodform,children:"View"})]}),align:"center",width:"28%",hidden:t.user.funivcode=="040"&&!0},{title:"Rem. File",render:(i,a)=>e.jsxs("div",{children:[e.jsx("a",{href:z,target:"_blank",download:!0,children:"Download Rem. Form"}),e.jsx("br",{}),e.jsx(S,{onClick:()=>y([]),fileList:p[a.key]||[],onChange:s=>F(s,a,"rem"),beforeUpload:()=>!1,children:e.jsx(f,{size:"medium",icon:e.jsx(j,{}),children:"Select File"})}),a.fmodremfile!==""&&e.jsx("a",{target:"_blank",href:k+a.fmodremfile,children:"View"})]}),align:"center",width:"28%",hidden:t.user.funivcode!="040"&&!0},{title:"Action",render:(i,a)=>e.jsxs(f,{size:"medium",style:{background:"green",color:"#fff"},onClick:()=>A(a),children:[e.jsx(j,{}),"Upload"]}),width:"10%",align:"center"}];return e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("b",{children:" Subname [QP Code]: "}),t.element.fsubname+" ["+t.element.fqpcode+"]"]}),e.jsxs("p",{children:[e.jsx("b",{children:" Syllabus: "}),e.jsx("a",{href:t.url+t.element.fqpsyllabus,children:"View"})]}),e.jsx(C,{columns:E,dataSource:w,scroll:{x:1300,y:500},pagination:v})]})},te=t=>({user:t.loginfo.userData,modUpdData:t.getModUpdData}),ae=O(te,{getModUpdData:Y,uploadModQpData:K})(ee),ie=t=>{const[w,D]=l.useState([]),[c,x]=l.useState("Pending"),r="https://qp-scheme.s3.ap-south-1.amazonaws.com/",[h,m]=l.useState(!1),[g,p]=l.useState({});l.useEffect(()=>{t.getModQpDetailsOffline(c)},[]),l.useEffect(()=>{D(t.getModDataOffline)},[t.getModDataOffline]);const y=[{title:"Sl. No",dataIndex:"fslno",align:"center",width:"4%"},{title:"QP Code",dataIndex:"fqpcode",...U("fqpcode","qpcode"),align:"center",width:"10%"},{title:"Subject Name",dataIndex:"fsubname",...U("fsubname","subname"),width:"23%"},{title:"Set",dataIndex:"fset",width:"4%",align:"center"},{title:"Type",dataIndex:"ftype",width:"6%",align:"center"},{title:"Mod. Date",dataIndex:"fmodqpdate",width:"7%",align:"center"},{title:"Mod. Status",render:(u,o)=>e.jsx("span",{style:{color:o.fmodqpdate==""?"#f00":"green"},children:o.fmodqpdate!=""?"Completed":"Pending"}),width:"10%",align:"center"},{title:"Syllabus",render:(u,o)=>e.jsx("a",{href:r+o.fqpsyllabus,target:"_blank",children:"View"}),width:"7%",align:"center"},{title:"Last Date",dataIndex:"ftodate",width:"8%",align:"center"},{title:"Action",render:(u,o)=>e.jsx("div",{children:o.flastdate_status!="T"?e.jsx("div",{children:o.fmodstatus=="T"?e.jsx(f,{size:"medium",style:{color:"white",background:"#f00"},children:"Freezed"}):e.jsx("div",{children:o.ffinalpaper!=="T"?e.jsxs(f,{size:"medium",onClick:()=>{m(!0),p(o)},style:{color:"white",background:"green"},children:[e.jsx(B,{}),"View"]}):e.jsx(f,{size:"medium",disabled:!0,children:"Moderation Disabled"})})}):e.jsx(f,{size:"medium",style:{color:"white",background:"#f00"},children:"Last Date Over"})}),width:"13%",align:"center"}],M=[{key:"All",label:"All",value:"All"},{key:"Uploaded",label:"Uploaded",value:"Uploaded"},{key:"Pending",label:"Pending",value:"Pending"}];return e.jsx(T,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Upload QP Details (Moderator)"}),extra:e.jsxs(H,{children:[h&&e.jsxs(f,{onClick:()=>m(!1),style:{color:"white",background:"green"},children:[e.jsx(J,{}),"Back"]}),e.jsx(V,{to:"/",children:e.jsxs(f,{type:"primary",danger:!0,children:[e.jsx(W,{})," Exit"]})})]}),children:h?e.jsx(ae,{element:g,url:r}):e.jsxs("div",{children:[e.jsx(X,{gutter:10,children:e.jsxs(Z,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[e.jsx("label",{children:"Status"}),e.jsx($,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:c,options:M,onChange:u=>{x(u),t.getModQpDetailsOffline(u)}})]})}),e.jsx(C,{bordered:!0,dataSource:w,columns:y,scroll:{x:1300,y:500},pagination:v})]})})},se=t=>(console.log(t.getModQpOffile),{user:t.loginfo.userData,getModDataOffline:t.getModQpOffile}),ke=O(se,{getModQpDetailsOffline:G})(ie);export{ke as default};
|