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.117.145.41
import{x as D,Q as v,r as n,t as e,D as f,L as c,B as i,F as d}from"./index-BnV6LRk1.js";import{s as E,g as C}from"./DegreeGroup-GkHcROVC.js";import{S as b}from"./index-Bm30U5Iv.js";import{R as g,C as x}from"./row-BF3oSYmo.js";import"./responsiveObserver-BFnokbxg.js";function B(t){const p=v(),[r,o]=n.useState({deggrp:"",desp:"",year:"",mode:"",exmdate:"",type:"insert"}),[m,h]=n.useState(!1),s=(a,l)=>{o(y=>({...y,[a]:l}))},u=async()=>{await t.saveDeggrpToDataBase(r)},j=async()=>{await t.getDeggrpData()};return n.useEffect(()=>{p.type=="update"&&(o({...r,deggrp:t.deggrpEditData.fdeggrp,desp:t.deggrpEditData.fdescpn,year:t.deggrpEditData.fyear,mode:t.deggrpEditData.fexamtype,exmdate:t.deggrpEditData.fexamdate,type:p.type}),h(!0))},[t.deggrpEditData]),e.jsxs(f,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Degree Group Creation"}),extra:e.jsxs(b,{children:[e.jsx(c,{to:"/qpsetting/viewdeggrp",children:e.jsx(i,{type:"primary",onClick:()=>j(),children:"View"})}),e.jsx(c,{to:"/",children:e.jsx(i,{type:"primary",danger:!0,children:"Exit"})})]}),children:[e.jsx(g,{gutter:10,children:e.jsxs(x,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"Degree Group"}),e.jsx(d,{type:"text",placeholder:"Degree Group",value:r.deggrp,disabled:m,style:{marginBottom:"10px"},onChange:a=>{s("deggrp",a.target.value)}})]})}),e.jsx(g,{gutter:10,children:e.jsxs(x,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"Description"}),e.jsx(d,{type:"text",placeholder:"Description",value:r.desp,style:{marginBottom:"10px"},onChange:a=>{s("desp",a.target.value)}})]})}),e.jsxs(g,{gutter:10,children:[e.jsxs(x,{xs:18,sm:18,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Year"}),e.jsx(d,{type:"text",placeholder:"Year",maxLength:4,value:r.year,style:{marginBottom:"10px"},onChange:a=>{const l=a.target.value.replace(/[^0-9]/g,"");s("year",l)}})]}),e.jsxs(x,{xs:18,sm:18,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Mode"}),e.jsx(d,{placeholder:"Exam Type",maxLength:1,value:r.mode,style:{marginBottom:"10px"},onChange:a=>{const l=a.target.value.replace(/[^0-9]/g,"");s("mode",l)}})]})]}),e.jsx(g,{gutter:10,children:e.jsxs(x,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"Exam Date"}),e.jsx(d,{type:"text",placeholder:"Exam Date",value:r.exmdate,style:{marginBottom:"10px"},onChange:a=>{s("exmdate",a.target.value)}})]})}),e.jsx(g,{children:e.jsx(i,{type:"primary",onClick:()=>u(),children:"Save"})})]})}const w=t=>({deggrpsubject:t.deggrpsubject,deggrpEditData:t.deggrpEditData}),R=D(w,{saveDeggrpToDataBase:E,getDeggrpData:C})(B);export{R as default};
|