import{o as B,X as h,K as j,Y as C,Z as S}from"./index.17037962789732.js";import"./index.170379627897320.js";import"./index.170379627897315.js";import"./index.170379627897321.js";import{u as g}from"./permission.1703796278973.js";import{d as k,l as f,u as d,o as i,x as c,c as n,a as o,y as a,n as p,F as b,j as s}from"./vue.1703796278973.js";const J=k({name:"PermissionButton"}),E=k({...J,props:{noButton:{type:Boolean,default:()=>!1},tooltip:{type:Object},popConfirm:{type:Object},hasPermission:{type:String||Array||Boolean},style:{type:Object},...B(h(),"icon")},setup(l){const e=l,P=g(),m=f(()=>!e.hasPermission||e.hasPermission===!0?!0:P.hasPermission(e.hasPermission)),r=f(()=>"hasPermission"in e&&m.value?"disabled"in e?e.disabled:!1:!0);return(t,O)=>{const u=j,y=C,$=S;return d(m)?(i(),c(b,{key:0},[l.popConfirm?(i(),n($,a({key:0,overlayStyle:{width:"220px"}},l.popConfirm,{disabled:!d(m)||e.disabled}),{default:o(()=>[l.tooltip?(i(),n(y,p(a({key:0},l.tooltip)),{default:o(()=>[l.noButton?s(t.$slots,"default",{key:0}):(i(),n(u,a({key:1},e,{disabled:d(r),style:e.style}),{icon:o(()=>[s(t.$slots,"icon")]),default:o(()=>[s(t.$slots,"default")]),_:3},16,["disabled","style"]))]),_:3},16)):(i(),n(u,a({key:1},e,{disabled:d(r)}),{icon:o(()=>[s(t.$slots,"icon")]),default:o(()=>[s(t.$slots,"default")]),_:3},16,["disabled"]))]),_:3},16,["disabled"])):l.tooltip?(i(),n(y,p(a({key:1},l.tooltip)),{default:o(()=>[l.noButton?s(t.$slots,"default",{key:0}):(i(),n(u,a({key:1},e,{disabled:d(r),style:e.style}),{icon:o(()=>[s(t.$slots,"icon")]),default:o(()=>[s(t.$slots,"default")]),_:3},16,["disabled","style"]))]),_:3},16)):(i(),c(b,{key:2},[l.noButton?s(t.$slots,"default",{key:0}):(i(),n(u,a({key:1},e,{disabled:d(r),style:e.style}),{icon:o(()=>[s(t.$slots,"icon")]),default:o(()=>[s(t.$slots,"default")]),_:3},16,["disabled","style"]))],64))],64)):(i(),n(y,{key:1,title:"暂无权限，请联系管理员"},{default:o(()=>[l.noButton?s(t.$slots,"default",{key:0}):(i(),n(u,a({key:1},e,{disabled:d(r),style:e.style}),{icon:o(()=>[s(t.$slots,"icon")]),default:o(()=>[s(t.$slots,"default")]),_:3},16,["disabled","style"]))]),_:3}))}}});export{E as _};
