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.141.25.125
Current Path : /var/www/qpms/assets/ |
| Current File : /var/www/qpms/assets/Usertype-BGOP4sVc.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-DNLfgd66.js";import{s as b,g as D,o as I}from"./Usertype-DRP5UA_z.js";import{S}from"./index-Cegtx7Nr.js";import{R as v}from"./StopOutlined-CUmCzu9A.js";import{R as H}from"./HomeOutlined-DwpzT65z.js";import{F as E}from"./Table-BSOQ4BWe.js";import{R as a,C as o}from"./row-C84ed1oX.js";import{R as L}from"./SaveOutlined-C8r6OK74.js";import{R as T}from"./EditOutlined-sUuZ2e0a.js";import"./index-p2sVlXNE.js";import"./index-CdwpRzQe.js";import"./index-Dpalldti.js";import"./responsiveObserver-DLOaSOjc.js";const $=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)},h=()=>{s.getUsertypeData()},c=()=>{s.openUsertypeHandler(!1)},u=t=>{l({usertype:t.fusertype,descpn:t.fdescpn}),m(!0),s.openUsertypeHandler(!1)},g=[{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:()=>u(f),children:[e.jsx(T,{})," Edit"]}),align:"center"}];return e.jsxs(U,{style:{margin:"6rem 10px 10px"},title:e.jsx("h6",{children:"Create User Type"}),extra:e.jsxs(S,{children:[e.jsxs(n,{style:{background:"black",color:"white"},onClick:()=>window.location.reload(),children:[e.jsx(v,{})," Clear"]}),e.jsxs(n,{style:{color:"white",background:"green"},onClick:()=>h(),children:[e.jsx(C,{})," View"]}),e.jsx(w,{to:"/",children:e.jsxs(n,{type:"primary",danger:!0,children:[e.jsx(H,{})," 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(E,{columns:g,dataSource:s.usertype,scroll:{x:1e3,y:300}})}),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(L,{})," Save"]})})})]})},B=s=>({usertype:s.getUsertypedata,loading:s.loader.appLoading,open:s.openUsertype}),Q=j(B,{saveUsertype:b,getUsertypeData:D,openUsertypeHandler:I})($);export{Q as default};
|