var M=Object.defineProperty;var h=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var y=(s,t,e)=>t in s?M(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,C=(s,t)=>{for(var e in t||(t={}))B.call(t,e)&&y(s,e,t[e]);if(h)for(var e of h(t))E.call(t,e)&&y(s,e,t[e]);return s};var v=(s,t,e)=>new Promise((b,c)=>{var i=l=>{try{a(e.next(l))}catch(o){c(o)}},f=l=>{try{a(e.throw(l))}catch(o){c(o)}},a=l=>l.done?b(l.value):Promise.resolve(l.value).then(i,f);a((e=e.apply(s,t)).next())});import{_ as N}from"./menu-drawer.vue_vue_type_script_name_menuDrawer_setup_true_lang-232e7391.js";import{l as O,d as T}from"./menu-manage-faee0c27.js";import{d as V,r as k,G as j,M as G,a as L,j as p,o as R,h as W,w as _,e as m,b as u,k as P,$ as q,E as z}from"./index-90c78f99.js";import"./useCurrentInstance-cd4729ef.js";const A={class:"flex justify-between items-center"},F=u("span",null,"菜单列表",-1),H=["onClick"],I=["onClick"],J=["onClick"],Y=V({__name:"index",setup(s){const t=[{label:"菜单名称",key:"title",prop:"title",minWidth:"200"},{label:"排序",key:"sort",prop:"sort"},{label:"图标",key:"icon",prop:"icon"},{label:"页面路径",key:"path",prop:"path",minWidth:"200"},{label:"创建时间",key:"createOn",prop:"createOn",width:"180"},{label:"操作",slot:"action",width:"230",fixed:"right"}],e=k(),b=k(),c=k(),i=(...n)=>v(this,[...n],function*(o=c.value.pageParams){const d=yield O(C({},o));e.value=d.data||[],b.value=d.data&&d.data.total||0}),f=({id:o,title:n})=>{q.confirm(`确认删除${n}吗?`,"提示！",{type:"warning"}).then(()=>v(this,null,function*(){yield T([o]),i(),z.success("删除成功！")}))},a=j(new G(i)),l=(o,n)=>{a.visible=!0,n?a.data={id:o.id,type:n}:a.data=o};return L(()=>{i()}),(o,n)=>{const d=p("page-title"),g=p("el-button"),x=p("table-list"),D=p("el-card"),$=p("views");return R(),W($,null,{default:_(()=>[m(d),m(D,{class:"my-card",shadow:"never"},{header:_(()=>[u("div",A,[F,m(g,{icon:"plus",plain:"",type:"primary",onClick:n[0]||(n[0]=r=>a.visible=!0)},{default:_(()=>[P(" 添加菜单 ")]),_:1})])]),default:_(()=>[m(x,{ref_key:"tableListRef",ref:c,column:t,"row-key":"id",data:e.value,total:b.value,pagination:!1,onGetTableData:i},{action:_(({scope:r})=>[u("a",{class:"btn text-primary mr-24",onClick:w=>l(r.row,"childMenu")}," 添加子菜单 ",8,H),u("a",{class:"btn text-primary mr-24",onClick:w=>l(r.row)}," 编辑 ",8,I),u("a",{class:"btn text-danger",onClick:w=>f(r.row)},"删除",8,J)]),_:1},8,["data","total"])]),_:1}),m(N,{visible:a.visible,data:a.data||{},onClose:n[1]||(n[1]=r=>a.close(r))},null,8,["visible","data"])]),_:1})}}});export{Y as default};
