import{A as I,i as O,n as P,E as V,k as j}from"./index.ad3efb29.js";import{_ as F}from"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.e9645613.js";import{d as N,r as U,ay as k,aD as q,Z as W,k as Y,E as Z,j as G,aH as J,ai as u,o as i,c as m,U as a,O as l,F as y,a8 as K,M as C,a as L,T as d,u as Q,aa as X,S,a2 as g,aC as ee,n as te}from"./vue.adf17aba.js";import{_ as ne}from"./_plugin-vue_export-helper.c27b6911.js";import"./elementPlus.4833989a.js";import"./echarts.72dc8373.js";const se={class:"el-menu-horizontal-warp"},oe=N({__name:"horizontal",props:{menuList:{type:Array,default:()=>[]}},setup(R){const A=ee(()=>P(()=>import("./subItem.703f83aa.js"),["assets/subItem.703f83aa.js","assets/index.vue_vue_type_script_setup_true_name_svgIcon_lang.e9645613.js","assets/vue.adf17aba.js","assets/index.ad3efb29.js","assets/elementPlus.4833989a.js","assets/echarts.72dc8373.js","assets/index.7d841112.css"])),$=R,r=U(),z=I(),M=O(),{routesList:w}=k(z),{themeConfig:p}=k(M),x=q(),c=W({defaultActive:""}),D=Y(()=>$.menuList),b=n=>{const e=n.wheelDelta||-n.deltaY*40;r.value.$refs.wrapRef.scrollLeft=r.value.$refs.wrapRef.scrollLeft+e/4},v=()=>{te(()=>{let n=document.querySelector(".el-menu.el-menu--horizontal li.is-active");if(!n)return!1;r.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)),E=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")c.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)?c.defaultActive=o.splice(0,3).join("/"):c.defaultActive=e}},H=n=>{V.handleOpenLink(n)};return Z(()=>{h(x)}),G(()=>{v()}),J(n=>{h(n);let{layout:e,isClassicSplitMenu:t}=p.value;e==="classic"&&t&&j.emit("setSendClassicChildren",E(n.path))}),(n,e)=>{const t=F,o=u("el-sub-menu"),f=u("el-menu-item"),T=u("el-menu"),B=u("el-scrollbar");return i(),m("div",se,[a(B,{onWheel:g(b,["prevent"]),ref_key:"elMenuHorizontalScrollRef",ref:r},{default:l(()=>[a(T,{router:"","default-active":c.defaultActive,ellipsis:!1,"background-color":"transparent",mode:"horizontal"},{default:l(()=>[(i(!0),m(y,null,K(D.value,s=>(i(),m(y,null,[s.children&&s.children.length>0?(i(),C(o,{index:s.path,key:s.path},{title:l(()=>[a(t,{name:s.meta.icon},null,8,["name"]),L("span",null,d(n.$t(s.meta.title)),1)]),default:l(()=>[a(Q(A),{chil:s.children},null,8,["chil"])]),_:2},1032,["index"])):(i(),C(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"]),S(" "+d(n.$t(s.meta.title)),1)]),key:"0"}:{name:"title",fn:l(()=>[L("a",{class:"w100",onClick:g(ae=>H(s),["prevent"])},[a(t,{name:s.meta.icon},null,8,["name"]),S(" "+d(n.$t(s.meta.title)),1)],8,["onClick"])]),key:"1"}]),1032,["index"]))],64))),256))]),_:1},8,["default-active"])]),_:1},512)])}}});const me=ne(oe,[["__scopeId","data-v-78313002"]]);export{me as default};
