import{d as f,e as l,U as o,a2 as C,ad as A,af as n,k as t,a4 as r,G as s,a5 as a}from"./vue-vendor-CxLCUzY4.js";import{A as g}from"./antd-vue-vendor-CahNzUUa.js";import B from"./CurrentPermissionMode-COBLuPWN.js";import{U as D,ab as R,bw as p,_}from"./index-Cy4uayzW.js";import{P as S}from"./index-CRgSyMPH.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./useContentHeight-XU-h1taH.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./useContentViewHeight-Qm4QNm5l.js";import"./usePageContext-CXQdt-5h.js";import"./injectionKey-DPVn4AgL.js";const P=f({components:{Alert:g,CurrentPermissionMode:B,PageWrapper:S},setup(){const{changeRole:e}=D(),u=R();return{userStore:u,RoleEnum:p,isSuper:l(()=>u.getRoleList.includes(p.SUPER)),isTest:l(()=>u.getRoleList.includes(p.TEST)),changeRole:e}}}),y={class:"mt-4"};function T(e,u,b,k,U,$){const m=o("CurrentPermissionMode"),E=o("Alert"),i=o("a-button"),F=o("a-button-group"),d=o("PageWrapper");return C(),A(d,{title:"前端权限示例",contentBackground:"",contentClass:"p-4",content:"由于刷新的时候会请求用户信息接口，会根据接口重置角色信息，所以刷新后界面会恢复原样，如果不需要，可以注释 src/layout/default/index内的获取用户信息接口"},{default:n(()=>[t(m),r("p",null,[u[2]||(u[2]=s(" 当前角色: ")),r("a",null,a(e.userStore.getRoleList),1)]),t(E,{class:"mt-4",type:"info",message:"点击后请查看左侧菜单变化","show-icon":""}),r("div",y,[u[3]||(u[3]=s(" 权限切换(请先切换权限模式为前端角色权限模式): ")),t(F,null,{default:n(()=>[t(i,{onClick:u[0]||(u[0]=c=>e.changeRole(e.RoleEnum.SUPER)),type:e.isSuper?"primary":"default"},{default:n(()=>[s(a(e.RoleEnum.SUPER),1)]),_:1},8,["type"]),t(i,{onClick:u[1]||(u[1]=c=>e.changeRole(e.RoleEnum.TEST)),type:e.isTest?"primary":"default"},{default:n(()=>[s(a(e.RoleEnum.TEST),1)]),_:1},8,["type"])]),_:1})])]),_:1})}const z=_(P,[["render",T],["__scopeId","data-v-9819a855"]]);export{z as default};
