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.149.24.70
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/Usertype-4h2Jfzo6.js |
import{x as j,r as d,t as e,D as U,B as n,R as C,L as w,M as R,F as p,E as k}from"./index-BXGyQmrS.js";import{s as b,g as D,o as I}from"./Usertype-1XicBqVN.js";import{p as S}from"./sem-CXAFzSxe.js";import{S as v}from"./index-Dmdyjymp.js";import{R as H}from"./StopOutlined-BG_Kty9g.js";import{R as E}from"./HomeOutlined-DXLVvpRw.js";import{F as L}from"./Table-CVDZw6UV.js";import{R as a,C as o}from"./row-BC5PwUrl.js";import{R as T}from"./SaveOutlined-C0Uip7qI.js";import{R as $}from"./EditOutlined-DVhdoJf9.js";import"./index-BjgvK_nI.js";import"./index-DA_qcuNc.js";import"./index-BLFlp97X.js";import"./responsiveObserver-BnSpyoMt.js";const B=s=>{const[r,l]=d.useState({usertype:"",descpn:""}),[x,m]=d.useState(!1),i=t=>{l({...r,[t.target.name]:t.target.value})},y=async()=>{if(r.usertype===""||r.descpn===""){k("info","All the fields required");return}const t=new FormData;t.append("data",JSON.stringify(r)),await s.saveUsertype(t)},g=()=>{s.getUsertypeData()},c=()=>{s.openUsertypeHandler(!1)},h=t=>{l({usertype:t.fusertype,descpn:t.fdescpn}),m(!0),s.openUsertypeHandler(!1)},u=[{title:"Sl. No.",dataIndex:"fslno",align:"center"},{title:"Usertype",dataIndex:"fusertype",align:"center"},{title:"Description",dataIndex:"fdescpn",align:"center"},{title:"Action",render:(t,f)=>e.jsxs(n,{style:{color:"white",background:"green"},size:"medium",onClick:()=>h(f),children:[e.jsx($,{})," Edit"]}),align:"center"}];return e.jsxs(U,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Create User Type"}),extra:e.jsxs(v,{children:[e.jsxs(n,{style:{background:"black",color:"white"},onClick:()=>window.location.reload(),children:[e.jsx(H,{})," Clear"]}),e.jsxs(n,{style:{color:"white",background:"green"},onClick:()=>g(),children:[e.jsx(C,{})," View"]}),e.jsx(w,{to:"/",children:e.jsxs(n,{type:"primary",danger:!0,children:[e.jsx(E,{})," Exit"]})})]}),children:[e.jsx(R,{title:e.jsx("p",{children:"Usertype Data"}),footer:e.jsx(n,{type:"primary",onClick:()=>c(),children:"Close"}),width:1e3,open:s.open,onCancel:()=>c(),children:e.jsx(L,{columns:u,dataSource:s.usertype,scroll:{x:1e3,y:300},pagination:S})}),e.jsx(a,{gutter:10,children:e.jsxs(o,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[e.jsx("label",{children:"Usertype "}),"(Example T: Teacher, M: Moderator)",e.jsx(p,{disabled:x,name:"usertype",value:r.usertype,style:{marginBottom:"10px"},maxLength:1,onChange:t=>i(t)})]})}),e.jsx(a,{gutter:10,children:e.jsxs(o,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:[e.jsx("label",{children:"Description"}),e.jsx(p,{name:"descpn",style:{marginBottom:"10px"},value:r.descpn,maxLength:50,onChange:t=>i(t)})]})}),e.jsx(a,{children:e.jsx(o,{xs:24,sm:24,md:12,lg:6,xl:6,xxl:6,children:e.jsxs(n,{type:"primary",onClick:()=>y(),children:[e.jsx(T,{})," Save"]})})})]})},F=s=>({usertype:s.getUsertypedata,loading:s.loader.appLoading,open:s.openUsertype}),X=j(F,{saveUsertype:b,getUsertypeData:D,openUsertypeHandler:I})(B);export{X as default};
|