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 : 13.59.1.58
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/EligibleQpSetter-CUopWYEh.js |
import{v as D,E as i,x as q,r as n,t,D as F,B as h,L as N,G as f}from"./index-CvUjCcnC.js";import{a as H,t as G,b as $,p as M}from"./sem-BK69X1ab.js";import{g as U,a as z,d as J}from"./UploadQpPattern-D63zyykw.js";import{g as j,s as E}from"./datatable-Cq5oUA82.js";import{S as W}from"./index-cBpPe4Bv.js";import{R as Y}from"./StopOutlined-BedpKnAJ.js";import{R as K}from"./SaveOutlined-vQtQuQmS.js";import{R as V}from"./HomeOutlined-Ch4dEWnc.js";import{R as C,C as g}from"./row-BjYGaq9p.js";import{F as X}from"./Table-Bjn0CUkG.js";import{C as Z}from"./index-Bcns0PqO.js";import"./responsiveObserver-DEIyf_nc.js";import"./index-Ox-82G5m.js";import"./index-B2bo5HG1.js";const ee=(...a)=>async(s,b)=>{try{let l=localStorage.getItem("dbname");s({type:"SET_LOADER"});const o=await D.get("app.php?a=getEligibleQpSetterts&db="+l+"°grp="+a[0]+"&board="+a[1]+"&qpcode="+a[2]+"&type="+a[3]+"&selected="+a[4]);if(s({type:"UNSET_LOADER"}),o.data.error_code===0){const p=o.data.data.map((m,c)=>({...m,key:c,fslno:c+1}));s({type:"ELIGIBLE_QP_SETTER",payload:p})}else s({type:"CLEAR_ELIGIBLE_QP_SETTER",payload:[]})}catch(l){i("error",l.message)}},te=a=>async(s,b)=>{try{let l=localStorage.getItem("dbname");s({type:"SET_LOADER"});const o=await D.post("app.php?a=saveQpSetters&db="+l,a);s({type:"UNSET_LOADER"}),o.data.error_code===0?i("success",o.data.data.msg):i("info",o.data.data.msg)}catch(l){i("error",l.message)}},ae=a=>{const[s,b]=n.useState("Select"),[l,o]=n.useState("All"),[p,m]=n.useState("Select"),[c,w]=n.useState("THEORY"),[S,u]=n.useState([]),[T,Q]=n.useState("All"),[A,y]=n.useState(!1);n.useEffect(()=>{a.getQpDeggrp()},[]),n.useEffect(()=>{u(a.eligibleQpSetter)},[a.eligibleQpSetter]);const x=async(e,r)=>{y(!1),r==="deggrp"&&(b(e),m("Select"),await a.getQpBoard(e),await a.getAvailableSubjects(e,"All")),r==="board"&&(o(e),await a.getAvailableSubjects(s,e)),r==="qpcode"&&m(e),r==="type"&&w(e),r==="select"&&Q(e)},R=async()=>{if(s==="deggrp")return i("info","Please Select Degree Group"),!1;if(l==="")return i("info","Please Select Board"),!1;if(p==="Select")return i("info","Please Select QP Code"),!1;if(c==="")return i("info","Please Select Type"),!1;await a.getEligibleQpSetterts(s,l,p,c,T),y(!0)},B=a.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),k=a.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),P=[...H,...k],I=a.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname,value:e.fqpcode})),O=(e,r)=>{const d=[...S];d[r].status=e?"T":"F",d[r].changeStatus="T",u(d)},v=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"8%"},{title:t.jsx("div",{style:{textAlign:"center"},children:"Teach. Code - Name"}),dataIndex:"fteach",...j("fteach","Teacher code / Name"),sorter:(e,r)=>E(e,r,"fteach"),sortDirections:["descend","ascend"],width:"30%"},{title:"Teacher Email ID",dataIndex:"femail",...j("femail","Email"),sorter:(e,r)=>E(e,r,"femail"),sortDirections:["descend","ascend"],width:"39%"},{title:"Mobile No.",dataIndex:"fmobile",...j("fmobile","Mobile no."),sorter:(e,r)=>E(e,r,"fmobile"),sortDirections:["descend","ascend"],align:"center",width:"15%"},{title:"Select",render:(e,r)=>t.jsx(Z,{checked:r.status==="T",onChange:d=>O(d.target.checked,r.key)}),align:"center",width:"8%"}],_=async()=>{const e=S.filter(d=>d.changeStatus=="T"),r=new FormData;r.append("data",JSON.stringify(e)),r.append("deggrp",s),r.append("board",l),r.append("qpcode",p),r.append("type",c),r.append("userid",a.userid),await a.saveQpSetters(r)},L=()=>{b(""),o("All"),m(""),w(""),u([]),Q("All"),y(!1)};return t.jsxs(F,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Eligible QP Setters (BOE)"}),extra:t.jsxs(W,{children:[t.jsxs(h,{style:{background:"black",color:"white"},onClick:()=>L(),children:[t.jsx(Y,{})," Clear"]}),t.jsxs(h,{type:"primary",onClick:()=>_(),children:[t.jsx(K,{})," Save"]}),t.jsx(N,{to:"/",children:t.jsxs(h,{type:"primary",danger:!0,children:[t.jsx(V,{})," Exit"]})})]}),children:[t.jsxs(C,{gutter:16,children:[t.jsxs(g,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Degree Group"}),t.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:s,options:B,onChange:e=>x(e,"deggrp")})]}),t.jsxs(g,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Board"}),t.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:l,options:P,onChange:e=>x(e,"board")})]}),t.jsxs(g,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Subject"}),t.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:p,options:I,onChange:e=>x(e,"qpcode")})]})]}),t.jsxs(C,{gutter:16,children:[t.jsxs(g,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Type"}),t.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:c,options:G,onChange:e=>x(e,"type")})]}),t.jsxs(g,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Select"}),t.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:T,options:$,onChange:e=>x(e,"select")})]}),t.jsxs(g,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("p",{style:{marginTop:"20px"}}),t.jsx(h,{type:"primary",style:{marginBottom:"10px"},onClick:()=>R(),children:"Submit"})]})]}),A&&t.jsx(X,{dataSource:S,columns:v,bordered:!0,scroll:{y:300,x:1e3},style:{marginTop:"20px"},size:"small",pagination:M})]})},re=a=>({deggrp:a.deggrp,board:a.board,qpcode:a.availableSubjects,eligibleQpSetter:a.eligibleQpSetter,userid:a.loginfo.userData.fmobile}),Se=q(re,{getQpDeggrp:U,getQpBoard:z,getAvailableSubjects:J,getEligibleQpSetterts:ee,saveQpSetters:te})(ae);export{Se as default};
|