const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.yBioDgie.js","assets/index.lP_uh0LI.js","assets/vue.BxlDVA1H.js","assets/index.TG7KVPIy.css","assets/crud.Zcvpp6Ix.js"])))=>i.map(i=>d[i]);
import{a as T,b as P,c as F,_ as I,X as p,I as M,E as O,R as X}from"./index.lP_uh0LI.js";import{d as $,a as b,c as q,b as r,h as L,f as Q,w as e,g as t,n as j,u as a,z as G,l as i,E as H,A as h,Q as J,s as K}from"./vue.BxlDVA1H.js";import{r as W,c as Y}from"./crud.aSyxpBWX.js";import{a as Z}from"./authFunction.z5AMEiSQ.js";import{R as ee}from"./RoleUserStores.BX1sB-X_.js";const ce=$({__name:"index",setup(te,{expose:R}){const d=ee(),w=J(()=>I(()=>import("./index.yBioDgie.js"),__vite__mapDeps([0,1,2,3,4]))),m=b(),x=()=>{n.doRefresh()},y=b(!1),k=l=>{o.value=[],l()},u=q(()=>o.value.length),C=l=>{const s=n.getBaseTableRef(),_=n.getTableData();p.pluck(_,"id").includes(l.id)?s.toggleRowSelection(l,!1):o.value=p.remove(o.value,c=>c.id!==l.id)},D=async()=>{if(o.value.length<1){M("请先勾选用户");return}await O.confirm(`确定要删除这 “${o.value.length}” 位用户的权限吗`,"确认");const l=await W(g.value.getSearchFormData().role_id,p.pluck(o.value,"id"));o.value=[],X(l.msg),n.doRefresh()},{crudBinding:V,crudRef:g,crudExpose:n,selectedRows:o}=T({createCrudOptions:Y,context:{subUserRef:m}}),{setSearchFormData:U,doRefresh:E}=n;return R({drawer:y,setSearchFormData:U,doRefresh:E}),(l,s)=>{const _=r("el-tag"),c=r("el-button"),v=r("el-table-column"),S=r("el-table"),B=r("el-popover"),z=r("el-tooltip"),A=r("fs-crud"),N=r("el-drawer");return Q(),L(N,{size:"70%",modelValue:a(d).drawerVisible,"onUpdate:modelValue":s[0]||(s[0]=f=>a(d).drawerVisible=f),direction:"rtl","destroy-on-close":"","before-close":k},{header:e(()=>[K("div",null,[s[1]||(s[1]=i(" 当前授权角色： ")),t(_,null,{default:e(()=>[i(h(a(d).role_name),1)]),_:1})])]),default:e(()=>[t(A,j({ref_key:"crudRef",ref:g},a(V)),{"pagination-right":e(()=>[t(B,{placement:"top",width:200,trigger:"click"},{reference:e(()=>[t(c,{text:"",type:u.value>0?"primary":""},{default:e(()=>[i("已选中"+h(u.value)+"条数据",1)]),_:1},8,["type"])]),default:e(()=>[t(S,{data:a(o),size:"small","max-height":500},{default:e(()=>[t(v,{width:"100",property:"name",label:"用户名"}),t(v,{fixed:"right",label:"操作","min-width":"60"},{default:e(f=>[t(c,{text:"",type:"info",icon:a(F),onClick:oe=>C(f.row),circle:""},null,8,["icon","onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),"pagination-left":e(()=>[t(z,{content:"批量删除所选择的用户权限"},{default:e(()=>[G(t(c,{type:"danger",onClick:D,icon:a(P)},{default:e(()=>s[2]||(s[2]=[i("批量删除")])),_:1,__:[2]},8,["icon"]),[[H,u.value>0&&a(Z)("role:AuthorizedDel")]])]),_:1})]),_:1},16),t(a(w),{ref_key:"subUserRef",ref:m,refreshCallback:x},null,512)]),_:1},8,["modelValue"])}}});export{ce as default};
