0xV3NOMx
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.135.215.149


Current Path : /var/www/qpms/assets/
Upload File :
Current File : /var/www/qpms/assets/Usertype-DQECRdw9.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-DuuJ_BVy.js";import{s as b,g as D,o as I}from"./Usertype-BRmx2t-A.js";import{p as S}from"./sem-BK69X1ab.js";import{S as v}from"./index-BjlpPnds.js";import{R as H}from"./StopOutlined-BJx9FJtz.js";import{R as E}from"./HomeOutlined-COaObuiP.js";import{F as L}from"./Table-CaI-VRgw.js";import{R as a,C as o}from"./row-Dz_eTgRG.js";import{R as T}from"./SaveOutlined-Bja7yXOQ.js";import{R as $}from"./EditOutlined-BQMZajXS.js";import"./index-DFKGOmqH.js";import"./index-Cfr0AqBF.js";import"./index-BbnbYn0r.js";import"./responsiveObserver-P-7D2JNj.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};