/* empty css             *//* empty css                   */import{_ as e}from"./index-9f9af49f.js";/* empty css                        *//* empty css                    *//* empty css               */import"./el-tooltip-4ed993c7.js";/* empty css                  *//* empty css                     */import{_ as s}from"./destroy.vue_vue_type_script_setup_true_lang-150648af.js";import{_ as a}from"./update.vue_vue_type_script_setup_true_lang-6ca4c467.js";import{_ as o}from"./index.vue_vue_type_script_setup_true_lang-efc92764.js";/* empty css                   *//* empty css                  */import{_ as t}from"./index-44ccf907.js";import{_ as r}from"./operate.vue_vue_type_script_setup_true_lang-13d1e748.js";import{_ as l}from"./search.vue_vue_type_script_setup_true_lang-72910575.js";/* empty css                     *//* empty css                 */import{_ as i}from"./create.vue_vue_type_script_setup_true_lang-dabafc30.js";import{u as p}from"./useGetList-07470d8e.js";import{u as n}from"./useDestroy-9187955f.js";import{u as m}from"./useOpen-0461a747.js";import{d as u,p as d,x as _,m as c,o as j,c as f,a as v,w as y,f as h,e as w,X as b,l as g,F as k,y as x,b as C,t as V,ae as U,z as E,a7 as P,aa as R,a3 as q,a4 as A,a8 as F,af as G,ag as L,a9 as N,a0 as O}from"./index-0ffeeea6.js";/* empty css                  *//* empty css                   *//* empty css                  */import"./add.vue_vue_type_script_setup_true_lang-cf082d7f.js";/* empty css                 *//* empty css                      *//* empty css                  *//* empty css                          *//* empty css                        */import"./index.vue_vue_type_script_setup_true_lang-2c955b64.js";/* empty css                       *//* empty css                        */import"./useCreate-74e0ef9a.js";import"./useShow-02d4fd72.js";const S={class:"table-default"},T={key:0},X={key:1},Y=u({__name:"index",setup(u){const Y="permissions/permissions",{data:z,query:D,search:K,reset:M,loading:Q}=p(Y,!1),{destroy:W,deleted:B}=n(),{open:H,close:I,title:J,visible:Z,id:$}=m(),ee=d((()=>{var e;return null==(e=z.value)?void 0:e.data}));_((()=>{K(),B(M)}));const se=c(!1);return(p,n)=>{const m=q,u=A,d=l,_=r,c=F,z=G,B=t,ae=L,oe=o,te=a,re=s,le=N,ie=e,pe=O;return j(),f("div",null,[v(d,{search:h(K),reset:h(M)},{body:y((()=>[v(u,{label:"菜单名称",prop:"permission_name"},{default:y((()=>[v(m,{modelValue:h(D).permission_name,"onUpdate:modelValue":n[0]||(n[0]=e=>h(D).permission_name=e),name:"permission_name",clearable:""},null,8,["modelValue"])])),_:1})])),_:1},8,["search","reset"]),w("div",S,[v(_,{show:h(H)},null,8,["show"]),b((j(),g(le,{data:h(ee),class:"mt-3","row-key":"id","default-expand-all":!1,"tree-props":{children:"children"}},{default:y((()=>[v(c,{prop:"permission_name",label:"菜单名称"}),v(c,{prop:"route",label:"菜单路由"}),v(c,{prop:"permission_mark",label:"权限标识",width:"360"},{default:y((e=>[e.row.actions.length?(j(),f("div",T,[(j(!0),f(k,null,x(e.row.actions,(e=>(j(),g(z,{key:e.id,class:"mb-3 mr-3 cursor-pointer w-fit min-w-fit",onClick:s=>h(H)(e.id),closable:"",onClose:s=>h(W)(Y,e.id)},{default:y((()=>[C(V(e.permission_name),1)])),_:2},1032,["onClick","onClose"])))),128))])):(j(),f("div",X,[v(ae,{"confirm-button-text":"确认",title:"添加基础actions",onConfirm:s=>(async e=>{se.value=!0,R.post(Y,{parent_id:e,actions:!0}).then((e=>{K(),se.value=!1}))})(e.row.id),placement:"top"},{reference:y((()=>[w("span",null,[e.row.type===h(U).PAGE_TYPE?(j(),g(z,{key:0,class:"w-8 cursor-pointer"},{default:y((()=>[se.value?(j(),g(B,{key:0,name:"cog-6-tooth",class:"w-5 h-5 animate-spin"})):(j(),g(B,{key:1,name:"plus",className:"w-4 h-4"}))])),_:1})):E("",!0)])])),_:2},1032,["onConfirm"])]))])),_:1}),v(c,{prop:"hidden",label:"状态",width:"100"},{default:y((e=>[v(oe,{modelValue:e.row.hidden,"onUpdate:modelValue":s=>e.row.hidden=s,id:e.row.id,api:Y,onRefresh:h(K)},null,8,["modelValue","onUpdate:modelValue","id","onRefresh"])])),_:1}),v(c,{prop:"created_at",label:"创建时间"}),v(c,{label:"操作",width:"200"},{default:y((e=>[v(te,{onClick:s=>h(H)(e.row.id)},null,8,["onClick"]),v(re,{onClick:s=>h(W)(Y,e.row.id)},null,8,["onClick"])])),_:1})])),_:1},8,["data"])),[[pe,h(Q)]])]),v(ie,{modelValue:h(Z),"onUpdate:modelValue":n[2]||(n[2]=e=>P(Z)?Z.value=e:null),title:h(J),"destroy-on-close":""},{default:y((()=>[v(i,{onClose:n[1]||(n[1]=e=>h(I)(h(M))),primary:h($),api:Y},null,8,["primary"])])),_:1},8,["modelValue","title"])])}}});export{Y as default};
