import{d as y,u as C,dc as v,g as k,d9 as b,c as r,o as a,w as e,i as B,j as s,W as D,p as n,H as w,D as x,l as N,B as V,aE as c,X as z}from"./index-9PRMimni.js";const P={class:"n-layout-page-header"},j=y({__name:"authority",setup(A){const _=C(),{hasPermission:u}=v();function d(){u(["delete_user"])&&_.success("恭喜，您拥有该操作权限")}function m(){u(["delete_list"])||_.warning("抱歉，您没有操作权限")}return(E,t)=>{const l=D,o=V,i=w,p=k("Authority",!0),g=z,f=b("permission");return a(),r(g,null,{default:e(()=>[B("div",P,[s(l,{bordered:!1,title:"权限判断"},{default:e(()=>t[0]||(t[0]=[n(" 中后台系统，权限事关重要，可能在任意页面都会存在，前端可以通过多种方式来实现权限控制 ")])),_:1})]),s(l,{bordered:!1,title:"方法判断",class:"mt-3 proCard",size:"small",segmented:{content:!0}},{default:e(()=>[s(i,null,{default:e(()=>[N(u)(["delete_user"])?(a(),r(o,{key:0,type:"success",onClick:d},{default:e(()=>t[1]||(t[1]=[n("有删除用户权限可见")])),_:1})):x("",!0),s(o,{type:"error",onClick:m},{default:e(()=>t[2]||(t[2]=[n("没有删除列表权限")])),_:1})]),_:1})]),_:1}),s(l,{bordered:!1,title:"指令判断",class:"mt-3 proCard",size:"small",segmented:{content:!0}},{default:e(()=>[s(i,null,{default:e(()=>[c((a(),r(o,{type:"error"},{default:e(()=>t[3]||(t[3]=[n("没有删除列表权限禁用")])),_:1})),[[f,{action:["delete_list"],effect:"disabled"}]]),c((a(),r(o,{type:"error"},{default:e(()=>t[4]||(t[4]=[n("没有删除列表权限隐藏")])),_:1})),[[f,{action:["delete_list"]}]])]),_:1})]),_:1}),s(l,{bordered:!1,title:"组件判断",class:"mt-3 proCard",size:"small",segmented:{content:!0}},{default:e(()=>[s(i,null,{default:e(()=>[s(p,{value:["delete_user"]},{default:e(()=>[s(o,{type:"success",onClick:d},{default:e(()=>t[5]||(t[5]=[n("有删除用户权限可见")])),_:1})]),_:1}),s(p,{value:["delete_list"]},{default:e(()=>[s(o,{type:"error",onClick:d},{default:e(()=>t[6]||(t[6]=[n("没有删除列表权限隐藏")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}}});export{j as default};
