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