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.118.93.61
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/AvailableQp-BOOHRob5.js |
import{v as j,E as m,r as o,t,B as A,x as K,D as X,L as Z,G as b,F as ee,R as te}from"./index-C8M3lyNu.js";import{a as y,s as ae}from"./sem-xL-Ac5nH.js";import{g as se,a as le,d as re,e as ne}from"./UploadQpPattern-kidoxO1-.js";import{g as h,s as u}from"./datatable-Pcc3qusZ.js";import{R as de}from"./ArrowLeftOutlined-DFfMxdNg.js";import{F as T,C as L}from"./Table-CCr-bhsx.js";import{S as oe}from"./index-Bhb34QNg.js";import{R as ie}from"./SaveOutlined-CtFciPoQ.js";import{R as ce}from"./HomeOutlined-C5ZSuxRe.js";import{R as C,C as p}from"./row-B_crsxDb.js";import"./index-C1EEZ13m.js";import"./responsiveObserver-iG098kB7.js";const pe=s=>async(l,i)=>{try{const n=i();let c=localStorage.getItem("dbname");l({type:"SET_LOADER"});const r=await j.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}},ge=s=>async(l,i)=>{try{const n=i();let c=localStorage.getItem("dbname");l({type:"SET_LOADER"});const r=await j.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}},xe=s=>async(l,i)=>{try{const n=i();let c=localStorage.getItem("dbname");l({type:"SET_LOADER"});const r=await j.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}},me=({data:s,show:l})=>{const[i,n]=o.useState([]);o.useEffect(()=>{const r=s.map((g,f)=>({...g,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",render:(r,g)=>`${g.fsubname} (${g.fsubshort})`,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(A,{style:{float:"right",marginBottom:"20px"},onClick:()=>l(!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[l,i]=o.useState(""),[n,c]=o.useState("All"),[r,g]=o.useState("All"),[f,P]=o.useState("All"),[Q,k]=o.useState("All"),[I,B]=o.useState(""),[S,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 x=(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"&&g(a),e==="sem"&&k(a),e==="degree"&&P(a),e==="avl"&&B(a)},q=async()=>{if(l===""){m("info","Select degree group");return}const e={deggrp:l,board:n,qpcode:r,degree:f,sem:Q,avl:I};await s.getAvailableQp(e),_(!0)},O=(e,a)=>{const d=S;d[a].FELIGQP=e?"T":"F",d[a].fonchange="T",v([...d])},F=e=>{const d=S.map((w,he)=>(e?w.FELIGQP="T":w.FELIGQP="F",w.fonchange="T",w));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=[...y,...U],$=s.qpcode.map(e=>({key:e.fqpcode,label:e.fsubname+" ["+e.fqpcode+"]",value:e.fqpcode})),G=[...y,...$],z=s.degree.map(e=>({key:e.fdegree,label:e.fdescpn,value:e.fdegree})),H=[...y,...z],J=[...y,...ae],M=[{title:"Sl. No",dataIndex:"fslno",align:"center",width:"5%"},{title:"Qp Code",dataIndex:"fqpcode",...h("fqpcode","QP Code"),sorter:(e,a)=>u(e,a,"fqpcode"),sortDirections:["descend","ascend"],align:"center",width:"10%"},{title:"Subject Name",dataIndex:"fsubname",...h("fsubname","Sub. Name"),sorter:(e,a)=>u(e,a,"fsubname"),sortDirections:["descend","ascend"],width:"46%"},{title:"Total Set",dataIndex:"fset",...h("fset","Set"),sorter:(e,a)=>u(e,a,"fset"),sortDirections:["descend","ascend"],width:"8%",align:"center"},{title:"Used",dataIndex:"used",...h("used","Used"),sorter:(e,a)=>u(e,a,"used"),sortDirections:["descend","ascend"],width:"8%",align:"center"},{title:"Available",dataIndex:"available",...h("available","Available"),sorter:(e,a)=>u(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(L,{onChange:e=>F(e.target.checked)})]}),render:(e,a)=>t.jsx(L,{checked:a.FELIGQP=="T",onChange:d=>O(d.target.checked,a.index)}),align:"center",width:"5%"},{title:"Action",render:(e,a)=>t.jsxs(A,{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:e.fdeggrp,fdegree:e.fdegree,fexamno:e.fexamno,fqpcode:e.fqpcode};await s.viewDetailedAvailableQp(a),E(!0)},Y=async()=>{const e=S.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(A,{type:"primary",onClick:()=>Y(),children:[t.jsx(ie,{})," Save"]}),t.jsx(Z,{to:"/",children:t.jsxs(A,{type:"primary",danger:!0,children:[t.jsx(ce,{})," 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:"Exam"}),t.jsx(b,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:N,value:l,onChange:e=>x("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,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:n,options:V,onChange:e=>x("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,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:r,options:G,onChange:e=>x("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,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:f,options:H,onChange:e=>x("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(b,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:Q,options:J,onChange:e=>x("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=>x("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(A,{type:"primary",style:{marginBottom:"10px"},loading:s.btnLoading,onClick:()=>q(),children:"Submit"})]})]}),D?t.jsx(me,{data:s.detailedAvailableQp,show:E}):t.jsx("div",{children:R&&t.jsx(T,{style:{marginTop:"20px"},dataSource:S,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}),Ce=K(be,{getQpDeggrp:se,getQpBoard:le,getAvailableSubjects:re,getQpDegree:ne,getAvailableQp:pe,saveAvailableQp:ge,viewDetailedAvailableQp:xe})(fe);export{Ce as default};
|