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/AssignModerator-D7I7CqcO.js |
import{v as k,E as y,x as L,r as c,t as a,D as _,B as j,L as P,G as f}from"./index-BdqWE2h0.js";import{I as T}from"./index-Vv64JQvm.js";import{a as N,t as H,p as Q,f as D}from"./sem-CXAFzSxe.js";import{g as z,a as U,d as G}from"./UploadQpPattern-CPreJ8an.js";import{S as $}from"./index-B7GPTdui.js";import{R as J}from"./SaveOutlined-rIgOkuSb.js";import{R as Y}from"./HomeOutlined-bYwHUz93.js";import{R as E,C as u}from"./row-ClwU4WuY.js";import{F as K}from"./Table-nj-tka-C.js";import{C as w}from"./index-DLmCS154.js";import"./responsiveObserver-D_yFkblv.js";import"./index-BMsG2LUN.js";import"./index-COY1jP5b.js";const V=(...s)=>async(o,m)=>{try{const l=m();let h=localStorage.getItem("dbname");o({type:"SET_LOADER"});const n=await k.get("app.php?a=getAssignModeratorDetails&db="+h+"&board="+s[1]+"&qpcode="+s[2]+"°grp="+s[0]+"&qptype="+s[3]+"&fuser="+l.loginfo.userData.fregno);if(o({type:"UNSET_LOADER"}),n.data.error_code===0){const b=n.data.data.mod.map((p,i)=>({...p,key:i,fslno:i+1})),x=n.data.data.teach.map((p,i)=>({key:i,value:p.fteachcode,label:p.fteachname+" ["+p.fteachcode+"]"}));o({type:"MOD_DETAILS",payload:b}),o({type:"TEACHER_DETAILS",payload:x})}else o({type:"MOD_DETAILS",payload:[]}),o({type:"TEACHER_DETAILS",payload:[]})}catch(l){y("error",l.message)}},W=s=>async(o,m)=>{try{const l=m();let h=localStorage.getItem("dbname");o({type:"SET_LOADER"});const n=await k.post("app.php?a=saveAssignModerator&db="+h,s);o({type:"UNSET_LOADER"}),n.data.error_code===0?y("success",n.data.data.msg):y("info",n.data.data.msg)}catch(l){y("error",l.message)}},X=s=>{const[o,m]=c.useState(""),[l,h]=c.useState("All"),[n,b]=c.useState("All"),[x,p]=c.useState("THEORY"),[i,A]=c.useState([]),[C,v]=c.useState(!1);c.useEffect(()=>{s.getQpDeggrp()},[]),c.useEffect(()=>{A(s.getAssignMod)},[s.getAssignMod]);const S=async(e,t)=>{console.log(e,t),t==="deggrp"&&(m(e),b(""),await s.getQpBoard(e),await s.getAvailableSubjects(e,"All")),t==="board"&&(h(e),await s.getAvailableSubjects(o,e)),t==="qpcode"&&b(e),t==="type"&&p(e)},M=async()=>{if(o==="")return y("info","Please Select Degree Group"),!1;await s.getAssignModeratorDetails(o,l,n,x),v(!0)},I=s.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),q=s.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),O=[...N,...q],R=s.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname+" ["+e.fqpcode+"]",value:e.fqpcode})),g=(e,t,r)=>{const d=i;d[t.key][r]=e,d[t.key].onchange="T",A([...d])},F=[{title:"Sl. No",dataIndex:"fslno",align:"center",width:"5%"},{title:"QP Code",dataIndex:"fqpcode",align:"center",width:"9%"},{title:"Subject Name",dataIndex:"fsubname",width:"19%"},{title:"QP Count",dataIndex:"fset",align:"center",width:"5%"},{title:"Uploaded Count",dataIndex:"uploaded",align:"center",width:"5%"},{title:"Moderator",render:(e,t)=>a.jsx(f,{size:"mini",showSearch:!0,optionFilterProp:"label",style:{width:"100%"},value:t.fteachcode,options:s.teachers,onChange:r=>g(r,t,"fteachcode")}),width:"19%"},{title:"From Date",render:(e,t)=>a.jsx(T,{style:{height:"35px"},formatChars:D,className:"date-input",mask:"ed/nm/zyyy",value:t.ffromdate,onChange:r=>g(r.target.value,t,"ffromdate"),placeholder:"dd/mm/yyyy"}),width:"14%"},{title:"To Date",render:(e,t)=>a.jsx(T,{style:{height:"35px"},formatChars:D,className:"date-input",mask:"ed/nm/zyyy",value:t.ftodate,onChange:r=>g(r.target.value,t,"ftodate"),placeholder:"dd/mm/yyyy"}),align:"center",width:"14%"},{title:"Allow Login?",render:(e,t)=>a.jsx(w,{checked:t.fstatus==="T",onChange:r=>{let d=r.target.checked?"T":"F";g(d,t,"fstatus")}}),align:"center",width:"5%"},{title:"Send Email",render:(e,t)=>a.jsx(w,{checked:t.emailstatus==="T",onChange:r=>{let d=r.target.checked?"T":"F";g(d,t,"emailstatus")}}),align:"center",width:"5%"},{title:"Delete?",render:(e,t)=>a.jsx(w,{checked:t.fdeleted==="T",onChange:r=>{let d=r.target.checked?"T":"F";g(d,t,"fdeleted")}}),align:"center",width:"5%"}],B=async()=>{const e=i.filter(r=>r.onchange==="T"),t=new FormData;t.append("user",s.user.fmobile),t.append("univcode",s.user.funivcode),t.append("exam",o),t.append("board",l),t.append("qpcode",n),t.append("qptype",x),t.append("data",JSON.stringify(e)),await s.saveAssignModerator(t)};return a.jsxs(_,{style:{margin:"6rem 10px 10px"},title:a.jsx("h6",{children:"Assign Moderator"}),extra:a.jsxs($,{children:[a.jsxs(j,{type:"primary",onClick:()=>B(),children:[a.jsx(J,{})," Save"]}),a.jsx(P,{to:"/",children:a.jsxs(j,{type:"primary",danger:!0,children:[a.jsx(Y,{})," Exit"]})})]}),children:[a.jsxs(E,{gutter:16,children:[a.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"Exam"}),a.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:o,options:I,onChange:e=>S(e,"deggrp")})]}),a.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"Board"}),a.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:l,options:O,onChange:e=>S(e,"board")})]}),a.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"Subject"}),a.jsx(f,{showSearch:!0,className:"ant-select-item-option-content",optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:n,options:R,onChange:e=>S(e,"qpcode")})]})]}),a.jsxs(E,{gutter:16,children:[a.jsxs(u,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[a.jsx("label",{children:"Type"}),a.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:x,options:H,onChange:e=>S(e,"type")})]}),a.jsxs(u,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[a.jsx("p",{style:{marginTop:"20px"}}),a.jsx(j,{type:"primary",style:{marginBottom:"10px"},onClick:()=>M(),children:"Submit"})]})]}),C&&a.jsx(K,{dataSource:i,columns:F,scroll:{x:1300,y:300},size:"small",pagination:Q})]})},Z=s=>({deggrp:s.deggrp,board:s.board,qpcode:s.availableSubjects,user:s.loginfo.userData,getAssignMod:s.getAssignMod,teachers:s.teachers}),me=L(Z,{getQpDeggrp:z,getQpBoard:U,getAvailableSubjects:G,getAssignModeratorDetails:V,saveAssignModerator:W})(X);export{me as default};
|