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.146.176.191
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/Usertype-Hd7-gvy9.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-D_3WEyIX.js";import{s as b,g as D,o as I}from"./Usertype-C_8OwnjZ.js";import{p as S}from"./sem-DLpF_ddZ.js";import{S as v}from"./index-BvbigfBp.js";import{R as H}from"./StopOutlined-CEm5b50E.js";import{R as E}from"./HomeOutlined-DuI9l8yy.js";import{F as L}from"./Table-CWyPglVw.js";import{R as a,C as o}from"./row-Cf-GfLu-.js";import{R as T}from"./SaveOutlined-DsDSfzEo.js";import{R as $}from"./EditOutlined-Dgd6YPZ6.js";import"./index-C7iNPYsc.js";import"./index-BmZJU0_T.js";import"./index-F4vCNHPI.js";import"./responsiveObserver-B-8Q9O9D.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};
|