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.226.52.26
import{x as F,r as s,Q as N,t as e,D as I,L as v,B as u,F as d,G,E as g}from"./index-DuwC-VT_.js";import{s as R,g as H,a as L}from"./Degree-DfdUGLT5.js";import{S as q}from"./index-DKZf0FLW.js";import{R as x,C as n}from"./row-DMe-QGJ3.js";import"./responsiveObserver-DYHRiOGe.js";function A(t){const[i,h]=s.useState(""),[c,D]=s.useState(""),[m,j]=s.useState(""),[p,E]=s.useState(""),[f,y]=s.useState("select"),[b,C]=s.useState(!1),r=N();s.useEffect(()=>{t.getDeggrpData()},[]);const S=[{key:"select",label:"Select",value:"select"}];let w=t.getdegForDegree.map(a=>({key:a.key,value:a.value,label:a.label}));const B=[...S,...w];s.useEffect(()=>{r.degree||r.degcode||r.examno||r.examcode||r.deggrp?(r.degree&&h(r.degree),r.degcode&&D(r.degcode),r.examno&&j(r.examno),r.examcode&&E(r.examcode),r.deggrp&&y(r.deggrp),C(!0)):C(!1)},[r]);const l=(a,o)=>{a=="degree"&&h(o),a=="degcode"&&D(o),a=="examno"&&j(o),a=="examcode"&&E(o),a=="deggrp"&&y(o)},P=async()=>{if(i==="")return g("info","Please Enter Degree Name"),!1;if(c==="")return g("info","Please Enter Degree"),!1;if(m==="")return g("info","Please Enter Exam Name"),!1;if(p==="")return g("info","Please Enter Exam No"),!1;if(f==="select")return g("info","Please Select Degree Group"),!1;const a=new FormData;a.append("degree",i),a.append("degcode",c),a.append("examno",m),a.append("examcode",p),a.append("deggrp",f),await t.saveDegInfo(a)},k=async()=>{await t.getDegreeDetails()};return e.jsxs(I,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Degree Creation"}),extra:e.jsxs(q,{children:[e.jsx(v,{to:"/qpsettings/viewdegree",children:e.jsx(u,{type:"primary",onClick:()=>k(),children:"View"})}),e.jsx(v,{to:"/",children:e.jsx(u,{type:"primary",danger:!0,children:"Exit"})})]}),children:[e.jsxs(x,{gutter:10,children:[e.jsxs(n,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"Degree"}),e.jsx(d,{style:{marginBottom:"10px"},placeholder:"Degree Name",value:i,onChange:a=>l("degree",a.target.value)})]}),e.jsxs(n,{xs:12,sm:12,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Degree Code"}),e.jsx(d,{style:{marginBottom:"10px"},placeholder:"Degree Shortname",value:c,disabled:b,onChange:a=>l("degcode",a.target.value)})]})]}),e.jsxs(x,{gutter:10,children:[" ",e.jsxs(n,{xs:24,sm:24,md:12,lg:8,xl:8,xxl:8,children:[e.jsx("label",{children:"Exam Number"}),e.jsx(d,{style:{marginBottom:"10px"},placeholder:"Examno No",value:m,onChange:a=>l("examno",a.target.value)})]}),e.jsxs(n,{xs:12,sm:12,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Examno Code"}),e.jsx(d,{style:{marginBottom:"10px"},placeholder:"Examno",value:p,disabled:b,onChange:a=>l("examcode",a.target.value)})]})]}),e.jsx(x,{children:e.jsxs(n,{xs:12,sm:12,md:6,lg:4,xl:4,xxl:4,children:[e.jsx("label",{children:"Degree Group"}),e.jsx(G,{style:{marginBottom:"10px",width:"100%"},value:f,options:B,onChange:a=>l("deggrp",a)})]})}),e.jsx(x,{children:e.jsx(u,{type:"primary",onClick:()=>P(),children:"Save"})})]})}const O=t=>(console.log(t.getdegForDegree,"hi"),{deggrpsubject:t.deggrpsubject,deggrpEditData:t.deggrpEditData,updatedeg:t.updatedeg,getdegForDegree:t.getdegForDegree}),z=F(O,{saveDegInfo:R,getDegreeDetails:H,getDeggrpData:L})(A);export{z as default};
|