????
Current Path : C:/inetpub/vhost/bcvt.kontum.gov.vn/admin/assets/ |
Current File : C:/inetpub/vhost/bcvt.kontum.gov.vn/admin/assets/Page_VaiTro-5599022d.js |
var c=Object.defineProperty;var p=(a,i,t)=>i in a?c(a,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[i]=t;var n=(a,i,t)=>(p(a,typeof i!="symbol"?i+"":i,t),t);import{r as d,j as s,R as l}from"./vendor-4ed091cd.js";import{T as g}from"./Tabs-6c2a6b41.js";import{h,j as T,f as y,e as m,_ as u}from"./index-8ef13bef.js";import{C}from"./Container-1ee99ed5.js";import"./Col-36d78327.js";import"./utils-edee7d6b.js";import"./Nav-d46410cd.js";import"./assertThisInitialized-081f9914.js";const f=l.lazy(()=>u(()=>import("./DataTable-65c5cdc1.js").then(a=>a.b),["assets/DataTable-65c5cdc1.js","assets/vendor-4ed091cd.js","assets/index-8ef13bef.js","assets/index-5306ce44.css","assets/DataTable-e309257a.css"])),v=l.lazy(()=>u(()=>import("./TransferList-53e616d5.js"),["assets/TransferList-53e616d5.js","assets/vendor-4ed091cd.js","assets/Col-36d78327.js","assets/utils-edee7d6b.js","assets/ButtonEdit-6bcc9939.js","assets/defineProperty-f749b14d.js","assets/assertThisInitialized-081f9914.js","assets/interopRequireDefault-01ffd8a5.js","assets/Button-7f5efc58.js","assets/Button-73af635f.js","assets/ToastDetail-1eff85f2.js"])),x="VaiTroLoaiDonVis",q=[{field:"ID",hidden:!0,dataID:!0,type:"string"},{title:"Mã vai trò",field:"Ma",type:"string",searchable:!0,dataCheck:!0},{title:"Tên vai trò",field:"TenVaiTro",type:"string",searchable:!0,dataCheck:!0},{title:"Mô tả",field:"MoTa",type:"string",searchable:!0,dataCheck:!0}];class L extends d.Component{constructor(t){super(t);n(this,"toggleLarge",()=>this.setState({large:!this.state.large}));n(this,"setTransferList",async(t,e)=>{let{list_quyen_da_cap:_,list_quyen_chua_cap:r}=await h(`/VaiTro/GetListQuyenTheoVaiTro?id_vai_tro=${e.ID}`,"GET",null,!1).then(o=>o.value).catch(o=>console.log(o));this.setState({id_vai_tro:e.ID,ds_quyen_thiet_lap:_,ds_quyen_khong_thiet_lap:r}),this.toggleLarge()});n(this,"saveTransferList",(t,e)=>{T("Bạn muốn cập nhật các quyền ?",null).then(_=>h("/VaiTro/CapQuyen","POST",JSON.stringify({id:this.state.id_vai_tro,list:e==null?[]:e.map(r=>`${r.id_quyen}`)}),!1).then(r=>{this.setState({id_vai_tro:"",ds_quyen_thiet_lap:[],ds_quyen_khong_thiet_lap:[],large:!this.state.large}),y("Cập nhật thành công !")}).catch(r=>m("Lỗi khi lưu !!")))});this.state={large:!1,id_vai_tro:null,ds_quyen_thiet_lap:[],ds_quyen_khong_thiet_lap:[]}}render(){return s.jsxs(C,{children:[s.jsx(f,{title:"Vai trò",url:x,columns:q,selectType:"withColumns",onAdd:{disabled:!1},onEdit:{},onDelete:{},onActions:[{icon:"tag",tooltip:"Thiết lập quyền",onClick:(t,e)=>this.setTransferList(t,e)}]}),s.jsx(v,{titles:"Thiết lập quyền",open:this.state.large,size:"xl",toggleModal:this.toggleLarge,listActive:this.state.ds_quyen_thiet_lap,listNotActive:this.state.ds_quyen_khong_thiet_lap,renderActive:(t,e)=>s.jsxs(l.Fragment,{children:[s.jsx("b",{children:e+1}),". ",t.ten_quyen]}),renderNotActive:(t,e)=>s.jsxs(l.Fragment,{children:[s.jsx("b",{children:e+1}),". ",t.ten_quyen]}),onUpdate:(t,e)=>this.saveTransferList(t,e)})]})}}class S extends d.Component{render(){return s.jsx(g,{data:[{TabName:"Vai trò",TabContent:s.jsx(L,{})}]})}}export{S as default};