import{u as L,G as N,J as M,F as P,M as U}from"./element-plus.33d6376e.js";import{u as j,_ as z}from"./usePaging.4b232826.js";import{f as b,b as G}from"./index.80c2a703.js";import{d as I,e as J}from"./role.4bb0e5e1.js";import{_ as K}from"./edit.vue_vue_type_script_setup_true_lang.fc4b26d6.js";import{_ as q}from"./auth.vue_vue_type_script_setup_true_lang.0f191a03.js";import{d as H,s as E,r as g,ad as O,o as a,c as Q,U as t,L as s,a as h,M as d,K as r,u,k as W,R as B,S as k,n as w}from"./@vue.230e89ba.js";import"./@vueuse.88988742.js";import"./dayjs.66926594.js";import"./axios.2d915936.js";import"./@element-plus.739f7923.js";import"./lodash-es.29c53eac.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.b68d77aa.js";import"./vue-router.c0281831.js";import"./pinia.1d1aade0.js";import"./vue-demi.bfae2336.js";import"./css-color-function.a8f9466d.js";import"./color.903ca10f.js";import"./clone.9d64bb7a.js";import"./color-convert.69e17089.js";import"./color-string.e356f5de.js";import"./color-name.e7a4e1d3.js";import"./nprogress.a96d99f2.js";import"./echarts.6ad8c478.js";import"./zrender.f91f2f01.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.b3d01323.js";import"./index.4107e0ad.js";import"./menu.95a3e0c2.js";const X={class:"role-lists"},Y=k(" \u65B0\u589E "),Z={class:"mt-4"},ee=k(" \u7F16\u8F91 "),te=k(" \u6743\u9650\u8BBE\u7F6E "),oe=k(" \u5220\u9664 "),ae={class:"flex justify-end mt-4"},Ue=H({__name:"index",setup(se){const p=E(),y=E(),_=g(!1),C=g(!1),{pager:m,getLists:c}=j({fetchFun:J}),D=async()=>{var o;_.value=!0,await w(),(o=p.value)==null||o.open("add")},$=async o=>{var e,n;_.value=!0,await w(),(e=p.value)==null||e.open("edit"),(n=p.value)==null||n.setFormData(o)},x=async o=>{var e,n;C.value=!0,await w(),(e=y.value)==null||e.open(),(n=y.value)==null||n.setFormData(o)},A=async o=>{await b.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await I({id:o}),b.msgSuccess("\u5220\u9664\u6210\u529F"),c()};return c(),(o,e)=>{const n=G,f=L,i=N,R=M,V=z,S=P,v=O("perms"),T=U;return a(),Q("div",X,[t(S,{class:"!border-none",shadow:"never"},{default:s(()=>[h("div",null,[d((a(),r(f,{type:"primary",onClick:D},{icon:s(()=>[t(n,{name:"el-icon-Plus"})]),default:s(()=>[Y]),_:1})),[[v,["system:role:add"]]])]),h("div",Z,[h("div",null,[d((a(),r(R,{data:u(m).lists,size:"large"},{default:s(()=>[t(i,{prop:"id",label:"ID","min-width":"100"}),t(i,{prop:"name",label:"\u540D\u79F0","min-width":"150"}),t(i,{prop:"remark",label:"\u5907\u6CE8","min-width":"150","show-overflow-tooltip":""}),t(i,{prop:"sort",label:"\u6392\u5E8F","min-width":"100"}),t(i,{prop:"member",label:"\u7BA1\u7406\u5458\u4EBA\u6570","min-width":"120"}),t(i,{prop:"createTime",label:"\u521B\u5EFA\u65F6\u95F4","min-width":"180"}),t(i,{label:"\u64CD\u4F5C",width:"190",fixed:"right"},{default:s(({row:l})=>[d((a(),r(f,{link:"",type:"primary",onClick:F=>$(l)},{default:s(()=>[ee]),_:2},1032,["onClick"])),[[v,["system:role:edit"]]]),d((a(),r(f,{link:"",type:"primary",onClick:F=>x(l)},{default:s(()=>[te]),_:2},1032,["onClick"])),[[v,["system:role:edit"]]]),d((a(),r(f,{link:"",type:"danger",onClick:F=>A(l.id)},{default:s(()=>[oe]),_:2},1032,["onClick"])),[[v,["system:role:del"]]])]),_:1})]),_:1},8,["data"])),[[T,u(m).loading]])]),h("div",ae,[t(V,{modelValue:u(m),"onUpdate:modelValue":e[0]||(e[0]=l=>W(m)?m.value=l:null),onChange:u(c)},null,8,["modelValue","onChange"])])])]),_:1}),_.value?(a(),r(K,{key:0,ref_key:"editRef",ref:p,onSuccess:u(c),onClose:e[1]||(e[1]=l=>_.value=!1)},null,8,["onSuccess"])):B("",!0),C.value?(a(),r(q,{key:1,ref_key:"authRef",ref:y,onSuccess:u(c),onClose:e[2]||(e[2]=l=>C.value=!1)},null,8,["onSuccess"])):B("",!0)])}}});export{Ue as default};
