import{R as P}from"./index-b671ca80.js";import{_ as T}from"./addRole.vue_vue_type_script_setup_true_name_systemAddRoleDialog_lang-8dd07ec6.js";import{_ as V}from"./addPermission.vue_vue_type_script_setup_true_name_systemAddRoleDialog_lang-72b65e85.js";import{E as $,a as h}from"./element-plus-91d6d961.js";import{H as v,e as w,_ as A,i as E,ah as l,o as m,c as H,V as t,P as r,a as M,T as c,O as d,S as _}from"./@vue-6dabbe94.js";import{_ as O}from"./_plugin-vue_export-helper-c27b6911.js";import"./index-a6ee13d3.js";import"./pinia-b6f74250.js";import"./vue-router-c1461dfc.js";import"./vue-i18n-b3581196.js";import"./@intlify-ea47d1db.js";import"./source-map-7d7e1c08.js";import"./vue-b1ba6f14.js";import"./js-cookie-edb2da2a.js";import"./@element-plus-64e6e14a.js";import"./nprogress-08a53ce8.js";import"./axios-4a70c6fc.js";import"./qs-c5b6dbf2.js";import"./side-channel-394f276c.js";import"./get-intrinsic-bd2830fd.js";import"./has-symbols-e8f3ca0e.js";import"./has-proto-f7d0b240.js";import"./function-bind-22e7ee79.js";import"./has-26d28e02.js";import"./call-bind-e5c1c8b0.js";import"./object-inspect-8fd4bade.js";import"./mitt-f7ef348c.js";import"./vue-grid-layout-ec2a62c3.js";import"./lodash-es-9851428c.js";import"./@vueuse-e129c873.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-f6fdf7b4.js";import"./async-validator-dee29e8b.js";import"./memoize-one-297ddbcb.js";import"./escape-html-b8998962.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-880a26aa.js";const U={class:"system-role-container"},j={class:"system-role-search mb15"},I=v({name:"systemRole"}),L=v({...I,setup(q){const u=P(),f=w(),g=w(),a=A({tableData:{data:[],total:0,loading:!1,param:{page:1,pageSize:10}}}),b=e=>{f.value.openDialog(e)},C=e=>{g.value.openDialog(e)},i=()=>{u.getRoleList(a.tableData.param).then(e=>{a.tableData.data=e.data.records,a.tableData.total=e.data.total}).catch(()=>{})},D=e=>{$.confirm("此操作将永久删除角色, 是否继续?","提示",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}).then(()=>{u.delRole(e.id).then(()=>{h.success("删除成功"),i()}).catch(n=>{h.error(n.message)})}).catch(()=>{})},k=e=>{a.tableData.param.pageSize=e,i()},x=e=>{a.tableData.param.page=e,i()};return E(()=>{i()}),(e,n)=>{const z=l("ele-Plus"),R=l("el-icon"),p=l("el-button"),s=l("el-table-column"),S=l("el-table"),B=l("el-pagination"),N=l("el-card");return m(),H("div",U,[t(N,{shadow:"hover"},{default:r(()=>[M("div",j,[t(p,{onClick:b,size:"default",class:"mt10",type:"primary"},{default:r(()=>[t(R,null,{default:r(()=>[t(z)]),_:1}),c("新建角色")]),_:1})]),t(S,{data:a.tableData.data,stripe:"",style:{width:"100%"}},{default:r(()=>[t(s,{prop:"roleName",label:"角色名","show-overflow-tooltip":""}),t(s,{prop:"roleDesc",label:"描述","show-overflow-tooltip":""}),t(s,{prop:"created",label:"创建时间","show-overflow-tooltip":""}),t(s,{prop:"path",label:"操作",width:"200"},{default:r(o=>[o.row.id!=1?(m(),d(p,{key:0,size:"small",text:"",type:"primary",onClick:y=>b(o.row)},{default:r(()=>[c("修改")]),_:2},1032,["onClick"])):_("",!0),o.row.id!=1?(m(),d(p,{key:1,size:"small",text:"",type:"primary",onClick:y=>C(o.row)},{default:r(()=>[c("权限设置")]),_:2},1032,["onClick"])):_("",!0),o.row.id!=1?(m(),d(p,{key:2,size:"small",text:"",type:"primary",onClick:y=>D(o.row)},{default:r(()=>[c("删除")]),_:2},1032,["onClick"])):_("",!0)]),_:1})]),_:1},8,["data"]),t(B,{onSizeChange:k,onCurrentChange:x,class:"mt15","pager-count":5,"page-sizes":[10,20,30],"current-page":a.tableData.param.pageNum,"onUpdate:currentPage":n[0]||(n[0]=o=>a.tableData.param.pageNum=o),background:"","page-size":a.tableData.param.pageSize,"onUpdate:pageSize":n[1]||(n[1]=o=>a.tableData.param.pageSize=o),layout:"total, sizes, prev, pager, next, jumper",total:a.tableData.total},null,8,["current-page","page-size","total"])]),_:1}),t(T,{ref_key:"addRoleRef",ref:f,onReloadTable:i},null,512),t(V,{ref_key:"addPermissionRef",ref:g},null,512)])}}});const Be=O(L,[["__scopeId","data-v-7ced785f"]]);export{Be as default};
