import{d as B,O as M,n as N,r as $,h as l,c as u,e as n,w as o,a as h,t as i,u as t,i as c,N as e,y as V,I as d,B as _,a8 as j,E as z,ah as F,aw as I,aj as L,$ as O,a0 as R}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css */import{_ as S}from"./index.vue_vue_type_script_setup_true_lang-9285296e.js";/* empty css */import{a as q,d as A}from"./sys-8ead7f22.js";import{_ as G}from"./edit-menu.vue_vue_type_script_setup_true_lang-38bd25dd.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index-2d277c91.js";import"./index.vue_vue_type_style_index_0_lang-5c6c00d9.js";import"./attachment-c69dd9fd.js";/* empty css */import"./el-form-item-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./tools-123d2a10.js";const H={class:"main-container"},J={class:"flex justify-between items-center mb-[20px]"},K={class:"text-[20px]"},P={key:0},Q={key:1},U={key:2},Fe=B({__name:"menu",setup(W){const b=M().meta.title,s=N({loading:!0,data:[]}),y=()=>{s.loading=!0,q("admin").then(m=>{s.loading=!1,s.data=m.data}).catch(()=>{})};y();const p=$(null),v=()=>{p.value.setFormData({app_type:"admin"}),p.value.showDialog=!0},k=m=>{p.value.setFormData(m),p.value.showDialog=!0},w=m=>{j.confirm(e("menuDeleteTips"),e("warning"),{confirmButtonText:e("confirm"),cancelButtonText:e("cancel"),type:"warning"}).then(()=>{A("admin",m).then(()=>{y()}).catch(()=>{})})};return(m,Y)=>{const f=z,r=F,x=S,g=I,D=L,T=O,C=R;return l(),u("div",H,[n(T,{class:"box-card !border-none",shadow:"never"},{default:o(()=>[h("div",J,[h("span",K,i(t(b)),1),n(f,{type:"primary",class:"w-[100px]",onClick:v},{default:o(()=>[c(i(t(e)("addMenu")),1)]),_:1})]),V((l(),d(D,{data:s.data,"row-key":"menu_key",size:"large"},{empty:o(()=>[h("span",null,i(s.loading?"":t(e)("emptyData")),1)]),default:o(()=>[n(r,{prop:"menu_name","show-overflow-tooltip":!0,label:t(e)("menuName"),"min-width":"150"},null,8,["label"]),n(r,{label:t(e)("icon"),width:"100",align:"center"},{default:o(({row:a})=>[a.icon?(l(),d(x,{key:0,name:a.icon,size:"18px"},null,8,["name"])):_("",!0)]),_:1},8,["label"]),n(r,{label:t(e)("menuType"),width:"80"},{default:o(({row:a})=>[a.menu_type==0?(l(),u("div",P,i(t(e)("menuTypeDir")),1)):a.menu_type==1?(l(),u("div",Q,i(t(e)("menuTypeMenu")),1)):a.menu_type==2?(l(),u("div",U,i(t(e)("menuTypeButton")),1)):_("",!0)]),_:1},8,["label"]),n(r,{prop:"api_url",label:t(e)("authId"),"min-width":"150",align:"center"},null,8,["label"]),n(r,{label:t(e)("status"),"min-width":"120",align:"center"},{default:o(({row:a})=>[a.status==1?(l(),d(g,{key:0,class:"ml-2",type:"success"},{default:o(()=>[c(i(t(e)("statusNormal")),1)]),_:1})):_("",!0),a.status==0?(l(),d(g,{key:1,class:"ml-2",type:"error"},{default:o(()=>[c(i(t(e)("statusDeactivate")),1)]),_:1})):_("",!0)]),_:1},8,["label"]),n(r,{prop:"sort",label:t(e)("sort"),"min-width":"100"},null,8,["label"]),n(r,{label:t(e)("operation"),align:"right",fixed:"right",width:"130"},{default:o(({row:a})=>[n(f,{type:"primary",link:"",onClick:E=>k(a)},{default:o(()=>[c(i(t(e)("edit")),1)]),_:2},1032,["onClick"]),n(f,{type:"primary",link:"",onClick:E=>w(a.menu_key)},{default:o(()=>[c(i(t(e)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[C,s.loading]]),n(G,{ref_key:"editMenuDialog",ref:p,"menu-tree":s.data,onComplete:y,"app-type":"admin"},null,8,["menu-tree"])]),_:1})])}}});export{Fe as default};