|
- import L from"./menuDialog-666c4dab.js";import{g as M,m as j}from"./menuManage-d68f1902.js";import{a as _,r as b,o as E,b as s,c as I,d as R,f as a,h as l,i as g,e as p,F as S,k as W,s as A}from"./index-dd5fae99.js";const G={class:"flex justify-between items-center"},U=["onClick"],q=["onClick"],H=W({name:"menuManage"}),Y=Object.assign(H,{setup(J){const{proxy:h}=A(),r=_({title:void 0}),C=_([{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:"120",fixed:"right"}]),c=b(),D=b(0),u=b([]),d=async(n=c.value.pageParams)=>{const e=await M({...r});u.value=e.data},x=()=>{u.value=v(u.value,r.title)},v=(n,e)=>n.map(t=>(t&&t.children&&(t.children=v(t.children,e)),t)).filter(t=>{var o;return e===""||t.title.indexOf(e)>-1||((o=t.children)==null?void 0:o.length)>0}),V=()=>{r.title=void 0,c.value.pageParams.pageNumber=1,c.value.pageParams.pageSize=10,d()},i=_({visible:!1,rowData:void 0}),P=()=>{i.visible=!0,i.rowData=void 0},$=n=>{i.visible=!0,i.rowData=n},w=n=>{const e=[];return n.forEach(t=>{var o;(o=t.children)!=null&&o.length&&w(t.children),e.push(t.id)}),e},B=n=>{const e=w([n]);h.$messageBox.confirm("是否删除该数据?","提示!",{type:"warning"}).then(async()=>{await j(e),h.$message.success("删除成功!"),d()})},N=n=>{i.visible=!1,n&&d()};return E(()=>{d()}),(n,e)=>{const t=s("el-input"),o=s("el-form-item"),y=s("el-col"),f=s("el-button"),O=s("el-row"),T=s("el-form"),k=s("el-card"),z=s("table-list");return I(),R(S,null,[a(k,{shadow:"never",class:"search mb-16"},{default:l(()=>[a(T,{"label-suffix":":",model:r,size:"small"},{default:l(()=>[a(O,{gutter:16},{default:l(()=>[a(y,{span:8},{default:l(()=>[a(o,{label:"菜单名称"},{default:l(()=>[a(t,{modelValue:r.title,"onUpdate:modelValue":e[0]||(e[0]=m=>r.title=m),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),a(y,{span:16},{default:l(()=>[a(o,{class:"btn"},{default:l(()=>[a(f,{type:"primary",onClick:x},{default:l(()=>e[1]||(e[1]=[g("查询")])),_:1}),a(f,{onClick:V},{default:l(()=>e[2]||(e[2]=[g("重置")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a(k,{shadow:"never"},{header:l(()=>[p("div",G,[e[4]||(e[4]=p("span",null,"菜单列表",-1)),a(f,{type:"primary",icon:"Plus",size:"small",onClick:P},{default:l(()=>e[3]||(e[3]=[g(" 新增菜单 ")])),_:1})])]),default:l(()=>[a(z,{ref_key:"tableListRef",ref:c,column:C,data:u.value,total:D.value,"row-key":"id",pagination:!1,onGetTableData:d},{action:l(({scope:m})=>[p("a",{class:"text-primary",onClick:F=>$(m.row)},"编辑",8,U),p("a",{class:"text-danger",onClick:F=>B(m.row)},"删除",8,q)]),_:1},8,["column","data","total"])]),_:1}),a(L,{visible:i.visible,data:i.rowData,onClose:N},null,8,["visible","data"])],64)}}});export{Y as default};
|