import{A as O,i as P,n as V,E as j,k as F}from"./index.8a64ecdf.js";import{d as R,r as N,ak as k,an as W,Q as q,k as G,v as K,j as Q,ar as U,a8 as i,o as r,c as d,M as a,G as l,F as L,$ as Y,E as y,a as C,L as m,u as J,a1 as X,K as g,W as S,am as Z,n as ee}from"./vue.95e072e2.js";import{_ as te}from"./_plugin-vue_export-helper.c27b6911.js";import"./elementPlus.58179425.js";import"./echarts.72dc8373.js";const ne={class:"el-menu-horizontal-warp"},se=R({name:"navMenuHorizontal"}),oe=R({...se,props:{menuList:{type:Array,default:()=>[]}},setup(v){const A=Z(()=>V(()=>import("./subItem.9c6b7c0e.js"),["assets/subItem.9c6b7c0e.js","assets/vue.95e072e2.js","assets/index.8a64ecdf.js","assets/elementPlus.58179425.js","assets/echarts.72dc8373.js","assets/index.c1001ae2.css"])),M=v,c=N(),$=O(),z=P(),{routesList:w}=k($),{themeConfig:p}=k(z),x=W(),u=q({defaultActive:""}),b=G(()=>M.menuList),D=n=>{const e=n.wheelDelta||-n.deltaY*40;c.value.$refs.wrapRef.scrollLeft=c.value.$refs.wrapRef.scrollLeft+e/4},E=()=>{ee(()=>{let n=document.querySelector(".el-menu.el-menu--horizontal li.is-active");if(!n)return!1;c.value.$refs.wrapRef.scrollLeft=n.offsetLeft})},_=n=>n.filter(e=>{var t;return!((t=e.meta)!=null&&t.isHide)}).map(e=>(e=Object.assign({},e),e.children&&(e.children=_(e.children)),e)),H=n=>{const e=n.split("/");let t={children:[]};return _(w.value).map((o,f)=>{o.path===`/${e[1]}`&&(o.k=f,t.item={...o},t.children=[{...o}],o.children&&(t.children=o.children))}),t},h=n=>{const{path:e,meta:t}=n;if(p.value.layout==="classic")u.defaultActive=`/${e==null?void 0:e.split("/")[1]}`;else{const o=t!=null&&t.isDynamic?t.isDynamicPath.split("/"):e.split("/");o.length>=4&&(t!=null&&t.isHide)?u.defaultActive=o.splice(0,3).join("/"):u.defaultActive=e}},B=n=>{j.handleOpenLink(n)};return K(()=>{h(x)}),Q(()=>{E()}),U(n=>{h(n);let{layout:e,isClassicSplitMenu:t}=p.value;e==="classic"&&t&&F.emit("setSendClassicChildren",H(n.path))}),(n,e)=>{const t=i("SvgIcon"),o=i("el-sub-menu"),f=i("el-menu-item"),I=i("el-menu"),T=i("el-scrollbar");return r(),d("div",ne,[a(T,{onWheel:S(D,["prevent"]),ref_key:"elMenuHorizontalScrollRef",ref:c},{default:l(()=>[a(I,{router:"","default-active":u.defaultActive,ellipsis:!1,"background-color":"transparent",mode:"horizontal"},{default:l(()=>[(r(!0),d(L,null,Y(b.value,s=>(r(),d(L,null,[s.children&&s.children.length>0?(r(),y(o,{index:s.path,key:s.path},{title:l(()=>[a(t,{name:s.meta.icon},null,8,["name"]),C("span",null,m(n.$t(s.meta.title)),1)]),default:l(()=>[a(J(A),{chil:s.children},null,8,["chil"])]),_:2},1032,["index"])):(r(),y(f,{index:s.path,key:s.path},X({_:2},[!s.meta.isLink||s.meta.isLink&&s.meta.isIframe?{name:"title",fn:l(()=>[a(t,{name:s.meta.icon},null,8,["name"]),g(" "+m(n.$t(s.meta.title)),1)]),key:"0"}:{name:"title",fn:l(()=>[C("a",{class:"w100",onClick:S(ae=>B(s),["prevent"])},[a(t,{name:s.meta.icon},null,8,["name"]),g(" "+m(n.$t(s.meta.title)),1)],8,["onClick"])]),key:"1"}]),1032,["index"]))],64))),256))]),_:1},8,["default-active"])]),_:1},512)])}}});const fe=te(oe,[["__scopeId","data-v-161df1d0"]]);export{fe as default};
