import{w as L,L as P,M as j,I,N as M}from"./element-plus.fcb5dc91.js";import{_ as z}from"./index.vue_vue_type_script_setup_true_lang.9f140467.js";import{f as O,b as U}from"./index.fbf661f7.js";import{c as W,d as q}from"./role.29040604.js";import{u as G}from"./usePaging.6d054449.js";import{_ as H}from"./edit.vue_vue_type_script_setup_true_lang.9f7954c8.js";import{_ as J}from"./auth.vue_vue_type_script_setup_true_lang.188e4538.js";import{d as D,s as F,r as g,ah as K,o as a,c as E,W as t,O as i,a as C,P as c,M as u,T as v,u as n,j as Q,S as B,n as y}from"./@vue.a7a54728.js";import"./@vueuse.0a77614e.js";import"./@element-plus.a03b0c46.js";import"./lodash-es.50da5137.js";import"./dayjs.f435f141.js";import"./axios.cd7dbc38.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.b082b0c1.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.dbfecd92.js";import"./vue-router.c1c4566f.js";import"./pinia.b401a84e.js";import"./css-color-function.91b6e704.js";import"./color.d62296c5.js";import"./clone.f2407509.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.bd8db83c.js";import"./vue-clipboard3.82df6bce.js";import"./clipboard.ae9f1cf1.js";import"./echarts.8535e5a6.js";import"./zrender.3eba8991.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.f4ae74de.js";import"./index.94abbaf6.js";import"./menu.a4618669.js";const X={class:"role-lists"},Y={class:"mt-4"},Z={class:"flex justify-end mt-4"},ee=D({name:"role"}),ze=D({...ee,setup(te){const d=F(),k=F(),_=g(!1),w=g(!1),{pager:m,getLists:p}=G({fetchFun:q}),$=async()=>{var o;_.value=!0,await y(),(o=d.value)==null||o.open("add")},x=async o=>{var e,l;_.value=!0,await y(),(e=d.value)==null||e.open("edit"),(l=d.value)==null||l.setFormData(o)},A=async o=>{var e,l;w.value=!0,await y(),(e=k.value)==null||e.open(),(l=k.value)==null||l.setFormData(o)},V=async o=>{await O.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await W({id:o}),p()};return p(),(o,e)=>{const l=U,f=L,s=P,R=j,N=z,S=I,h=K("perms"),T=M;return a(),E("div",X,[t(S,{class:"!border-none",shadow:"never"},{default:i(()=>[C("div",null,[c((a(),u(f,{type:"primary",onClick:$},{icon:i(()=>[t(l,{name:"el-icon-Plus"})]),default:i(()=>[v(" \u65B0\u589E ")]),_:1})),[[h,["auth.role/add"]]])]),c((a(),E("div",Y,[C("div",null,[t(R,{data:n(m).lists,size:"large"},{default:i(()=>[t(s,{prop:"id",label:"ID","min-width":"100"}),t(s,{prop:"name",label:"\u540D\u79F0","min-width":"150"}),t(s,{prop:"desc",label:"\u5907\u6CE8","min-width":"150","show-overflow-tooltip":""}),t(s,{prop:"sort",label:"\u6392\u5E8F","min-width":"100"}),t(s,{prop:"num",label:"\u7BA1\u7406\u5458\u4EBA\u6570","min-width":"100"}),t(s,{prop:"create_time",label:"\u521B\u5EFA\u65F6\u95F4","min-width":"180"}),t(s,{label:"\u64CD\u4F5C",width:"200",fixed:"right"},{default:i(({row:r})=>[c((a(),u(f,{link:"",type:"primary",onClick:b=>x(r)},{default:i(()=>[v(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[h,["auth.role/edit"]]]),c((a(),u(f,{link:"",type:"primary",onClick:b=>A(r)},{default:i(()=>[v(" \u5206\u914D\u6743\u9650 ")]),_:2},1032,["onClick"])),[[h,["auth.role/edit"]]]),c((a(),u(f,{link:"",type:"danger",onClick:b=>V(r.id)},{default:i(()=>[v(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[h,["auth.role/delete"]]])]),_:1})]),_:1},8,["data"])]),C("div",Z,[t(N,{modelValue:n(m),"onUpdate:modelValue":e[0]||(e[0]=r=>Q(m)?m.value=r:null),onChange:n(p)},null,8,["modelValue","onChange"])])])),[[T,n(m).loading]])]),_:1}),n(_)?(a(),u(H,{key:0,ref_key:"editRef",ref:d,onSuccess:n(p),onClose:e[1]||(e[1]=r=>_.value=!1)},null,8,["onSuccess"])):B("",!0),n(w)?(a(),u(J,{key:1,ref_key:"authRef",ref:k,onSuccess:n(p),onClose:e[2]||(e[2]=r=>w.value=!1)},null,8,["onSuccess"])):B("",!0)])}}});export{ze as default};
