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.118.144.239
"use strict";(self.webpackChunkcollege_portal_app=self.webpackChunkcollege_portal_app||[]).push([[497],{10925:(e,s,t)=>{t.d(s,{NS:()=>o,Pe:()=>i,Yg:()=>u});var a=t(15444),l=t(6051),n=t(87021),c=t(62058),r=t(70579);const o=e=>({filterDropdown:s=>{let{setSelectedKeys:t,selectedKeys:o,confirm:u,clearFilters:i,close:d}=s;return(0,r.jsxs)("div",{style:{padding:8},onKeyDown:e=>e.stopPropagation(),children:[(0,r.jsx)(a.A,{autoFocus:!0,placeholder:"Search ".concat(e),value:o,onChange:e=>t(e.target.value?[e.target.value]:[]),onPressEnter:()=>{u()},style:{marginBottom:8,display:"block"}}),(0,r.jsxs)(l.A,{children:[(0,r.jsx)(n.Ay,{type:"primary",onClick:()=>u(),icon:(0,r.jsx)(c.A,{}),size:"small",style:{width:90},children:"Search"}),(0,r.jsx)(n.Ay,{onClick:()=>{i(),u()},size:"small",style:{width:90},children:"Reset"})]})]})},filterIcon:e=>(0,r.jsx)(c.A,{style:{color:e?"#CFFF8D":"#fff"}}),onFilter:(s,t)=>t[e].toString().toLowerCase().includes(s.toLowerCase())}),u=(e,s)=>s.value.toString().toLowerCase().indexOf(e.toLowerCase())>=0||s.label.toString().toLowerCase().indexOf(e.toLowerCase())>=0,i=(e,s,t)=>e[t].localeCompare(s[t])},32497:(e,s,t)=>{t.r(s),t.d(s,{default:()=>x});var a=t(65043),l=t(32513),n=t(5397),c=t(6051),r=t(87021),o=t(79672),u=t(14647),i=t(95010),d=t(84084),h=t(10925),m=t(86213),p=t(150),g=t(15355);const y=e=>({type:"LOADING",load:e});var b=t(83003),f=t(28369),A=t(70579);const x=(0,b.Ng)((e=>(console.log(e.AuthReducer.userData,"hi"),{user:e.AuthReducer.userData,foruserdata:e.usermenuReducer.usersData,loading:e.degreeReducer.loading})))((function(e){const[s,t]=(0,a.useState)(!1),[x,j]=(0,a.useState)([]),[v,S]=(0,a.useState)("inline"),[w,C]=(0,a.useState)("light"),k=(0,b.wA)();(0,a.useEffect)((()=>{j(e.foruserdata)}),[e.foruserdata]);const F=async s=>{t(s),await(async(e,s,t,a,l)=>{e(y(!0));try{await(0,m.A)({method:"GET",url:p.A+"cAssignUserMenu&univcode="+s+"&collcode="+t+"&usertype="+a+"&user="+l,headers:{"Content-Type":"application/json"}}).then((s=>{console.log(s,"res anita"),0===s.data.error_code?(e({type:"USERDATA",payload:s.data.data.menu}),e(y(!1))):(e({type:"CLEAR_USERDATA",payload:[]}),e(y(!1)))}))}catch(n){e(y(!1)),(0,g.F)(n)}})(k,e.user.funivcode,e.user.fcollcode,e.user.fusertype,s)},T=x.map(((e,s)=>({key:"el_".concat(s),label:(0,A.jsx)(l.A,{checked:"T"===e.fstatus,onChange:e=>((e,s)=>{let t=[...x];if(t[s].fstatus=e?"T":"F",t[s].submenu){const a=t[s].submenu.map((s=>(s.fstatus=e?"T":"F",s)));j([...a]),t[s].submenu.forEach(((a,l)=>{a.ssubmenu&&(t[s].submenu[l].ssubmenu=a.ssubmenu.map((s=>({...s,fstatus:e?"T":"F"}))))}))}j(t),console.log(t,"ii")})(e.target.checked,s),children:e.title}),children:e.submenu&&e.submenu.length>0?e.submenu.map(((e,t)=>({key:"sub_".concat(s,"_").concat(t),label:(0,A.jsx)(l.A,{checked:"T"===e.fstatus,onChange:e=>((e,s,t)=>{let a=[...x];a[t].submenu[s].fstatus=e?"T":"F",a[t].submenu[s].ssubmenu&&(a[t].submenu[s].ssubmenu=a[t].submenu[s].ssubmenu.map((s=>({...s,fstatus:e?"T":"F"})))),j(a)})(e.target.checked,t,s),children:e.title}),children:e.ssubmenu&&e.ssubmenu.length>0?e.ssubmenu.map(((e,a)=>({key:"sub_sub_".concat(s,"_").concat(t,"_").concat(a),label:(0,A.jsx)(l.A,{checked:"T"===e.fstatus,onChange:e=>((e,s,t,a)=>{let l=[...x];l[s].submenu[t].ssubmenu[a].fstatus=e?"T":"F",j(l)})(e.target.checked,s,t,a),children:e.title})}))):null}))):null}))),_=async()=>{let t=new FormData;t.append("data",JSON.stringify(x)),t.append("collcode",e.user.fcollcode),t.append("univcode",e.user.funivcode),t.append("fuser",s),await(async(e,s)=>{e(y(!0));try{await m.A.post(p.A+"saveassignuserRight",s),(0,g.F)("Successfully Saved")}catch(t){e(y(!1)),(0,g.F)("Something Went Wrong"),(0,g.F)(t)}})(k,t)};return(0,A.jsx)("div",{className:"container-fluid",children:(0,A.jsxs)(n.A,{hoverable:!0,title:"Assign User Menus",style:{width:"100%"},extra:(0,A.jsxs)(c.A,{direction:"horizontal",children:[(0,A.jsx)(r.Ay,{className:"save",onClick:()=>_(),children:"Save"}),(0,A.jsx)(r.Ay,{className:"report",children:"Report"}),(0,A.jsx)(r.Ay,{className:"clear",children:"Clear"}),(0,A.jsx)(r.Ay,{className:"exit",children:"Exit"})]}),children:[(0,A.jsx)("div",{style:{marginBottom:"20px"},children:(0,A.jsx)(o.A,{gutter:16,children:(0,A.jsxs)(u.A,{xs:24,sm:24,md:12,lg:8,xl:8,children:[(0,A.jsx)("b",{children:(0,A.jsx)("label",{children:"Select Type"})}),(0,A.jsx)(i.A,{showSearch:!0,placeholder:"Select",style:{width:"100%"},options:[{value:" ",label:"---Select---"},{value:"A",label:"Admin"},{value:"T",label:"Teacher"},{value:"S",label:"Super Wiser"}],loading:e.loading,filterOption:h.Yg,value:s,onChange:e=>F(e)})]})})}),(0,A.jsx)(d.A,{style:{width:350,marginLeft:"50px"},mode:v,theme:w,items:T,loading:e.loading,children:(0,A.jsxs)(c.A,{style:{padding:"2px",width:"100%",marginTop:"20px"},children:["menu",(0,A.jsx)(f.A,{})]})})]})})}))}}]);
//# sourceMappingURL=497.b6da0d3e.chunk.js.map
|