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.139.235.100
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/ModQpDetailsOffline-DrIbLMiv.js |
import{x as O,r as l,t as e,B as f,E as S,M as E,D as N,L as V,G as T,R as $}from"./index-QZTwIYNH.js";import{a as B,u as Y,b as K}from"./ModQpDetails-eilRwlBq.js";import{p as G}from"./sem-DLpF_ddZ.js";import{U as w,R as j}from"./UploadOutlined-wJVKD4ta.js";import{F as C}from"./Table-Cc25zE5h.js";import{g as U}from"./datatable-CrsaOLck.js";import{S as H}from"./index-BuLi212C.js";import{R as J}from"./ArrowLeftOutlined-B0yM4ZC6.js";import{R as W}from"./HomeOutlined-Dqkr2h5y.js";import{R as X,C as Z}from"./row-CcxksV_2.js";import"./index-DBO0RidY.js";import"./index-DOQp1pcZ.js";import"./DeleteOutlined-yJJ5vXqV.js";import"./index-CM8Sh-uj.js";import"./responsiveObserver-DIcRJoDZ.js";const ee=t=>{const[b,D]=l.useState([]),[c,x]=l.useState([]),[r,h]=l.useState([]),[m,g]=l.useState([]),[p,y]=l.useState([]),[M,u]=l.useState(""),[d,q]=l.useState(""),[v,L]=l.useState(""),[P,Q]=l.useState(""),k="https://moderator-upd.s3.ap-south-1.amazonaws.com/",_="https://universitysolutions.in/univadmin/QP_Details/051/Q.P.moderation_format_14.03.2023.docx",R="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 o={...r};if(i.fileList.length>0){const n=i.fileList[0].name.split(".").pop();if(n!=="docx"&&n!=="doc"&&n!=="pdf"){S("info","Select word or pdf file only");return}o[a.key]=i.fileList,h(o),q("Yes")}else{const n={...r,[a.key]:[]};h(n),q("No")}}else if(s==="qp"){const o={...c};if(i.fileList.length>0){const n=i.fileList[0].name.split(".").pop();if(n!=="docx"&&n!=="doc"&&n!=="pdf"){S("info","Select word or pdf file only");return}o[a.key]=i.fileList,x(o),u("Yes")}else{const n={...o,[a.key]:[]};x(n),u("No")}}else if(s==="mod"){const o={...m};if(i.fileList.length>0){const n=i.fileList[0].name.split(".").pop();if(n!=="docx"&&n!=="doc"&&n!=="pdf"){S("info","Select word or pdf file only");return}o[a.key]=i.fileList,g(o),L("Yes")}else{const n={...o,[a.key]:[]};g(n),L("No")}}else if(s==="rem"){const o={...p};if(i.fileList.length>0){const n=i.fileList[0].name.split(".").pop();if(n!=="docx"&&n!=="doc"&&n!=="pdf"){S("info","Select word or pdf file only");return}o[a.key]=i.fileList,y(o),Q("Yes")}else{const n={...o,[a.key]:[]};y(n),Q("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},s=new FormData;s.append("data",JSON.stringify(a)),s.append("ansstatus",d),s.append("qpstatus",M),s.append("modstatus",v),s.append("remstatus",P),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)},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: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(w,{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:_,target:"_blank",download:!0,children:"Download Moderator Form"}),e.jsx("br",{}),e.jsx(w,{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:R,target:"_blank",download:!0,children:"Download Rem. Form"}),e.jsx("br",{}),e.jsx(w,{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:()=>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(C,{columns:I,dataSource:b,scroll:{x:1300,y:500},pagination:G})]})},te=t=>({user:t.loginfo.userData,modUpdData:t.getModUpdData}),ae=O(te,{getModUpdData:B,uploadModQpData:Y})(ee),ie=t=>{const[b,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:"8%",align:"center"},{title:"Mod. Status",render:(u,d)=>e.jsx("span",{style:{color:d.fmodqpdate==""?"#f00":"green"},children:d.fmodqpdate!=""?"Completed":"Pending"}),width:"10%",align:"center"},{title:"Syllabus",render:(u,d)=>e.jsx("a",{href:r+d.fqpsyllabus,target:"_blank",children:"View"}),width:"7%",align:"center"},{title:"Last Date",dataIndex:"ftodate",width:"10%",align:"center"},{title:"Action",render:(u,d)=>e.jsx("div",{children:d.flastdate_status!="T"?e.jsx("div",{children:d.fmodstatus=="T"?e.jsx(f,{size:"medium",style:{color:"white",background:"#f00"},children:"Freezed"}):e.jsxs(f,{size:"medium",onClick:()=>{m(!0),p(d)},style:{color:"white",background:"green"},children:[e.jsx($,{}),"View"]})}):e.jsx(f,{size:"medium",style:{color:"white",background:"#f00"},children:"Last Date Over"})}),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(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(T,{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:b,columns:y,scroll:{x:1300,y:500},pagination:!1})]})})},se=t=>(console.log(t.getModQpOffile),{user:t.loginfo.userData,getModDataOffline:t.getModQpOffile}),ke=O(se,{getModQpDetailsOffline:K})(ie);export{ke as default};
|