import{_ as e,q as n,m as l,r as t,v as o,x as a,y as s,c as i,b as d,j as c,w as r,z as u,k as p,F as f,n as m,s as h,d as b,p as v,i as y,l as I}from"./index-DuyQv-rd.js";const x=n({components:{"vol-element-menu-child":VolElementMenuChild},props:{enable:{type:Boolean,default:!1},isCollapse:{type:Boolean,default:!1},onSelect:{type:Function,default:e=>{}},openSelect:{type:Boolean,default:!0},list:{type:Array,default:[]},rootId:{type:String,default:"0"},currentMenuId:{type:Number,default:0}},setup(e){const n=(e,l,t)=>{l.children||(l.children=[]),t.forEach((o=>{o.parentId!=e||l.children.some((e=>e.id===o.id))||(l.children.push(o),n(o.id,o,t))}))};let i=isNaN(e.rootId)?e.rootId:~~e.rootId;e.list.forEach((e=>{e.icon&&"el-"==e.icon.substring(0,3)||(e.icon="el-icon-menu"),e.children=[],e.isRoot=e.parentId===i}));const d=l([e.currentMenuId]),c=t(e.currentMenuId+"/");let r=o().appContext.config.globalProperties.base;a((()=>e.currentMenuId),((n,l)=>{c.value=n+"",d.splice(0),d.push(...r.getTreeAllParent(n,e.list).map((e=>e.id)))}));const u=s();let p=!1;const f=(n,l)=>{if(p)return;p=!0,setTimeout((()=>{p=!1}),20);let t=e.list.find((e=>e.id==n));e.onSelect(n,t),u.push({path:t.path||""})};return{select:f,convertTree:e=>{var l=[];return e.forEach((t=>{t.parentId===i&&(t.hasOwnProperty("enable")||(t.enable=1),l.push(t),n(t.id,t,e))})),l},handleOpen:(n,l)=>{e.openSelect&&f(n)},handleClose:()=>{},bindRightClickMenu:e=>{},openedIds:d,defaultActive:c}}}),C={class:"vol-el-menu"},g={style:{"font-size":"0.88rem","font-weight":"500"}},k={style:{"font-size":"0.88rem","font-weight":"500"}};const M=e(x,[["render",function(e,n,l,t,o,a){const s=p("vol-element-menu-child"),x=p("el-sub-menu"),M=p("el-menu-item"),S=p("el-menu");return d(),i("div",C,[c(S,{"background-color":"#242424",close:"vol-el-menu--vertical","default-openeds":e.openedIds,"default-active":e.defaultActive,"unique-opened":!0,onSelect:e.select,collapse:e.isCollapse,onOpen:e.handleOpen,onClose:e.handleClose,onContextmenu:u(e.bindRightClickMenu,["prevent"]),"text-color":"#fff","active-text-color":"#fff"},{default:r((()=>[(d(!0),i(f,null,m(e.convertTree(e.list),(n=>(d(),i(f,null,[!n.children.length||e.enable&&1!=n.enable?(d(),i(f,{key:1},[e.enable&&1!=n.enable?I("",!0):(d(),h(M,{class:"menu-item-lv1",key:n.id,index:""+n.id},{default:r((()=>[b("i",{style:{"font-size":"1.13rem"},class:v(n.icon)},null,2),b("span",k,y(n.name),1)])),_:2},1032,["index"]))],64)):(d(),h(x,{key:n.id,index:""+n.id},{title:r((()=>[b("i",{class:v(["menu-icon",n.icon])},null,2),b("span",g,y(n.name),1)])),default:r((()=>[c(s,{enable:e.enable,list:n.children},null,8,["enable","list"])])),_:2},1032,["index"]))],64)))),256))])),_:1},8,["default-openeds","default-active","onSelect","collapse","onOpen","onClose","onContextmenu"])])}],["__scopeId","data-v-1399d470"]]);export{M as V};
