import{c as N,G as P}from"./crud.RJQIgBtm.js";import{C as V,O as b}from"./index.fM6cvGYs.js";import"./elementPlus.CXoFsoPv.js";import k from"./index.DLGRziJM.js";import{d as F,r as l,j as R,ai as c,o as B,M as I,O as f,U as m,S as O,T as S,K as q,u as p,D as G}from"./vue.1RczIYhx.js";import"./dictionary.DYQ_oUgW.js";import"./authFunction.VC7PaOWG.js";import"./_plugin-vue_export-helper.DlAUqK2U.js";const M=async(_,r,n=[])=>{const t=await _();r.pagination==null&&(r.pagination={show:!0});const o=r.columns,a=["_index","id","create_datetime","update_datetime"].concat(n);for(let e in o)if(!a.includes(e)){o[e].column?o[e].column.show=!1:o[e].column={show:!1},o[e].addForm={show:!1},o[e].editForm={show:!1};for(let s of t.data)a.includes(s.field_name)||s.field_name===e&&(o[e].column.show=s.is_query,s.is_query||(o[e].column.columnSetDisabled=!0),o[e].addForm={show:s.is_create},o[e].editForm={show:s.is_update})}return r},J=F({__name:"index",setup(_,{expose:r}){let n=l(!1),t=l(null),o=l(null);const a=l(),e=l(),s=l(),C=d=>{t.value=d.id,o.value=d.name,n.value=!0},x=()=>{n.value=!1},{crudExpose:u}=V({crudRef:e,crudBinding:s}),{crudOptions:w}=N({crudExpose:u,rolePermission:a,handleDrawerOpen:C});return b({crudExpose:u,crudOptions:w,context:{}}),R(async()=>{await M(P,w),u.doRefresh()}),r(a),(d,h)=>{const g=c("el-tag"),v=c("fs-crud"),y=c("permission"),D=c("fs-page");return B(),I(D,null,{default:f(()=>[m(v,q({ref_key:"crudRef",ref:e},s.value),{cell_url:f(i=>[m(g,{size:"small"},{default:f(()=>[O(S(i.row.url),1)]),_:2},1024)]),_:1},16),m(y,{ref_key:"rolePermission",ref:a},null,512),m(k,{drawerVisible:p(n),"onUpdate:drawerVisible":h[0]||(h[0]=i=>G(n)?n.value=i:n=i),roleId:p(t),roleName:p(o),onDrawerClose:x},null,8,["drawerVisible","roleId","roleName"])]),_:1})}}});export{J as default};
