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.191.44.145


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/SubjectCreation-WWdZXRAe.js

import{x as y,Q as f,r as x,t as e,D as w,L as u,B as i,G as d,F as o}from"./index-DAvGDP_r.js";import{g as C,a as D,b as B,p as P,c as F}from"./SubjectCreation-D1aOXl17.js";import{b as k}from"./sem-DLpF_ddZ.js";import{S as q}from"./index-BX7MxiJs.js";import{R as n,C as r}from"./row-Cz2_xgh_.js";import"./responsiveObserver-CF1y3qd_.js";function E(t){const g=f(),[l,c]=x.useState({deggrp:"",board:"",degree:"",examno:"",subcode:"",subname:"",subshort:"",qpcode:"",valmax:""}),s=(a,v)=>{c(S=>({...S,[a]:v}))};x.useEffect(()=>{t.getDeggrpDet(),t.getDegreesDet(),t.getBoardDet()},[]),x.useEffect(()=>{g.type=="update"&&c({...l,deggrp:t.updatingdata.fdeggrp,board:t.updatingdata.fboard,degree:t.updatingdata.fdegree,examno:t.updatingdata.fexamno,subcode:t.updatingdata.fsubcode,subname:t.updatingdata.fsubname,subshort:t.updatingdata.fsubshort,qpcode:t.updatingdata.fqpcode,valmax:t.updatingdata.fvalmax,type:g.type})},[t.updatingdata]);const h=t.deggrpsubject.map(a=>({key:a.key,label:a.label,value:a.value})),m=t.degreesubject.map(a=>({key:a.key,label:a.label,value:a.value})),b=t.boardsubject.map(a=>({key:a.fboardname,value:a.fboardname,label:a.fboardname})),p=async()=>{await t.postToDatabase(l)},j=()=>{t.getAllCreatedSubject()};return e.jsxs(w,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Subject Creation"}),extra:e.jsxs(q,{children:[e.jsx(u,{to:"/qpsetting/viewsubject",children:e.jsx(i,{type:"primary",onClick:()=>j(),children:"View"})}),e.jsx(u,{to:"/",children:e.jsx(i,{type:"primary",danger:!0,children:"Exit"})})]}),children:[e.jsxs(n,{gutter:10,children:[e.jsxs(r,{xs:18,sm:18,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Degree group"}),e.jsx(d,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},options:h,value:l.deggrp,onChange:a=>s("deggrp",a)})]}),e.jsxs(r,{xs:18,sm:18,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Board"}),e.jsx(d,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:l.board,options:b,onChange:a=>s("board",a)})]}),e.jsxs(r,{xs:18,sm:18,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Degree"}),e.jsx(d,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:l.degree,options:m,onChange:a=>s("degree",a)})]}),e.jsxs(r,{xs:18,sm:18,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Semester"}),e.jsx(d,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},value:l.examno,options:k,onChange:a=>s("examno",a)})]})]}),e.jsxs(n,{gutter:10,children:[e.jsxs(r,{xs:24,sm:24,md:18,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"Subject Name"}),e.jsx(o,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},placeholder:"Subject Name",value:l.subname,onChange:a=>s("subname",a.target.value)})]}),e.jsxs(r,{xs:18,sm:18,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Shortname"}),e.jsx(o,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},placeholder:"Subject Short Name",value:l.subshort,onChange:a=>s("subshort",a.target.value)})]}),e.jsxs(r,{xs:18,sm:18,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Subcode"}),e.jsx(o,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},placeholder:"Subject Code",value:l.subcode,onChange:a=>s("subcode",a.target.value)})]})]}),e.jsxs(n,{gutter:10,children:[e.jsxs(r,{xs:18,sm:18,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"QP Code"}),e.jsx(o,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},placeholder:"QP Code",value:l.qpcode,onChange:a=>s("qpcode",a.target.value)})]}),e.jsxs(r,{xs:18,sm:18,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Val. Max"}),e.jsx(o,{showSearch:!0,optionFilterProp:"label",style:{marginBottom:"10px",width:"100%"},placeholder:"Val. Max",value:l.valmax,onChange:a=>s("valmax",a.target.value)})]})]}),e.jsx(n,{children:e.jsxs(r,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[e.jsx("p",{style:{marginTop:"20px"}}),e.jsx(i,{type:"primary",style:{marginBottom:"10px"},onClick:()=>p(),children:"Save"})]})})]})}const O=t=>({deggrpsubject:t.deggrpsubject,degreesubject:t.degreesubject,boardsubject:t.boardsubject,updatingdata:t.updatingdata}),H=y(O,{getDeggrpDet:C,getDegreesDet:D,getBoardDet:B,postToDatabase:P,getAllCreatedSubject:F})(E);export{H as default};