import{m as e,r as n,f as l,v as t,x as o,_ as a,d as s,h as i,e as d,c,g as r,w as u,F as p,l as f,y as h,q as m,b,n as v,t as y,i as I}from"./index-vtcwYVzc.js";const g=e({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 a=(e,n,l)=>{n.children||(n.children=[]),l.forEach((t=>{t.parentId!=e||n.children.some((e=>e.id===t.id))||(n.children.push(t),a(t.id,t,l))}))};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=n([e.currentMenuId]),c=l(e.currentMenuId+"/");let r=t().appContext.config.globalProperties.base;o((()=>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 n=[];return e.forEach((l=>{l.parentId===i&&(l.hasOwnProperty("enable")||(l.enable=1),n.push(l),a(l.id,l,e))})),n},handleOpen:(n,l)=>{e.openSelect&&f(n)},handleClose:()=>{},bindRightClickMenu:e=>{},openedIds:d,defaultActive:c}}}),x={class:"vol-el-menu"},C={style:{"font-size":"0.88rem","font-weight":"500"}},M={style:{"font-size":"0.88rem","font-weight":"500"}};const S=a(g,[["render",function(e,n,l,t,o,a){const s=i("vol-element-menu-child"),g=i("el-sub-menu"),S=i("el-menu-item"),k=i("el-menu");return d(),c("div",x,[r(k,{"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:h(e.bindRightClickMenu,["prevent"]),"text-color":"#fff","active-text-color":"#fff"},{default:u((()=>[(d(!0),c(p,null,f(e.convertTree(e.list),(n=>(d(),c(p,null,[!n.children.length||e.enable&&1!=n.enable?(d(),c(p,{key:1},[e.enable&&1!=n.enable?I("",!0):(d(),m(S,{class:"menu-item-lv1",key:n.id,index:""+n.id},{default:u((()=>[b("i",{style:{"font-size":"1.13rem"},class:v(n.icon)},null,2),b("span",M,y(n.name),1)])),_:2},1032,["index"]))],64)):(d(),m(g,{key:n.id,index:""+n.id},{title:u((()=>[b("i",{class:v(["menu-icon",n.icon])},null,2),b("span",C,y(n.name),1)])),default:u((()=>[r(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{S as V};
