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.142.174.8
import{v as j,E as x,r as o,t,B as u,x as K,D as X,L as Z,G as f,F as ee,R as te}from"./index-D4tY2iBR.js";import{a as w,s as ae}from"./sem-D2Wh8RBS.js";import{g as se,a as re,d as le,e as ne}from"./UploadQpPattern-Bba5Beb3.js";import{g as b,s as h}from"./datatable-BtsFi8gF.js";import{R as de}from"./ArrowLeftOutlined-pD9xJdnU.js";import{F as T}from"./Table-BDJUlBpk.js";import{S as oe}from"./index-CmzrOVIl.js";import{R as ie}from"./SaveOutlined-DWK3ZADU.js";import{R as ce}from"./HomeOutlined-CMFgccJg.js";import{R as L,C as p}from"./row-BLWjQswV.js";import{C}from"./index--tKxzihq.js";import"./index-Dx9mkNC7.js";import"./index-CoG_RFMp.js";import"./responsiveObserver-ByjJDers.js";const pe=s=>async(r,i)=>{try{const n=i();let c=localStorage.getItem("dbname");r({type:"SET_LOADER"});const l=await j.get("app.php?a=getAvailableQp&db="+c+"&data="+JSON.stringify(s));r({type:"UNSET_LOADER"}),l.data.error_code===0?r({type:"AVAILABLE_QP",payload:l.data.data}):r({type:"CLEAR_AVAILABLE_QP",payload:[]})}catch(n){x("error",n.message);return}},ge=s=>async(r,i)=>{try{const n=i();let c=localStorage.getItem("dbname");r({type:"SET_LOADER"});const l=await j.post("app.php?a=saveAvailableQp&db="+c,s);if(r({type:"UNSET_LOADER"}),l.data.error_code===0)x("success",l.data.data.msg);else{x("info",l.data.data.msg);return}}catch(n){x("error",n.message);return}},xe=s=>async(r,i)=>{try{const n=i();let c=localStorage.getItem("dbname");r({type:"SET_LOADER"});const l=await j.get("app.php?a=viewDetailedAvailableQp&db="+c+"&data="+JSON.stringify(s));r({type:"UNSET_LOADER"}),l.data.error_code===0?r({type:"VIEW_DETAILED_AVAILABLE_QP",payload:l.data.data}):r({type:"CLEAR_DETAILED_AVAILABLE_QP",payload:[]})}catch(n){x("error",n.message);return}},me=({data:s,show:r})=>{const[i,n]=o.useState([]);o.useEffect(()=>{const l=s.map((y,m)=>({...y,key:m,fslno:m+1}));n(l)},[s]);const c=[{title:"Sl. No",dataIndex:"fslno",align:"center",width:"5%"},{title:"Qp Code",dataIndex:"fqpcode",align:"center",width:"10%"},{title:"Subject Name",dataIndex:"fsubname",width:"24%"},{title:"Teach. code",dataIndex:"fteachcode",align:"center",width:"5%"},{title:"Set",dataIndex:"fset",align:"center",width:"5%"},{title:"Year/Mode",dataIndex:"fyears",align:"center",width:"7%"},{title:"QP. Upd. status",dataIndex:"fqpupdstatus",align:"center",width:"5%"},{title:"QP Upd Time",dataIndex:"fqpdtme",align:"center",width:"10%"},{title:"Mod. Upd. Status",dataIndex:"fmodstatus",align:"center",width:"5%"},{title:"Mod. Upd Time",dataIndex:"fmodtme",align:"center",width:"10%"},{title:"Used?",dataIndex:"used",align:"center",width:"5%"},{title:"QP Used Date",dataIndex:"ffinalpaperdate",align:"center",width:"9%"}];return t.jsxs("div",{children:[t.jsxs(u,{style:{float:"right",marginBottom:"20px"},onClick:()=>r(!1),children:[t.jsx(de,{}),"Back"]}),t.jsx(T,{style:{marginTop:"20px"},dataSource:i,scroll:{y:300,x:1300},bordered:!0,columns:c,size:"small"})]})},fe=s=>{const[r,i]=o.useState(""),[n,c]=o.useState("All"),[l,y]=o.useState("All"),[m,P]=o.useState("All"),[Q,k]=o.useState("All"),[I,B]=o.useState(""),[A,v]=o.useState([]),[D,E]=o.useState(!1),[R,_]=o.useState(!1);o.useEffect(()=>{s.getQpDeggrp()},[]),o.useEffect(()=>{const e=s.availableQp.map((a,d)=>(a.key=d,a.index=d,a.fslno=d+1,a));v(e)},[s.availableQp]);const g=(e,a)=>{e==="deggrp"&&(i(a),s.getQpBoard(a),s.getAvailableSubjects(a,"All"),s.getQpDegree(a)),e==="board"&&(c(a),s.getAvailableSubjects(r,a)),e==="qpcode"&&y(a),e==="sem"&&k(a),e==="degree"&&P(a),e==="avl"&&B(a)},O=async()=>{if(r===""){x("info","Select degree group");return}const e={deggrp:r,board:n,qpcode:l,degree:m,sem:Q,avl:I};await s.getAvailableQp(e),_(!0)},q=(e,a)=>{const d=A;d[a].FELIGQP=e?"T":"F",d[a].fonchange="T",v([...d])},F=e=>{const d=A.map((S,he)=>(e?S.FELIGQP="T":S.FELIGQP="F",S.fonchange="T",S));v([...d])},N=s.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),U=s.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),V=[...w,...U],G=s.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname,value:e.fqpcode})),$=[...w,...G],z=s.degree.map(e=>({key:e.fdegree,label:e.fdescpn,value:e.fdegree})),H=[...w,...z],J=[...w,...ae],M=[{title:"Sl. No",dataIndex:"fslno",align:"center",width:"5%"},{title:"Qp Code",dataIndex:"fqpcode",...b("fqpcode","QP Code"),sorter:(e,a)=>h(e,a,"fqpcode"),sortDirections:["descend","ascend"],align:"center",width:"10%"},{title:"Subject Name",dataIndex:"fsubname",...b("fsubname","Sub. Name"),sorter:(e,a)=>h(e,a,"fsubname"),sortDirections:["descend","ascend"],width:"46%"},{title:"Total Set",dataIndex:"fset",...b("fset","Set"),sorter:(e,a)=>h(e,a,"fset"),sortDirections:["descend","ascend"],width:"8%",align:"center"},{title:"Used",dataIndex:"used",...b("used","Used"),sorter:(e,a)=>h(e,a,"used"),sortDirections:["descend","ascend"],width:"8%",align:"center"},{title:"Available",dataIndex:"available",...b("available","Available"),sorter:(e,a)=>h(e,a,"available"),sortDirections:["descend","ascend"],width:"8%",align:"center"},{title:t.jsxs("div",{children:[t.jsx("label",{children:"Select"}),t.jsx("br",{}),t.jsx(C,{onChange:e=>F(e.target.checked)})]}),render:(e,a)=>t.jsx(C,{checked:a.FELIGQP=="T",onChange:d=>q(d.target.checked,a.index)}),align:"center",width:"5%"},{title:"Action",render:(e,a)=>t.jsxs(u,{size:"medium",style:{background:"green",color:"#fff"},onClick:()=>W(a),children:[t.jsx(te,{})," View"]}),align:"center",width:"10%"}],W=async e=>{const a={fdeggrp:r,fdegree:e.fdegree,fexamno:e.fexamno,fqpcode:e.fqpcode};await s.viewDetailedAvailableQp(a),E(!0)},Y=async()=>{const e=A.filter(d=>d.fonchange=="T"),a=new FormData;a.append("data",JSON.stringify(e)),await s.saveAvailableQp(a)};return t.jsxs(X,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Available Qp"}),extra:t.jsxs(oe,{children:[!D&&t.jsxs(u,{type:"primary",onClick:()=>Y(),children:[t.jsx(ie,{})," Save"]}),t.jsx(Z,{to:"/",children:t.jsxs(u,{type:"primary",danger:!0,children:[t.jsx(ce,{})," Exit"]})})]}),children:[t.jsxs(L,{gutter:10,children:[t.jsxs(p,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Exam"}),t.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:N,value:r,onChange:e=>g("deggrp",e)})]}),t.jsxs(p,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Board"}),t.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:n,options:V,onChange:e=>g("board",e)})]}),t.jsxs(p,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Qp Code"}),t.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:l,options:$,onChange:e=>g("qpcode",e)})]}),t.jsxs(p,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Degree"}),t.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:m,options:H,onChange:e=>g("degree",e)})]})]}),t.jsxs(L,{gutter:10,children:[t.jsxs(p,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Sem"}),t.jsx(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:Q,options:J,onChange:e=>g("sem",e)})]}),t.jsxs(p,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"QP Available less than?"}),t.jsx(ee,{style:{marginBottom:"10px",width:"100%"},value:I,onChange:e=>g("avl",e.target.value)})]}),t.jsxs(p,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("p",{style:{marginTop:"20px"}}),t.jsx(u,{type:"primary",style:{marginBottom:"10px"},loading:s.btnLoading,onClick:()=>O(),children:"Submit"})]})]}),D?t.jsx(me,{data:s.detailedAvailableQp,show:E}):t.jsx("div",{children:R&&t.jsx(T,{style:{marginTop:"20px"},dataSource:A,scroll:{y:300,x:1300},bordered:!0,columns:M,size:"small"})})]})},be=s=>({deggrp:s.deggrp,board:s.board,qpcode:s.availableSubjects,degree:s.degree,univcode:s.loginfo.userData.funivcode,availableQp:s.availableQp,btnLoading:s.loader.btnLoading,detailedAvailableQp:s.detailedAvailableQp}),Pe=K(be,{getQpDeggrp:se,getQpBoard:re,getAvailableSubjects:le,getQpDegree:ne,getAvailableQp:pe,saveAvailableQp:ge,viewDetailedAvailableQp:xe})(fe);export{Pe as default};
|