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.211.55
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/EligibleQpSetter-D8JNl-Va.js |
import{v as Q,E as i,x as L,r as l,t,D as q,B as S,L as F,G as x}from"./index-DytKDlFb.js";import{a as G,t as N,b as H,p as M}from"./sem-CXAFzSxe.js";import{g as U,a as $,d as z}from"./UploadQpPattern-BTvHvx0V.js";import{g as u,s as y}from"./datatable-DDabXa6d.js";import{S as J}from"./index-BiskNudf.js";import{R as W}from"./SaveOutlined-DhBelEoO.js";import{R as K}from"./HomeOutlined-L6aAnT1z.js";import{R as T,C as g}from"./row-1Fw658K7.js";import{F as V}from"./Table-D4ygnYDx.js";import{C as X}from"./index-D46HYd8a.js";import"./responsiveObserver-DUNCLVnN.js";import"./index-BVGRjGJp.js";import"./index-CyEJXvy_.js";const Y=(...a)=>async(s,b)=>{try{let o=localStorage.getItem("dbname");s({type:"SET_LOADER"});const n=await Q.get("app.php?a=getEligibleQpSetterts&db="+o+"°grp="+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)}},Z=a=>async(s,b)=>{try{let o=localStorage.getItem("dbname");s({type:"SET_LOADER"});const n=await Q.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)}},ee=a=>{const[s,b]=l.useState(""),[o,n]=l.useState("All"),[p,f]=l.useState(""),[d,D]=l.useState(""),[h,j]=l.useState([]),[E,C]=l.useState("All"),[B,w]=l.useState(!1);l.useEffect(()=>{a.getQpDeggrp()},[]),l.useEffect(()=>{j(a.eligibleQpSetter)},[a.eligibleQpSetter]);const m=async(e,r)=>{w(!1),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"&&D(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),w(!0)},A=a.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),R=a.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),I=[...G,...R],O=a.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname,value:e.fqpcode})),k=(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(X,{checked:r.status==="T",onChange:c=>k(c.target.checked,r.key)}),align:"center",width:"8%"}],v=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(q,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Eligible QP Setters (BOE)"}),extra:t.jsxs(J,{children:[t.jsxs(S,{type:"primary",onClick:()=>v(),children:[t.jsx(W,{})," Save"]}),t.jsx(F,{to:"/",children:t.jsxs(S,{type:"primary",danger:!0,children:[t.jsx(K,{})," Exit"]})})]}),children:[t.jsxs(T,{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(x,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:s,options:A,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:O,onChange:e=>m(e,"qpcode")})]})]}),t.jsxs(T,{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:N,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"})]})]}),B&&t.jsx(V,{dataSource:h,columns:_,bordered:!0,scroll:{y:300,x:1e3},style:{marginTop:"20px"},size:"small",pagination:M})]})},te=a=>({deggrp:a.deggrp,board:a.board,qpcode:a.availableSubjects,eligibleQpSetter:a.eligibleQpSetter,userid:a.loginfo.userData.fmobile}),be=L(te,{getQpDeggrp:U,getQpBoard:$,getAvailableSubjects:z,getEligibleQpSetterts:Y,saveQpSetters:Z})(ee);export{be as default};
|