1 |
- var d=(e,p,t)=>new Promise((s,i)=>{var l=o=>{try{a(t.next(o))}catch(r){i(r)}},m=o=>{try{a(t.throw(o))}catch(r){i(r)}},a=o=>o.done?s(o.value):Promise.resolve(o.value).then(l,m);a((t=t.apply(e,p)).next())});import{B as h,u as C}from"./useTable-Ol_P-TxG.js";import{T as D}from"./index-BEZBHtc2.js";import{u as R}from"./index-CwBw3p8r.js";import{R as T,c as y}from"./RoleDrawer-C54MDk3U.js";import{v as k,ap as S,_ as B}from"./entry/index-BOVpYCVt-1731915664217.js";import{g as A,d as v}from"./role-Dn1KF7ny.js";import{P as I}from"./index-VCsIDtFK.js";import{d as P,a9 as c,_,a6 as w,a7 as u,k as f,G as W,a2 as $,a0 as F}from"./vue-B5pbXMv7.js";import"./useForm-B-PbqzOc.js";import"./index-x2bUusKH.js";import"./antd-DXvsKA0x.js";import"./tree-Nv0Zt4Ov.js";import"./copyTextToClipboard-7uPthhEV.js";import"./index-DKfaJplO.js";import"./index-EdNvCi60.js";import"./index-DTfAZuwl.js";import"./index-BcSUkfeU.js";import"./index-DaqRmjER.js";import"./useWindowSizeFn-CzjmevD7.js";import"./plugin-CRRssOeV.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-CRwDSVfI.js";import"./index-CZk9a_J9.js";import"./useContentViewHeight-0Tf8Jxwa.js";const M=P({name:"RoleManagement",components:{BasicTable:h,RoleDrawer:T,TableAction:D,PageWrapper:I},setup(){const{t:e}=k.useI18n(),{createMessage:p}=S(),[t,{openDrawer:s}]=R(),[i,{reload:l}]=C({title:e("sys.role.roleList"),api:A,columns:y,formConfig:{labelWidth:120},useSearchForm:!1,showTableSetting:!0,bordered:!0,showIndexColumn:!1,actionColumn:{width:80,title:e("common.action"),dataIndex:"action",fixed:void 0}});function m(){s(!0,{isUpdate:!1})}function a(n){s(!0,{record:n,isUpdate:!0})}function o(n){return d(this,null,function*(){if(n.id===1){p.warn(e("common.notAllowDeleteAdminData"));return}(yield v({ids:[n.id]})).code===0&&(yield l())})}function r(){return d(this,null,function*(){yield l()})}return{t:e,registerTable:i,registerDrawer:t,handleCreate:m,handleEdit:a,handleDelete:o,handleSuccess:r}}});function N(e,p,t,s,i,l){const m=c("a-button"),a=c("TableAction"),o=c("BasicTable"),r=c("RoleDrawer"),n=c("PageWrapper");return _(),w(n,null,{default:u(()=>[f(o,{onRegister:e.registerTable},{toolbar:u(()=>[f(m,{type:"primary",onClick:e.handleCreate},{default:u(()=>[W($(e.t("sys.role.addRole")),1)]),_:1},8,["onClick"])]),bodyCell:u(({column:b,record:g})=>[b.key==="action"?(_(),w(a,{key:0,actions:[{label:"编辑",onClick:e.handleEdit.bind(null,g)},{label:"删除",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,g)}}]},null,8,["actions"])):F("",!0)]),_:1},8,["onRegister"]),f(r,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])]),_:1})}const ce=B(M,[["render",N]]);export{ce as default};
|