????

Your IP : 216.73.216.152


Current Path : C:/inetpub/vhost/xaydung.gdtsolutions.vn/build/static/js/
Upload File :
Current File : C:/inetpub/vhost/xaydung.gdtsolutions.vn/build/static/js/9407.8a34f56e.chunk.js

"use strict";(self.webpackChunk_qlxd_frontend=self.webpackChunk_qlxd_frontend||[]).push([[9407],{31142:(e,n,t)=>{t.d(n,{A:()=>s});t(82210);var l=t(65591),a=t(80226),r=t(63899),i=t(6058);function s(e){const{renderCustom:n,renderButton:t,children:s,title:o,onClose:d,open:c,style:h,className:u}=e;return(0,i.jsxs)(l.A,{open:c,onClose:d,style:h,className:u,children:[(0,i.jsx)(a.A,{renderCustom:n,renderButton:t,title:o,onClose:d}),(0,i.jsx)(r.A,{children:s})]})}},34315:(e,n,t)=>{t.d(n,{E:()=>a.A,o:()=>l.A});var l=t(63232),a=t(31142)},63232:(e,n,t)=>{t.d(n,{A:()=>g});t(82210);var l=t(86953),a=t(51959),r=t(71516),i=t(60803),s=t(34211),o=t(57011),d=t(75331),c=t(23347),h=t(36467),u=t(6058);const x=(0,l.A)((e=>({root:{margin:0,backgroundColor:"#006fca",color:"#FFF",padding:"6px 12px"},closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500],padding:"0 6px"}})))((e=>{const{children:n,classes:t,onClose:l}=e;return(0,u.jsxs)(i.A,{disableTypography:!0,className:t.root,children:[(0,u.jsx)(h.A,{variant:"subtitle2",children:n}),l?(0,u.jsx)(d.A,{"aria-label":"close",className:t.closeButton,onClick:l,children:(0,u.jsx)(c.A,{children:"close"})}):null]})})),p=(0,l.A)((e=>({root:{padding:e.spacing(2)}})))(s.A),f=(0,l.A)((e=>({root:{margin:0,padding:e.spacing(1),marginLeft:0}})))(o.A);function g(e){const{title:n,open:t,children:l,renderFooter:i,handleClose:s,maxWidth:o}=e,d=(0,a.A)({root:{overflowY:"unset"}})();return(0,u.jsxs)(r.A,{scroll:"body",className:d.root,onClose:s,open:t,fullWidth:!0,maxWidth:o,children:[(0,u.jsx)(x,{onClose:s,children:n}),(0,u.jsx)(p,{dividers:!0,children:l}),i&&(0,u.jsxs)(f,{children:[i," "]})]})}g.defaultProps={open:!1}},63899:(e,n,t)=>{t.d(n,{A:()=>r});t(82210);var l=t(34211),a=t(6058);function r(e){return(0,a.jsx)(l.A,{style:{backgroundColor:"#eee",paddingTop:20},children:e.children})}},65591:(e,n,t)=>{t.d(n,{A:()=>o});var l=t(82210),a=t(71516),r=t(3503),i=t(6058);const s=l.forwardRef(((e,n)=>(0,i.jsx)(r.A,{direction:"up",ref:n,...e})));function o(e){const{children:n,onClose:t,open:l,style:r,className:o}=e;return(0,i.jsx)(a.A,{className:o,style:r,disableEnforceFocus:!0,fullScreen:!0,open:l,onClose:t,TransitionComponent:s,children:n})}},72712:(e,n,t)=>{t.d(n,{E:()=>r});t(82210);var l=t(80028),a=t(6058);const r=e=>{const{children:n,...t}=e;return(0,a.jsx)(l.A,{...t,animation:"wave",children:n})}},79407:(e,n,t)=>{t.r(n),t.d(n,{default:()=>X});var l=t(82210),a=t(68940),r=t(35065),i=t(27894),s=t(46099),o=t(34315),d=t(2103),c=t(61278),h=t(54865),u=t(72297),x=t(6058);const p=e=>{const n=[];return e.forEach(((t,l,a)=>{if(!t.ParentId){const l={...t};if(0!==a.filter((e=>e.ParentId===t.Id)).length){const n=f(e,t.Id);l.children=n}n.push(l)}})),n};function f(e,n){const t=[];return e.forEach((l=>{if(l.ParentId===n){const n=f(e,l.Id);n.length&&(l.children=n),t.push(l)}})),t}const g=l.forwardRef(((e,n)=>{const{role:t,checkedKeys:a,typeModal:i}=e,[o,c]=(0,l.useState)(!0),[f,g]=(0,l.useState)([]),[j,A]=(0,l.useState)(a||null);return(0,l.useEffect)((()=>{var e;t&&(e=i,"ADMIN"===e?u.E6.getMenuTree():"PARTNER"===e?h.V4.getMenuTree():"USER"===e?h.qy.getMenuTree():void 0).then((e=>{const n=p(e.value);g(n)})).catch((()=>(0,r.a3)("Kh\xf4ng th\u1ec3 load d\u1eef li\u1ec7u !"))).finally((()=>c(!1)))}),[t,i]),(0,l.useEffect)((()=>{A(a)}),[a]),(0,l.useImperativeHandle)(n,(()=>({getAllChecked:()=>j}))),(0,x.jsx)(s.kt,{show:o,children:f&&0!==f.length&&a&&(0,x.jsx)(d.G,{nameId:"Id",expandAll:!0,data:[{Id:"null",children:f}],children:(0,x.jsx)(d.y,{nodeId:"null",icon:"fas fa-home",title:`WEB ${i}`,path:"/",children:m(f,j,A)})})})})),m=(e,n,t)=>e&&e.map(((e,l)=>(0,x.jsx)(d.y,{nodeId:e.Id,icon:e.Icon,title:e.Name,checkable:!0,checked:n.includes(e.Id),onCheck:(l,a)=>{n.includes(e.Id)?!1===a&&(n=(0,c.C3)(n,e.Id)):!0===a&&n.push(e.Id),t(n)},children:e.children&&m(e.children,n,t)},`${l}${e.Id}`))),j=g;var A=t(27473);const v=e=>{const n=(0,l.useRef)(null),{isOpen:t,typeModal:a,toggle:d,role:c}=e,[h,p]=(0,l.useState)(!1),[f,g]=(0,l.useState)(null),m=(e,n,t)=>{if("ADMIN"===n)return void 0===t?A.A.getMenuWithIDRole(e.Id):u.JP.setAllMenuAdministrationWithRole(t)};(0,l.useEffect)((()=>{!0===t&&c&&c.Id&&(p(!0),m(c,a).then((e=>{if(e.value){let n=[];e.value.forEach((e=>n.push(e.MenuId))),g(n)}})).catch((e=>(0,r.a3)("Kh\xf4ng t\xecm th\u1ea5y vai tr\xf2 !"))).finally((()=>p(!1))))}),[t,c,a]);return(0,x.jsx)(o.o,{open:t,handleClose:d,title:`Ch\u1ecdn c\xe1c Menu trong WEB ${a} \u0111\u1ec3 hi\u1ec3n th\u1ecb cho vai tr\xf2 '${c&&c.Name}'`,renderFooter:(0,x.jsxs)("div",{className:"btn-list",children:[(0,x.jsx)(i.QB,{onClick:()=>{const e=n.current&&n.current.getAllChecked();let t={Role_ID:c.Id,Menus_ID:[...e]};m(c,a,t).then((()=>(0,r.nw)("L\u01b0u th\xe0nh c\xf4ng !"))).catch((()=>(0,r.a3)("L\u01b0u kh\xf4ng th\xe0nh c\xf4ng !")))},disabled:h,children:"L\u01b0u"})," ",(0,x.jsx)(i.pf,{onClick:d,disabled:h,children:"\u0110\xf3ng"})]}),children:(0,x.jsx)(s.kt,{show:h,children:f&&(0,x.jsx)(j,{ref:n,role:c,checkedKeys:f,typeModal:a})})})};var b=t(51959),y=t(34446);const C=e=>{const{children:n,width:t,...l}=e,a=(0,b.A)((e=>({tabs:{width:t,borderRight:`1px solid ${e.palette.divider}`}})))();return(0,x.jsx)(y.A,{variant:"scrollable","aria-label":"Vertical",className:a.tabs,...l,children:n})};C.defaultProps={orientation:"vertical"};const I=C;var k=t(38423);const N=e=>{const{children:n,width:t,...l}=e;return(0,x.jsx)(k.A,{square:!0,children:(0,x.jsx)(y.A,{...l,children:n})})};N.defaultProps={variant:"fullWidth",orientation:"horizontal"};var w=t(36467),E=t(39438);const S=function(e){const{children:n,value:t,index:l,...a}=e;return(0,x.jsx)(w.A,{component:"div",role:"tabpanel",hidden:t!==l,id:`vertical-tabpanel-${l}`,"aria-labelledby":`vertical-tab-${l}`,...a,children:t===l&&(0,x.jsx)(E.A,{p:3,children:n})})};var M=t(51595);const W=e=>{const{children:n,tabs:t,height:l,tabWidth:a,...r}=e,i=(0,b.A)((e=>({root:{height:l,flexGrow:1,backgroundColor:e.palette.background.paper,display:"flex"},tab:{maxWidth:"inherit",fontWeight:"Bold",alignItems:"left",borderBottom:"1px solid beige"}})))();return(0,x.jsxs)("div",{className:i.root,children:[(0,x.jsx)(I,{width:a,...r,children:t.map(((e,n)=>(0,x.jsx)(M.A,{className:i.tab,label:e.label,...R(e.index)},n)))}),n]})};function R(e){return{id:`vertical-tab-${e}`,"aria-controls":`vertical-tabpanel-${e}`}}var D=t(72712),$=t(75331),B=t(23347),T=t(89082),_=t(64776),P=t(55975),L=t(82487),F=t(50207),H=t(53325),O=t(70567),q=t(76544),G=t(44884),z=t(79209);const K=e=>{const{checked:n,onChange:t}=e,[a,r]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{r(n)}),[n]),(0,x.jsx)(z.Sc,{checked:a,onChange:e=>{r(e.target.checked),t(e.target.checked)}})},V=(e,n)=>[{id:"Summary",label:`Danh s\xe1ch c\xe1c quy\u1ec1n c\u1ee7a nh\xf3m '${e.Mota}' - T\u1ed5ng:${n||""} `,style:{width:700}}],J=(0,b.A)({root:{minWidth:700,width:"100%"},container:{height:420},tableHead:{fontWeight:"bold"}}),Q=(0,l.forwardRef)(((e,n)=>{const{value:t,index:a,group:i,checks:o}=e,d=J(),[h,p]=(0,l.useState)(null),[f,g]=(0,l.useState)(!1),[m,j]=(0,l.useState)(null);return(0,l.useEffect)((()=>(t===a&&o&&(j(o),g(!0),u.hO.findAllEndpointByGroupName(i.Name).then((e=>{p(e.value)})).catch((()=>(0,r.a3)("Kh\xf4ng t\xecm th\u1ea5y vai tr\xf2 !"))).finally((()=>g(!1)))),()=>{p(null),j(null)})),[i,t,a,o]),(0,l.useImperativeHandle)(n,(()=>({getListChecked:()=>m}))),(0,x.jsx)(s.kt,{show:f,children:(0,x.jsx)(k.A,{className:d.root,children:(0,x.jsx)(P.A,{className:d.container,children:(0,x.jsxs)(L.A,{stickyHeader:!0,"aria-label":"sticky table",size:"small",children:[(0,x.jsx)(F.A,{className:d.tableHead,children:(0,x.jsxs)(H.A,{children:[V(i,h&&h.length).map((e=>(0,x.jsx)(O.A,{className:d.tableHead,align:e.align,style:{minWidth:e.minWidth},children:e.label},e.id))),(0,x.jsx)(O.A,{align:"center",children:h&&(0,x.jsx)(K,{checked:!!m&&h.length===m.length,onChange:e=>j(!0===e?[...h.map((e=>e.Id))]:[])})})]})}),(0,x.jsx)(q.A,{children:h&&h.map(((e,n)=>(0,x.jsxs)(H.A,{hover:!0,role:"checkbox",tabIndex:-1,children:[V(i,h.length).map((n=>(0,x.jsx)(O.A,{align:n.align,style:n.style,children:(0,x.jsxs)(_.fI,{children:[(0,x.jsx)(_.fv,{md:2,children:(0,x.jsx)(G.WO,{method:e.Method})}),(0,x.jsx)(_.fv,{md:10,children:(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{style:{textTransform:"capitalize",fontWeight:"bold"},children:e[n.id]}),(0,x.jsx)("small",{children:e.Pattern})]})})]})},n.id))),(0,x.jsx)(O.A,{align:"center",style:{width:10},children:(0,x.jsx)(K,{checked:!!m&&m.includes(e.Id),onChange:n=>j(!0===n?[...m,e.Id]:[...(0,c.C3)(m,e.Id)])})})]},n)))})]})})})})})),U=e=>{const{value:n,index:t,group:a,role:i}=e,o=(0,l.useRef)(null),[d,c]=(0,l.useState)(!1),[h,p]=(0,l.useState)(null);(0,l.useEffect)((()=>(i&&n===t&&(c(!0),u.JS.findAllIdEndpoint(i.Id,a.Name).then((e=>{const n=[];e.value.forEach((e=>n.push(e.HttpEndpointId))),p(n)})).catch((e=>(0,r.a3)(e))).finally((()=>c(!1)))),()=>{p(null)})),[i,n,t,a]);return(0,x.jsx)(S,{value:n,index:t,children:(0,x.jsxs)(_.fI,{children:[(0,x.jsx)(_.fv,{md:"11",children:n===t&&(0,x.jsx)(s.kt,{show:d,children:(0,x.jsx)(Q,{ref:o,value:n,index:t,group:a,checks:h||null})})}),(0,x.jsxs)(_.fv,{md:"1",children:[d?(0,x.jsx)($.A,{variant:"contained",color:"primary",disabled:!0,children:(0,x.jsx)(B.A,{children:"save"})}):(0,x.jsx)(T.Ay,{title:"L\u01b0u s\u1ef1 thay \u0111\u1ed5i",children:(0,x.jsx)($.A,{variant:"contained",color:"primary",onClick:()=>(()=>{const e=o.current&&o.current.getListChecked();if(e){let n={Role_ID:i.Id,Endpoints_ID:[...e],groupName:a.Name};u.JP.saveAllWithRoleAndGroupName(n).then((e=>{let{Message:n}=e;return(0,r.nw)(n)})).catch((()=>(0,r.a3)("L\u01b0u kh\xf4ng th\xe0nh c\xf4ng !")))}})(),children:(0,x.jsx)(B.A,{children:"save"})})}),d?(0,x.jsx)($.A,{variant:"contained",color:"secondary",disabled:!0,children:(0,x.jsx)(B.A,{children:"rotate_left"})}):(0,x.jsx)(T.Ay,{title:"Reset t\u1ea5t c\u1ea3",children:(0,x.jsx)($.A,{variant:"contained",color:"secondary",children:(0,x.jsx)(B.A,{children:"rotate_left"})})})]})]})})},Y=e=>{const{isOpen:n,toggle:t,role:a}=e,[i,d]=(0,l.useState)(0),[c,h]=(0,l.useState)(!1),[p,f]=(0,l.useState)(null);return(0,l.useEffect)((()=>{!0===n&&a&&(h(!0),u.hO.findAllGroupName().then((e=>{let{ResultObj:n}=e;return f(n)})).catch((e=>(0,r.a3)("\u0110\xe3 x\xe3y ra l\u1ed7i !"))).finally((()=>h(!1))))}),[n,a]),(0,x.jsx)(o.o,{maxWidth:"lg",open:n,handleClose:()=>{t(),d(0),f(null)},title:`C\xe0i \u0111\u1eb7t quy\u1ec1n cho vai tr\xf2 '${a&&a.Name}'`,children:p?(0,x.jsx)(s.kt,{show:c,children:(0,x.jsx)(W,{height:500,tabWidth:400,value:i,onChange:(e,n)=>d(n),tabs:p.map(((e,n)=>({index:n,label:`${e.Mota}`}))),children:p.map(((e,n)=>(0,x.jsx)(U,{value:i,index:n,group:e,role:a},n)))})}):(0,x.jsx)(D.E,{variant:"rect",height:500})})};function X(){const[e,n]=(0,l.useState)(!1),[t,r]=(0,l.useState)(!1),[i,s]=(0,l.useState)(""),[o,d]=(0,l.useState)(null);return(0,x.jsxs)(l.Fragment,{children:[(0,x.jsx)(a.A,{url:"Identities/AppRoles",title:"Danh s\xe1ch vai tr\xf2 t\xe0i kho\u1ea3n",columns:Z,selectType:"withColumns",onAdd:{defaultValues:[{field:"NormalizedName",isSame:"Name"}]},onEdit:{defaultValues:[{field:"NormalizedName",isSame:"Name"}]},onDelete:{},onActions:[e=>({icon:"view_headline",color:"rgb(230, 109, 204)",typeFont:"fontawesome",tooltip:"C\u1ea5u h\xecnh hi\u1ec3n th\u1ecb Menu Qu\u1ea3n Tr\u1ecb",disabled:!1===e.enableAdmin,onClick:(e,t)=>{d(t),n(!0),s("ADMIN")}})],rowStyle:e=>function(e){if("ADMIN"===e.role)return{backgroundColor:"rgb(177, 245, 186)"}}(e),onRowClick:(e,n)=>{d(n),r(!0)}}),(0,x.jsx)(v,{typeModal:i,isOpen:e,role:o,toggle:()=>{n(!e),d(null)}}),(0,x.jsx)(Y,{isOpen:t,role:o,toggle:()=>{r(!t),d(null)}})]})}const Z=[{field:"Id",dataID:!0,type:"numeric",hidden:!0},{title:"T\xean vai tr\xf2",field:"Name",type:"string",dataCheck:!0,searchable:!0},{title:"Web Qu\u1ea3n Tr\u1ecb",field:"EnableAdmin",type:"boolean",sorting:!1},{title:"Web \u0111\u01a1n v\u1ecb",field:"EnableClient",type:"boolean",sorting:!1},{title:"G\u1ed1c",field:"IsRoot",type:"boolean",editable:"never",hidden:!0},{title:"M\xf4 t\u1ea3",field:"Description",type:"string",dataCheck:!0,searchable:!0}]},80226:(e,n,t)=>{t.d(n,{A:()=>h});t(82210);var l=t(51959),a=t(59269),r=t(34581),i=t(54163),s=t(36467),o=t(54579),d=t(6058);const c=(0,l.A)((e=>(0,a.A)({appBar:{position:"relative",backgroundColor:"#006fca"},toolbar:{minHeight:40},title:{marginLeft:e.spacing(2),flex:1}})));function h(e){const n=c(),{renderCustom:t,renderButton:l,title:a,onClose:h}=e;return(0,d.jsx)(r.A,{className:n.appBar,children:(0,d.jsxs)(i.A,{className:n.toolbar,variant:"dense",children:[t,(0,d.jsx)(s.A,{variant:"h6",className:n.title,children:a}),l,(0,d.jsx)(o.A,{onClick:h,children:"\u0110\xf3ng"})]})})}}}]);
//# sourceMappingURL=9407.8a34f56e.chunk.js.map