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.15.186.27


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/EligibleQpSetter-BPvDAlxc.js

import{v as T,E as i,x as q,r as l,t,D as v,B as S,L as F,G as x}from"./index-D4tY2iBR.js";import{a as N,t as G,b as H}from"./sem-D2Wh8RBS.js";import{g as M,a as U,d as $}from"./UploadQpPattern-Bba5Beb3.js";import{g as u,s as y}from"./datatable-BtsFi8gF.js";import{S as z}from"./index-CmzrOVIl.js";import{R as J}from"./SaveOutlined-DWK3ZADU.js";import{R as W}from"./HomeOutlined-CMFgccJg.js";import{R as w,C as g}from"./row-BLWjQswV.js";import{F as K}from"./Table-BDJUlBpk.js";import{C as V}from"./index--tKxzihq.js";import"./responsiveObserver-ByjJDers.js";import"./index-Dx9mkNC7.js";import"./index-CoG_RFMp.js";const X=(...a)=>async(s,b)=>{try{let o=localStorage.getItem("dbname");s({type:"SET_LOADER"});const n=await T.get("app.php?a=getEligibleQpSetterts&db="+o+"&deggrp="+a[0]+"&board="+a[1]+"&qpcode="+a[2]+"&type="+a[3]+"&selected="+a[4]);if(s({type:"UNSET_LOADER"}),n.data.error_code===0){const p=n.data.data.map((f,d)=>({...f,key:d,fslno:d+1}));s({type:"ELIGIBLE_QP_SETTER",payload:p})}else s({type:"CLEAR_ELIGIBLE_QP_SETTER",payload:[]})}catch(o){i("error",o.message)}},Y=a=>async(s,b)=>{try{let o=localStorage.getItem("dbname");s({type:"SET_LOADER"});const n=await T.post("app.php?a=saveQpSetters&db="+o,a);s({type:"UNSET_LOADER"}),n.data.error_code===0?i("success",n.data.data.msg):i("info",n.data.data.msg)}catch(o){i("error",o.message)}},Z=a=>{const[s,b]=l.useState(""),[o,n]=l.useState(""),[p,f]=l.useState(""),[d,Q]=l.useState(""),[h,j]=l.useState([]),[E,C]=l.useState("All"),[D,B]=l.useState(!1);l.useEffect(()=>{a.getQpDeggrp()},[]),l.useEffect(()=>{j(a.eligibleQpSetter)},[a.eligibleQpSetter]);const m=async(e,r)=>{console.log(e,r),r==="deggrp"&&(b(e),await a.getQpBoard(e),await a.getAvailableSubjects(e,"All")),r==="board"&&(n(e),await a.getAvailableSubjects(s,e)),r==="qpcode"&&f(e),r==="type"&&Q(e),r==="select"&&C(e)},P=async()=>{if(s==="")return i("info","Please Select Degree Group"),!1;if(o==="")return i("info","Please Select Board"),!1;if(p==="")return i("info","Please Select QP Code"),!1;if(d==="")return i("info","Please Select Type"),!1;await a.getEligibleQpSetterts(s,o,p,d,E),B(!0)},R=a.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),A=a.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),I=[...N,...A],k=a.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname,value:e.fqpcode})),O=(e,r)=>{const c=[...h];c[r].status=e?"T":"F",c[r].changeStatus="T",j(c)},_=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"8%"},{title:"Teach. Code",dataIndex:"fteachcode",...u("fteachcode","Teacher code"),sorter:(e,r)=>y(e,r,"fteachcode"),sortDirections:["descend","ascend"],align:"center",width:"15%"},{title:"Teacher Email ID",dataIndex:"femail",...u("femail","Email"),sorter:(e,r)=>y(e,r,"femail"),sortDirections:["descend","ascend"],width:"54%"},{title:"Mobile No.",dataIndex:"fmobile",...u("fmobile","Mobile no."),sorter:(e,r)=>y(e,r,"fmobile"),sortDirections:["descend","ascend"],align:"center",width:"15%"},{title:"Select",render:(e,r)=>t.jsx(V,{checked:r.status==="T",onChange:c=>O(c.target.checked,r.key)}),align:"center",width:"8%"}],L=async()=>{const e=h.filter(c=>c.changeStatus=="T"),r=new FormData;r.append("data",JSON.stringify(e)),r.append("deggrp",s),r.append("board",o),r.append("qpcode",p),r.append("type",d),r.append("userid",a.userid),await a.saveQpSetters(r)};return t.jsxs(v,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Eligible QP Setters (BOE)"}),extra:t.jsxs(z,{children:[t.jsxs(S,{type:"primary",onClick:()=>L(),children:[t.jsx(J,{})," Save"]}),t.jsx(F,{to:"/",children:t.jsxs(S,{type:"primary",danger:!0,children:[t.jsx(W,{})," Exit"]})})]}),children:[t.jsxs(w,{gutter:16,children:[t.jsxs(g,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[t.jsx("label",{children:"Exam"}),t.jsx(x,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:s,options:R,onChange:e=>m(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(x,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:o,options:I,onChange:e=>m(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(x,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:p,options:k,onChange:e=>m(e,"qpcode")})]})]}),t.jsxs(w,{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(x,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:d,options:G,onChange:e=>m(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(x,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:E,options:H,onChange:e=>m(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(S,{type:"primary",style:{marginBottom:"10px"},onClick:()=>P(),children:"Submit"})]})]}),D&&t.jsx(K,{dataSource:h,columns:_,bordered:!0,scroll:{y:300,x:1e3},style:{marginTop:"20px"},size:"small"})]})},ee=a=>({deggrp:a.deggrp,board:a.board,qpcode:a.availableSubjects,eligibleQpSetter:a.eligibleQpSetter,userid:a.loginfo.userData.fmobile}),xe=q(ee,{getQpDeggrp:M,getQpBoard:U,getAvailableSubjects:$,getEligibleQpSetterts:X,saveQpSetters:Y})(Z);export{xe as default};