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 : 52.15.233.83
import{v as D,E as m,r as d,t,B as x,x as ee,D as te,L as ae,G as b,F as se,R as le}from"./index-Dg6L4Sgi.js";import{p as B,a as v,b as re}from"./sem-DLpF_ddZ.js";import{g as ne,a as oe,d as de,e as ie}from"./UploadQpPattern-B_C44EVE.js";import{f as h,g as u,s as A}from"./datatable-KuvfNXcW.js";import{R as ce}from"./ArrowLeftOutlined-BITsaogm.js";import{F as _}from"./Table-LuwqJFvB.js";import{S as pe}from"./index-DlmGwZY4.js";import{R as ge}from"./StopOutlined-DdILRcPk.js";import{R as xe}from"./SaveOutlined-x60hh1KB.js";import{R as me}from"./HomeOutlined-DuiGAEJZ.js";import{R,C as p}from"./row-BmL0HVtY.js";import{C as O}from"./index-B7RN03Rw.js";import"./index-Dz2boTk9.js";import"./index-CFncUd0X.js";import"./responsiveObserver-BUHeJEGz.js";const fe=s=>async(l,i)=>{try{const n=i();let c=localStorage.getItem("dbname");l({type:"SET_LOADER"});const r=await D.get("app.php?a=getAvailableQp&db="+c+"&data="+JSON.stringify(s));l({type:"UNSET_LOADER"}),r.data.error_code===0?l({type:"AVAILABLE_QP",payload:r.data.data}):l({type:"CLEAR_AVAILABLE_QP",payload:[]})}catch(n){m("error",n.message);return}},be=s=>async(l,i)=>{try{const n=i();let c=localStorage.getItem("dbname");l({type:"SET_LOADER"});const r=await D.post("app.php?a=saveAvailableQp&db="+c,s);if(l({type:"UNSET_LOADER"}),r.data.error_code===0)m("success",r.data.data.msg);else{m("info",r.data.data.msg);return}}catch(n){m("error",n.message);return}},he=s=>async(l,i)=>{try{const n=i();let c=localStorage.getItem("dbname");l({type:"SET_LOADER"});const r=await D.get("app.php?a=viewDetailedAvailableQp&db="+c+"&data="+JSON.stringify(s));l({type:"UNSET_LOADER"}),r.data.error_code===0?l({type:"VIEW_DETAILED_AVAILABLE_QP",payload:r.data.data}):l({type:"CLEAR_DETAILED_AVAILABLE_QP",payload:[]})}catch(n){m("error",n.message);return}},ue=({data:s,show:l})=>{const[i,n]=d.useState([]);d.useEffect(()=>{const r=s.map((S,f)=>({...S,key:f,fslno:f+1}));n(r)},[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(x,{style:{float:"right",marginBottom:"20px"},onClick:()=>l(!1),children:[t.jsx(ce,{}),"Back"]}),t.jsx(_,{style:{marginTop:"20px"},dataSource:i,scroll:{y:300,x:1300},bordered:!0,columns:c,size:"small",pagination:B})]})},Ae=s=>{const[l,i]=d.useState(""),[n,c]=d.useState("All"),[r,S]=d.useState("All"),[f,E]=d.useState("All"),[C,L]=d.useState("All"),[T,k]=d.useState(""),[w,y]=d.useState([]),[P,Q]=d.useState(!1),[q,I]=d.useState(!1);d.useEffect(()=>{s.getQpDeggrp()},[]),d.useEffect(()=>{const e=s.availableQp.map((a,o)=>(a.key=o,a.index=o,a.fslno=o+1,a));y(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(l,a)),e==="qpcode"&&S(a),e==="sem"&&L(a),e==="degree"&&E(a),e==="avl"&&k(a),I(!1)},F=async()=>{if(l===""){m("info","Select degree group");return}const e={deggrp:l,board:n,qpcode:r,degree:f,sem:C,avl:T};await s.getAvailableQp(e),I(!0)},N=(e,a)=>{const o=w;o[a].FELIGQP=e?"T":"F",o[a].fonchange="T",y([...o])},U=e=>{const o=w.map((j,we)=>(e?j.FELIGQP="T":j.FELIGQP="F",j.fonchange="T",j));y([...o])},V=s.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),G=s.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),$=[...v,...G],H=s.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname,value:e.fqpcode})),z=[...v,...H],J=s.degree.map(e=>({key:e.fdegree,label:e.fdescpn,value:e.fdegree})),M=[...v,...J],W=[...v,...re],Y=[{title:"Sl. No",dataIndex:"fslno",align:"center",width:"5%"},{title:"Qp Code",dataIndex:"fqpcode",...u("fqpcode","QP Code"),sorter:(e,a)=>A(e,a,"fqpcode"),sortDirections:["descend","ascend"],align:"center",width:"10%"},{title:"Subject Name",dataIndex:"fsubname",...u("fsubname","Sub. Name"),sorter:(e,a)=>A(e,a,"fsubname"),sortDirections:["descend","ascend"],width:"46%"},{title:"Total Set",dataIndex:"fset",...u("fset","Set"),sorter:(e,a)=>A(e,a,"fset"),sortDirections:["descend","ascend"],width:"8%",align:"center"},{title:"Used",dataIndex:"used",...u("used","Used"),sorter:(e,a)=>A(e,a,"used"),sortDirections:["descend","ascend"],width:"8%",align:"center"},{title:"Available",dataIndex:"available",...u("available","Available"),sorter:(e,a)=>A(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(O,{onChange:e=>U(e.target.checked)})]}),render:(e,a)=>t.jsx(O,{checked:a.FELIGQP=="T",onChange:o=>N(o.target.checked,a.index)}),align:"center",width:"5%"},{title:"Action",render:(e,a)=>t.jsxs(x,{size:"medium",style:{background:"green",color:"#fff"},onClick:()=>K(a),children:[t.jsx(le,{})," View"]}),align:"center",width:"10%"}],K=async e=>{const a={fdeggrp:l,fdegree:e.fdegree,fexamno:e.fexamno,fqpcode:e.fqpcode};await s.viewDetailedAvailableQp(a),Q(!0)},X=async()=>{const e=w.filter(o=>o.fonchange=="T"),a=new FormData;a.append("data",JSON.stringify(e)),await s.saveAvailableQp(a)},Z=()=>{i(""),c("All"),S("All"),E("All"),L("All"),k(""),y([]),Q(!1),I(!1)};return t.jsxs(te,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Available Qp"}),extra:t.jsxs(pe,{children:[t.jsxs(x,{style:{background:"black",color:"white"},onClick:()=>Z(),children:[t.jsx(ge,{})," Clear"]}),!P&&t.jsxs(x,{type:"primary",onClick:()=>X(),children:[t.jsx(xe,{})," Save"]}),t.jsx(ae,{to:"/",children:t.jsxs(x,{type:"primary",danger:!0,children:[t.jsx(me,{})," Exit"]})})]}),children:[t.jsxs(R,{gutter:10,children:[t.jsxs(p,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[t.jsx("label",{children:"Degree Group"}),t.jsx(b,{filterOption:h,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:V,value:l,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(b,{filterOption:h,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:n,options:$,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(b,{filterOption:h,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:r,options:z,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(b,{filterOption:h,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:f,options:M,onChange:e=>g("degree",e)})]})]}),t.jsxs(R,{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(b,{filterOption:h,showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:C,options:W,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(se,{style:{marginBottom:"10px",width:"100%"},value:T,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(x,{type:"primary",style:{marginBottom:"10px"},loading:s.btnLoading,onClick:()=>F(),children:"Submit"})]})]}),P?t.jsx(ue,{data:s.detailedAvailableQp,show:Q}):t.jsx("div",{children:q&&t.jsx(_,{style:{marginTop:"20px"},dataSource:w,scroll:{y:300,x:1300},bordered:!0,columns:Y,size:"small",pagination:B})})]})},Se=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}),_e=ee(Se,{getQpDeggrp:ne,getQpBoard:oe,getAvailableSubjects:de,getQpDegree:ie,getAvailableQp:fe,saveAvailableQp:be,viewDetailedAvailableQp:he})(Ae);export{_e as default};
|