/* empty css             *//* empty css                   */import{_ as e}from"./index-ec277c8c.js";/* empty css                        *//* empty css                    *//* empty css               */import"./el-tooltip-4ed993c7.js";/* empty css                     */import{_ as s}from"./destroy.vue_vue_type_script_setup_true_lang-80684085.js";import{_ as a}from"./update.vue_vue_type_script_setup_true_lang-2f3455ac.js";import{_ as t}from"./index.vue_vue_type_script_setup_true_lang-f20025cf.js";/* empty css                   *//* empty css                  */import{_ as o}from"./index-b347df0b.js";import{_ as r}from"./operate.vue_vue_type_script_setup_true_lang-6b1c85b1.js";import{_ as l}from"./search.vue_vue_type_script_setup_true_lang-8a36466d.js";/* empty css                     *//* empty css                 */import{_ as i}from"./create.vue_vue_type_script_setup_true_lang-84c5d76a.js";import{u as p}from"./useGetList-33a80877.js";import{u as n}from"./useDestroy-f8db9248.js";import{u}from"./useOpen-ae3f1df9.js";import{d as m,n as d,z as _,q as c,o as j,c as f,a as v,w as h,f as y,e as b,Z as w,l as g,F as k,p as C,b as x,t as V,ag as U,A as q,a9 as A,ac as E,a5 as G,a6 as P,aa as R,ah as z,ai as F,ab as L,a2 as N}from"./index-545c1a76.js";/* empty css                  *//* empty css                   *//* empty css                  */import"./add.vue_vue_type_script_setup_true_lang-90917888.js";/* empty css                 *//* empty css                          *//* empty css                        */import"./index.vue_vue_type_script_setup_true_lang-b011ebfe.js";/* empty css                  *//* empty css                       *//* empty css                        */import"./useCreate-4cdcc37e.js";import"./useShow-897a1bd7.js";const O={class:"table-default"},S={key:0,class:"flex grid gap-1 grid-cols-4"},Y={key:1},Z=m({__name:"index",setup(m){const Z="permissions/permissions",{data:D,query:H,search:I,reset:J,loading:K}=p(Z,!1),{destroy:M,deleted:Q}=n(),{open:T,close:W,title:X,visible:B,id:$}=u(),ee=d((()=>{var e;return null==(e=D.value)?void 0:e.data}));_((()=>{I(),Q(J)}));const se=c(!1);return(p,n)=>{const u=G,m=P,d=l,_=r,c=R,D=z,Q=o,ae=F,te=t,oe=a,re=s,le=L,ie=e,pe=N;return j(),f("div",null,[v(d,{search:y(I),reset:y(J)},{body:h((()=>[v(m,{label:"菜单名称",prop:"permission_name"},{default:h((()=>[v(u,{modelValue:y(H).permission_name,"onUpdate:modelValue":n[0]||(n[0]=e=>y(H).permission_name=e),name:"permission_name",clearable:""},null,8,["modelValue"])])),_:1})])),_:1},8,["search","reset"]),b("div",O,[v(_,{show:y(T)},null,8,["show"]),w((j(),g(le,{data:y(ee),class:"mt-3","row-key":"id","default-expand-all":"","tree-props":{children:"children"}},{default:h((()=>[v(c,{prop:"permission_name",label:"菜单名称"}),v(c,{prop:"route",label:"菜单路由"}),v(c,{prop:"permission_mark",label:"权限标识",width:"330"},{default:h((e=>[e.row.actions.length?(j(),f("div",S,[(j(!0),f(k,null,C(e.row.actions,(e=>(j(),g(D,{class:"cursor-pointer min-w-fit",onClick:s=>y(T)(e.id),closable:"",onClose:s=>y(M)(Z,e.id)},{default:h((()=>[x(V(e.permission_name),1)])),_:2},1032,["onClick","onClose"])))),256))])):(j(),f("div",Y,[v(ae,{"confirm-button-text":"确认",title:"添加基础actions",onConfirm:s=>(async e=>{se.value=!0,E.post(Z,{parent_id:e,actions:!0}).then((e=>{I(),se.value=!1}))})(e.row.id),placement:"top"},{reference:h((()=>[e.row.type===y(U).PAGE_TYPE?(j(),g(D,{key:0,class:"cursor-pointer w-8"},{default:h((()=>[se.value?(j(),g(Q,{key:0,name:"cog-6-tooth",class:"animate-spin w-5 h-5"})):(j(),g(Q,{key:1,name:"plus",className:"w-4 h-4"}))])),_:1})):q("",!0)])),_:2},1032,["onConfirm"])]))])),_:1}),v(c,{prop:"hidden",label:"状态",width:"100"},{default:h((e=>[v(te,{modelValue:e.row.hidden,"onUpdate:modelValue":s=>e.row.hidden=s,id:e.row.id,api:Z,onRefresh:y(I)},null,8,["modelValue","onUpdate:modelValue","id","onRefresh"])])),_:1}),v(c,{prop:"created_at",label:"创建时间"}),v(c,{label:"操作",width:"200"},{default:h((e=>[v(oe,{onClick:s=>y(T)(e.row.id)},null,8,["onClick"]),v(re,{onClick:s=>y(M)(Z,e.row.id)},null,8,["onClick"])])),_:1})])),_:1},8,["data"])),[[pe,y(K)]])]),v(ie,{modelValue:y(B),"onUpdate:modelValue":n[2]||(n[2]=e=>A(B)?B.value=e:null),title:y(X),"destroy-on-close":""},{default:h((()=>[v(i,{onClose:n[1]||(n[1]=e=>y(W)(y(J))),primary:y($),api:Z},null,8,["primary"])])),_:1},8,["modelValue","title"])])}}});export{Z as default};
