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.216.156.226
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/ModQpDetailsOffline-50KzRUPf.js |
import{x as L,r as l,t as e,B as m,E as F,M as A,D as E,L as N,R as V}from"./index-DNLfgd66.js";import{a as $,u as T,b as Y}from"./ModQpDetails-C_jkcNzI.js";import{U as k,R as y}from"./UploadOutlined-BJPeH4q9.js";import{F as Q}from"./Table-BSOQ4BWe.js";import{S as B}from"./index-Cegtx7Nr.js";import{R as K}from"./ArrowLeftOutlined-GF0uN8JT.js";import{R as H}from"./HomeOutlined-DwpzT65z.js";import"./index-Dpalldti.js";import"./index-CdwpRzQe.js";import"./DeleteOutlined-SX1JhiA6.js";import"./index-p2sVlXNE.js";import"./responsiveObserver-DLOaSOjc.js";const J=t=>{const[S,w]=l.useState([]),[c,p]=l.useState([]),[f,h]=l.useState([]),[u,x]=l.useState([]),[r,o]=l.useState([]),[U,b]=l.useState(""),[_,D]=l.useState(""),[C,M]=l.useState(""),[O,q]=l.useState(""),g="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",P="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(()=>{w(t.modUpdData)},[t.modUpdData]);const j=async(i,a,n)=>{if(n==="anskey"){const d={...f};if(i.fileList.length>0){const s=i.fileList[0].name.split(".").pop();if(s!=="docx"&&s!=="doc"&&s!=="pdf"){F("info","Select word or pdf file only");return}d[a.key]=i.fileList,h(d),D("Yes")}else{const s={...f,[a.key]:[]};h(s),D("No")}}else if(n==="qp"){const d={...c};if(i.fileList.length>0){const s=i.fileList[0].name.split(".").pop();if(s!=="docx"&&s!=="doc"&&s!=="pdf"){F("info","Select word or pdf file only");return}d[a.key]=i.fileList,p(d),b("Yes")}else{const s={...d,[a.key]:[]};p(s),b("No")}}else if(n==="mod"){const d={...u};if(i.fileList.length>0){const s=i.fileList[0].name.split(".").pop();if(s!=="docx"&&s!=="doc"&&s!=="pdf"){F("info","Select word or pdf file only");return}d[a.key]=i.fileList,x(d),M("Yes")}else{const s={...d,[a.key]:[]};x(s),M("No")}}else if(n==="rem"){const d={...r};if(i.fileList.length>0){const s=i.fileList[0].name.split(".").pop();if(s!=="docx"&&s!=="doc"&&s!=="pdf"){F("info","Select word or pdf file only");return}d[a.key]=i.fileList,o(d),q("Yes")}else{const s={...d,[a.key]:[]};o(s),q("No")}}},v=async i=>{A.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},n=new FormData;n.append("data",JSON.stringify(a)),n.append("ansstatus",_),n.append("qpstatus",U),n.append("modstatus",C),n.append("remstatus",O),u[i.key]&&u[i.key][0]&&n.append("modFromFile",u[i.key][0].originFileObj),c[i.key]&&c[i.key][0]&&n.append("qpfile",c[i.key][0].originFileObj),f[i.key]&&f[i.key][0]&&n.append("anskeyfile",f[i.key][0].originFileObj),r[i.key]&&r[i.key][0]&&n.append("remfile",r[i.key][0].originFileObj),await t.uploadModQpData(n,t.getModUpdData,a)},z=[{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(k,{onClick:()=>p([]),fileList:c[a.key]||[],onChange:n=>j(n,a,"qp"),beforeUpload:()=>!1,children:e.jsx(m,{size:"medium",icon:e.jsx(y,{}),children:"Select File"})}),a.fmodqpupd!==""&&e.jsx("a",{target:"_blank",href:g+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(k,{onClick:()=>h([]),fileList:f[a.key]||[],onChange:n=>j(n,a,"anskey"),beforeUpload:()=>!1,children:e.jsx(m,{size:"medium",icon:e.jsx(y,{}),children:"Select File"})}),a.fmodanskey!==""&&e.jsx("a",{target:"_blank",href:g+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(k,{onClick:()=>x([]),fileList:u[a.key]||[],onChange:n=>j(n,a,"mod"),beforeUpload:()=>!1,children:e.jsx(m,{size:"medium",icon:e.jsx(y,{}),children:"Select File"})}),a.fmodform!==""&&e.jsx("a",{target:"_blank",href:g+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:P,target:"_blank",download:!0,children:"Download Rem. Form"}),e.jsx("br",{}),e.jsx(k,{onClick:()=>o([]),fileList:r[a.key]||[],onChange:n=>j(n,a,"rem"),beforeUpload:()=>!1,children:e.jsx(m,{size:"medium",icon:e.jsx(y,{}),children:"Select File"})}),a.fmodremfile!==""&&e.jsx("a",{target:"_blank",href:g+a.fmodremfile,children:"View"})]}),align:"center",width:"28%",hidden:t.user.funivcode!="040"&&!0},{title:"Action",render:(i,a)=>e.jsxs(m,{size:"medium",style:{background:"green",color:"#fff"},onClick:()=>v(a),children:[e.jsx(y,{}),"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(Q,{columns:z,dataSource:S,scroll:{x:1300,y:500}})]})},G=t=>({user:t.loginfo.userData,modUpdData:t.getModUpdData}),W=L(G,{getModUpdData:$,uploadModQpData:T})(J),X=t=>{const[S,w]=l.useState([]),c="https://qp-scheme.s3.ap-south-1.amazonaws.com/",[p,f]=l.useState(!1),[h,u]=l.useState({});l.useEffect(()=>{t.getModQpDetailsOffline()},[]),l.useEffect(()=>{w(t.getModDataOffline)},[t.getModDataOffline]);const x=[{title:"Sl. No",dataIndex:"fslno",align:"center",width:"5%"},{title:"QP Code",dataIndex:"fqpcode",align:"center",width:"10%"},{title:"Subject Name",dataIndex:"fsubname",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:(r,o)=>e.jsx("span",{style:{color:o.fmodqpdate==""?"#f00":"green"},children:o.fmodqpdate!=""?"Completed":"Pending"}),width:"10%",align:"center"},{title:"Syllabus",render:(r,o)=>e.jsx("a",{href:c+o.fqpsyllabus,target:"_blank",children:"View"}),width:"7%",align:"center"},{title:"Action",render:(r,o)=>e.jsxs(m,{size:"medium",onClick:()=>{f(!0),u(o)},style:{color:"white",background:"green"},children:[e.jsx(V,{}),"View"]}),width:"10%",align:"center"}];return e.jsx(E,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Upload QP Details (Moderator)"}),extra:e.jsxs(B,{children:[p&&e.jsxs(m,{onClick:()=>f(!1),style:{color:"white",background:"green"},children:[e.jsx(K,{}),"Back"]}),e.jsx(N,{to:"/",children:e.jsxs(m,{type:"primary",danger:!0,children:[e.jsx(H,{})," Exit"]})})]}),children:p?e.jsx(W,{element:h,url:c}):e.jsx(Q,{dataSource:S,columns:x,scroll:{x:1300,y:500},pagination:!1})})},Z=t=>({user:t.loginfo.userData,getModDataOffline:t.getModQpOffile}),me=L(Z,{getModQpDetailsOffline:Y})(X);export{me as default};
|