0xV3NOMx
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.148.117.240


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/ModQpDetailsOffline-5jJFkPv-.js

import{x as C,r as l,t as e,B as r,E as S,M as E,D as N,L as V,G as T,R as $}from"./index-CvUjCcnC.js";import{a as B,u as Y,b as K}from"./ModQpDetails-C3XaDmYe.js";import{p as G}from"./sem-BK69X1ab.js";import{U as w,R as j}from"./UploadOutlined-D6DChkKD.js";import{F as O}from"./Table-Bjn0CUkG.js";import{g as U}from"./datatable-Cq5oUA82.js";import{S as H}from"./index-cBpPe4Bv.js";import{R as J}from"./ArrowLeftOutlined-RglHXYvr.js";import{R as W}from"./HomeOutlined-Ch4dEWnc.js";import{R as X,C as Z}from"./row-BjYGaq9p.js";import"./index-Ox-82G5m.js";import"./index-B2bo5HG1.js";import"./DeleteOutlined-DfZVJcYo.js";import"./index-Bcns0PqO.js";import"./responsiveObserver-DEIyf_nc.js";const ee=t=>{const[b,D]=l.useState([]),[c,x]=l.useState([]),[d,h]=l.useState([]),[m,g]=l.useState([]),[p,y]=l.useState([]),[M,u]=l.useState(""),[f,q]=l.useState(""),[P,Q]=l.useState(""),[v,L]=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",_="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,n)=>{if(n==="anskey"){const o={...d};if(i.fileList.length>0){const s=i.fileList[0].name.split(".").pop();if(s!=="docx"&&s!=="doc"&&s!=="pdf"){S("info","Select word or pdf file only");return}o[a.key]=i.fileList,h(o),q("Yes")}else{const s={...d,[a.key]:[]};h(s),q("No")}}else if(n==="qp"){const o={...c};if(i.fileList.length>0){const s=i.fileList[0].name.split(".").pop();if(s!=="docx"&&s!=="doc"&&s!=="pdf"){S("info","Select word or pdf file only");return}o[a.key]=i.fileList,x(o),u("Yes")}else{const s={...o,[a.key]:[]};x(s),u("No")}}else if(n==="mod"){const o={...m};if(i.fileList.length>0){const s=i.fileList[0].name.split(".").pop();if(s!=="docx"&&s!=="doc"&&s!=="pdf"){S("info","Select word or pdf file only");return}o[a.key]=i.fileList,g(o),Q("Yes")}else{const s={...o,[a.key]:[]};g(s),Q("No")}}else if(n==="rem"){const o={...p};if(i.fileList.length>0){const s=i.fileList[0].name.split(".").pop();if(s!=="docx"&&s!=="doc"&&s!=="pdf"){S("info","Select word or pdf file only");return}o[a.key]=i.fileList,y(o),L("Yes")}else{const s={...o,[a.key]:[]};y(s),L("No")}}},z=async i=>{E.confirm({title:"Upload",content:"Are you sure ?",onOk(){A(i)}})},A=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},n=new FormData;n.append("data",JSON.stringify(a)),n.append("ansstatus",f),n.append("qpstatus",M),n.append("modstatus",P),n.append("remstatus",v),m[i.key]&&m[i.key][0]&&n.append("modFromFile",m[i.key][0].originFileObj),c[i.key]&&c[i.key][0]&&n.append("qpfile",c[i.key][0].originFileObj),d[i.key]&&d[i.key][0]&&n.append("anskeyfile",d[i.key][0].originFileObj),p[i.key]&&p[i.key][0]&&n.append("remfile",p[i.key][0].originFileObj),await t.uploadModQpData(n,t.getModUpdData,a)},I=[{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(w,{onClick:()=>x([]),fileList:c[a.key]||[],onChange:n=>F(n,a,"qp"),beforeUpload:()=>!1,children:e.jsx(r,{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(w,{onClick:()=>h([]),fileList:d[a.key]||[],onChange:n=>F(n,a,"anskey"),beforeUpload:()=>!1,children:e.jsx(r,{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(w,{onClick:()=>g([]),fileList:m[a.key]||[],onChange:n=>F(n,a,"mod"),beforeUpload:()=>!1,children:e.jsx(r,{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:_,target:"_blank",download:!0,children:"Download Rem. Form"}),e.jsx("br",{}),e.jsx(w,{onClick:()=>y([]),fileList:p[a.key]||[],onChange:n=>F(n,a,"rem"),beforeUpload:()=>!1,children:e.jsx(r,{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(r,{size:"medium",style:{background:"green",color:"#fff"},onClick:()=>z(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(O,{columns:I,dataSource:b,scroll:{x:1300,y:500},pagination:G})]})},te=t=>({user:t.loginfo.userData,modUpdData:t.getModUpdData}),ae=C(te,{getModUpdData:B,uploadModQpData:Y})(ee),ie=t=>{const[b,D]=l.useState([]),[c,x]=l.useState("Pending"),d="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:"5%"},{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:"5%",align:"center"},{title:"Type",dataIndex:"ftype",width:"10%",align:"center"},{title:"Mod. Date",dataIndex:"fmodqpdate",width:"10%",align:"center"},{title:"Mod. Status",render:(u,f)=>e.jsx("span",{style:{color:f.fmodqpdate==""?"#f00":"green"},children:f.fmodqpdate!=""?"Completed":"Pending"}),width:"10%",align:"center"},{title:"Syllabus",render:(u,f)=>e.jsx("a",{href:d+f.fqpsyllabus,target:"_blank",children:"View"}),width:"7%",align:"center"},{title:"Action",render:(u,f)=>e.jsx("div",{children:f.fmodstatus=="T"?e.jsx(r,{size:"medium",style:{color:"white",background:"#f00"},children:"Freezed"}):e.jsxs(r,{size:"medium",onClick:()=>{m(!0),p(f)},style:{color:"white",background:"green"},children:[e.jsx($,{}),"View"]})}),width:"10%",align:"center"}],M=[{key:"All",label:"All",value:"All"},{key:"Uploaded",label:"Uploaded",value:"Uploaded"},{key:"Pending",label:"Pending",value:"Pending"}];return e.jsx(N,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Upload QP Details (Moderator)"}),extra:e.jsxs(H,{children:[h&&e.jsxs(r,{onClick:()=>m(!1),style:{color:"white",background:"green"},children:[e.jsx(J,{}),"Back"]}),e.jsx(V,{to:"/",children:e.jsxs(r,{type:"primary",danger:!0,children:[e.jsx(W,{})," Exit"]})})]}),children:h?e.jsx(ae,{element:g,url:d}):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(T,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:c,options:M,onChange:u=>{x(u),t.getModQpDetailsOffline(u)}})]})}),e.jsx(O,{dataSource:b,columns:y,scroll:{x:1300,y:500},pagination:!1})]})})},ne=t=>({user:t.loginfo.userData,getModDataOffline:t.getModQpOffile}),ke=C(ne,{getModQpDetailsOffline:K})(ie);export{ke as default};