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