import{_ as e}from"./index-7266ee79.js";import{_ as s}from"./destroy.vue_vue_type_script_setup_true_lang-03aacc43.js";import{_ as a}from"./update.vue_vue_type_script_setup_true_lang-34cf7a97.js";import{_ as t}from"./index.vue_vue_type_script_setup_true_lang-5d221a19.js";import{_ as o}from"./index-765bf96c.js";import{_ as l}from"./operate.vue_vue_type_script_setup_true_lang-b52831fd.js";import{_ as r}from"./search.vue_vue_type_script_setup_true_lang-bbdf4bb9.js";import{_ as i}from"./create.vue_vue_type_script_setup_true_lang-b47f32b0.js";import{u as n}from"./useGetList-4b13a7ea.js";import{u as p}from"./useDestroy-7132f8f0.js";import{u}from"./useOpen-280ec4e6.js";import{d as _,m as d,p as m,k as c,r as f,K as v,o as y,c as h,a as w,w as b,f as j,e as k,J as g,j as C,F as V,q as x,b as U,t as R,S as E,s as P,Q as S,R as q}from"./index-018fb6dd.js";import"./add.vue_vue_type_script_setup_true_lang-9cf41186.js";import"./index.vue_vue_type_script_setup_true_lang-7071596f.js";import"./useCreate-b3492f2b.js";import"./useShow-ca493df3.js";const G={class:"table-default"},L={key:0},N={key:1},O=_({__name:"index",setup(_){const O="permissions/permissions",{data:Q,query:T,search:A,reset:D,loading:F}=n(O,!1),{destroy:J,deleted:K}=p(),{open:M,close:W,title:Y,visible:Z,id:z}=u(),B=d((()=>{var e;return null==(e=Q.value)?void 0:e.data}));m((()=>{A(),K(D)}));const H=c(!1);return(n,p)=>{const u=f("el-input"),_=f("el-form-item"),d=r,m=l,c=f("el-table-column"),Q=f("el-tag"),K=o,I=f("el-popconfirm"),X=t,$=a,ee=s,se=f("el-table"),ae=e,te=v("loading");return y(),h("div",null,[w(d,{search:j(A),reset:j(D)},{body:b((()=>[w(_,{label:"菜单名称",prop:"permission_name"},{default:b((()=>[w(u,{modelValue:j(T).permission_name,"onUpdate:modelValue":p[0]||(p[0]=e=>j(T).permission_name=e),name:"permission_name",clearable:""},null,8,["modelValue"])])),_:1})])),_:1},8,["search","reset"]),k("div",G,[w(m,{show:j(M)},null,8,["show"]),g((y(),C(se,{data:j(B),class:"mt-3","row-key":"id","default-expand-all":"","tree-props":{children:"children"}},{default:b((()=>[w(c,{prop:"permission_name",label:"菜单名称"}),w(c,{prop:"route",label:"菜单路由"}),w(c,{prop:"permission_mark",label:"权限标识",width:"360"},{default:b((e=>[e.row.actions.length?(y(),h("div",L,[(y(!0),h(V,null,x(e.row.actions,(e=>(y(),C(Q,{class:"mb-3 mr-3 cursor-pointer w-fit min-w-fit",onClick:s=>j(M)(e.id),closable:"",onClose:s=>j(J)(O,e.id)},{default:b((()=>[U(R(e.permission_name),1)])),_:2},1032,["onClick","onClose"])))),256))])):(y(),h("div",N,[w(I,{"confirm-button-text":"确认",title:"添加基础actions",onConfirm:s=>(async e=>{H.value=!0,q.post(O,{parent_id:e,actions:!0}).then((e=>{A(),H.value=!1}))})(e.row.id),placement:"top"},{reference:b((()=>[e.row.type===j(E).PAGE_TYPE?(y(),C(Q,{key:0,class:"w-8 cursor-pointer"},{default:b((()=>[H.value?(y(),C(K,{key:0,name:"cog-6-tooth",class:"w-5 h-5 animate-spin"})):(y(),C(K,{key:1,name:"plus",className:"w-4 h-4"}))])),_:1})):P("",!0)])),_:2},1032,["onConfirm"])]))])),_:1}),w(c,{prop:"hidden",label:"状态",width:"100"},{default:b((e=>[w(X,{modelValue:e.row.hidden,"onUpdate:modelValue":s=>e.row.hidden=s,id:e.row.id,api:O,onRefresh:j(A)},null,8,["modelValue","onUpdate:modelValue","id","onRefresh"])])),_:1}),w(c,{prop:"created_at",label:"创建时间"}),w(c,{label:"操作",width:"200"},{default:b((e=>[w($,{onClick:s=>j(M)(e.row.id)},null,8,["onClick"]),w(ee,{onClick:s=>j(J)(O,e.row.id)},null,8,["onClick"])])),_:1})])),_:1},8,["data"])),[[te,j(F)]])]),w(ae,{modelValue:j(Z),"onUpdate:modelValue":p[2]||(p[2]=e=>S(Z)?Z.value=e:null),title:j(Y),"destroy-on-close":""},{default:b((()=>[w(i,{onClose:p[1]||(p[1]=e=>j(W)(j(D))),primary:j(z),api:O},null,8,["primary"])])),_:1},8,["modelValue","title"])])}}});export{O as default};
