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 : 18.223.210.196


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/AvailableQp-C3l6iBx9.js

import{v as j,E as x,r as d,t,B as u,x as X,D as Z,L as ee,G as f,F as te,R as ae}from"./index-DuuJ_BVy.js";import{p as P,a as w,s as se}from"./sem-BK69X1ab.js";import{g as re,a as le,d as ne,e as oe}from"./UploadQpPattern-CiLofBzr.js";import{g as b,s as h}from"./datatable-ZhxhX0N2.js";import{R as de}from"./ArrowLeftOutlined-Cfqm7e1C.js";import{F as k}from"./Table-CaI-VRgw.js";import{S as ie}from"./index-BjlpPnds.js";import{R as ce}from"./SaveOutlined-Bja7yXOQ.js";import{R as pe}from"./HomeOutlined-COaObuiP.js";import{R as C,C as p}from"./row-Dz_eTgRG.js";import{C as T}from"./index-DFKGOmqH.js";import"./index-BbnbYn0r.js";import"./index-Cfr0AqBF.js";import"./responsiveObserver-P-7D2JNj.js";const ge=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}},xe=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}},me=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}},fe=({data:s,show:r})=>{const[i,n]=d.useState([]);d.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(k,{style:{marginTop:"20px"},dataSource:i,scroll:{y:300,x:1300},bordered:!0,columns:c,size:"small",pagination:P})]})},be=s=>{const[r,i]=d.useState(""),[n,c]=d.useState("All"),[l,y]=d.useState("All"),[m,B]=d.useState("All"),[Q,O]=d.useState("All"),[I,R]=d.useState(""),[A,v]=d.useState([]),[D,E]=d.useState(!1),[_,L]=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));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"&&O(a),e==="degree"&&B(a),e==="avl"&&R(a),L(!1)},q=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),L(!0)},F=(e,a)=>{const o=A;o[a].FELIGQP=e?"T":"F",o[a].fonchange="T",v([...o])},N=e=>{const o=A.map((S,ue)=>(e?S.FELIGQP="T":S.FELIGQP="F",S.fonchange="T",S));v([...o])},U=s.deggrp.map(e=>({key:e.fdeggrp,label:e.fdescpn,value:e.fdeggrp})),V=s.board.map(e=>({key:e.fboardcode,label:e.fboardname,value:e.fboardcode})),G=[...w,...V],$=s.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname,value:e.fqpcode})),z=[...w,...$],H=s.degree.map(e=>({key:e.fdegree,label:e.fdescpn,value:e.fdegree})),J=[...w,...H],M=[...w,...se],W=[{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(T,{onChange:e=>N(e.target.checked)})]}),render:(e,a)=>t.jsx(T,{checked:a.FELIGQP=="T",onChange:o=>F(o.target.checked,a.index)}),align:"center",width:"5%"},{title:"Action",render:(e,a)=>t.jsxs(u,{size:"medium",style:{background:"green",color:"#fff"},onClick:()=>Y(a),children:[t.jsx(ae,{})," View"]}),align:"center",width:"10%"}],Y=async e=>{const a={fdeggrp:r,fdegree:e.fdegree,fexamno:e.fexamno,fqpcode:e.fqpcode};await s.viewDetailedAvailableQp(a),E(!0)},K=async()=>{const e=A.filter(o=>o.fonchange=="T"),a=new FormData;a.append("data",JSON.stringify(e)),await s.saveAvailableQp(a)};return t.jsxs(Z,{style:{margin:"6rem 10px 10px"},title:t.jsx("h6",{children:"Available Qp"}),extra:t.jsxs(ie,{children:[!D&&t.jsxs(u,{type:"primary",onClick:()=>K(),children:[t.jsx(ce,{})," Save"]}),t.jsx(ee,{to:"/",children:t.jsxs(u,{type:"primary",danger:!0,children:[t.jsx(pe,{})," Exit"]})})]}),children:[t.jsxs(C,{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(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:U,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:G,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: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(f,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:m,options:J,onChange:e=>g("degree",e)})]})]}),t.jsxs(C,{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:M,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(te,{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:()=>q(),children:"Submit"})]})]}),D?t.jsx(fe,{data:s.detailedAvailableQp,show:E}):t.jsx("div",{children:_&&t.jsx(k,{style:{marginTop:"20px"},dataSource:A,scroll:{y:300,x:1300},bordered:!0,columns:W,size:"small",pagination:P})})]})},he=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}),ke=X(he,{getQpDeggrp:re,getQpBoard:le,getAvailableSubjects:ne,getQpDegree:oe,getAvailableQp:ge,saveAvailableQp:xe,viewDetailedAvailableQp:me})(be);export{ke as default};