import{A as I,i as O,n as P,E as V,k as j}from"./index.0d411246.js";import{_ as F}from"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.bacf465d.js";import{d as N,r as W,al as k,ao as q,Q as G,k as K,v as Q,j as U,at as Y,a9 as u,o as i,c as m,M as a,G as l,F as L,a0 as J,E as y,a as C,L as d,u as X,a2 as Z,K as g,W as S,an as ee,n as te}from"./vue.3f733908.js";import{_ as ne}from"./_plugin-vue_export-helper.c27b6911.js";import"./elementPlus.0e5067e4.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.67a44802.js"),["assets/subItem.67a44802.js","assets/index.vue_vue_type_script_setup_true_name_svgIcon_lang.bacf465d.js","assets/vue.3f733908.js","assets/index.0d411246.js","assets/elementPlus.0e5067e4.js","assets/echarts.72dc8373.js","assets/index.1be93128.css"])),$=R,r=W(),z=I(),M=O(),{routesList:v}=k(z),{themeConfig:p}=k(M),w=q(),c=G({defaultActive:""}),x=K(()=>$.menuList),b=n=>{const e=n.wheelDelta||-n.deltaY*40;r.value.$refs.wrapRef.scrollLeft=r.value.$refs.wrapRef.scrollLeft+e/4},D=()=>{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 _(v.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}},B=n=>{V.handleOpenLink(n)};return Q(()=>{h(w)}),U(()=>{D()}),Y(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"),H=u("el-menu"),T=u("el-scrollbar");return i(),m("div",se,[a(T,{onWheel:S(b,["prevent"]),ref_key:"elMenuHorizontalScrollRef",ref:r},{default:l(()=>[a(H,{router:"","default-active":c.defaultActive,ellipsis:!1,"background-color":"transparent",mode:"horizontal"},{default:l(()=>[(i(!0),m(L,null,J(x.value,s=>(i(),m(L,null,[s.children&&s.children.length>0?(i(),y(o,{index:s.path,key:s.path},{title:l(()=>[a(t,{name:s.meta.icon},null,8,["name"]),C("span",null,d(n.$t(s.meta.title)),1)]),default:l(()=>[a(X(A),{chil:s.children},null,8,["chil"])]),_:2},1032,["index"])):(i(),y(f,{index:s.path,key:s.path},Z({_:2},[!s.meta.isLink||s.meta.isLink&&s.meta.isIframe?{name:"title",fn:l(()=>[a(t,{name:s.meta.icon},null,8,["name"]),g(" "+d(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(" "+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};
