import{d as O,r as M,al as H,ao as B,am as j,Q as z,j as U,P as V,as as E,w as G,a9 as $,o as c,c as d,M as _,G as Q,a as m,F as q,a0 as J,z as C,u as f,L as k,n as K}from"./vue.6daa721c.js";import{A as W,i as X,k as i,D as Y}from"./index.ae7ce77b.js";import{_ as Z}from"./_plugin-vue_export-helper.c27b6911.js";import"./elementPlus.346c766a.js";import"./echarts.72dc8373.js";const ee={class:"layout-columns-aside"},te=["onClick","onMouseenter","title"],se={class:"columns-vertical-title font12"},ne=["href"],oe={class:"columns-vertical-title font12"},le=O({name:"layoutColumnsAside"}),ie=O({...le,setup(ae){const v=M([]),A=M(),h=W(),R=X(),{routesList:x,isColumnsMenuHover:D,isColumnsNavHover:P}=H(h),{themeConfig:a}=H(R),y=B(),L=j(),t=z({columnsAsideList:[],liIndex:0,liOldIndex:null,liHoverIndex:null,liOldPath:null,difference:0,routeSplit:[]}),g=e=>{t.liIndex=e,A.value.style.top=`${v.value[e].offsetTop+t.difference}px`},T=(e,s)=>{g(s);let{path:o,redirect:l}=e;l?L.push(l):L.push(o)},b=(e,s)=>{if(!a.value.isColumnsMenuHoverPreload)return!1;let{path:o}=e;t.liOldPath=o,t.liOldIndex=s,t.liHoverIndex=s,i.emit("setSendColumnsChildren",r(o)),h.setColumnsMenuHover(!1),h.setColumnsNavHover(!0)},N=async()=>{await h.setColumnsNavHover(!1),setTimeout(()=>{!D&&!P&&i.emit("restoreDefault")},100)},S=e=>{K(()=>{g(e)})},w=()=>{var s;t.columnsAsideList=I(x.value);const e=r(y.path);if(Object.keys(e).length<=0)return!1;S((s=e.item)==null?void 0:s.k),i.emit("setSendColumnsChildren",e)},r=e=>{const s=e.split("/");let o={children:[]};return t.columnsAsideList.map((l,n)=>{l.path===`/${s[1]}`&&(l.k=n,o.item={...l},o.children=[{...l}],l.children&&(o.children=l.children))}),o},I=e=>e.filter(s=>{var o;return!((o=s.meta)!=null&&o.isHide)}).map(s=>(s=Object.assign({},s),s.children&&(s.children=I(s.children)),s)),F=e=>{t.routeSplit=e.split("/"),t.routeSplit.shift();const s=`/${t.routeSplit[0]}`,o=t.columnsAsideList.find(l=>l.path===s);if(!o)return!1;setTimeout(()=>{S(o.k)},0)};return U(()=>{w(),i.on("restoreDefault",()=>{t.liOldIndex=null,t.liOldPath=null})}),V(()=>{i.off("restoreDefault",()=>{})}),E(e=>{F(e.path),i.emit("setSendColumnsChildren",r(e.path))}),G(Y.state,e=>{if(e.themeConfig.themeConfig.columnsAsideStyle==="columnsRound"?t.difference=3:t.difference=0,!e.routesList.isColumnsMenuHover&&!e.routesList.isColumnsNavHover)t.liHoverIndex=null,i.emit("setSendColumnsChildren",r(y.path));else{if(t.liHoverIndex=t.liOldIndex,!t.liOldPath)return!1;i.emit("setSendColumnsChildren",r(t.liOldPath))}},{deep:!0}),(e,s)=>{const o=$("SvgIcon"),l=$("el-scrollbar");return c(),d("div",ee,[_(l,null,{default:Q(()=>[m("ul",{onMouseleave:s[0]||(s[0]=n=>N())},[(c(!0),d(q,null,J(t.columnsAsideList,(n,u)=>(c(),d("li",{key:u,onClick:p=>T(n,u),onMouseenter:p=>b(n,u),ref_for:!0,ref:p=>{p&&(v.value[u]=p)},class:C({"layout-columns-active":t.liIndex===u,"layout-columns-hover":t.liHoverIndex===u}),title:e.$t(n.meta.title)},[!n.meta.isLink||n.meta.isLink&&n.meta.isIframe?(c(),d("div",{key:0,class:C(f(a).columnsAsideLayout)},[_(o,{name:n.meta.icon},null,8,["name"]),m("div",se,k(e.$t(n.meta.title)&&e.$t(n.meta.title).length>=4?e.$t(n.meta.title).substr(0,f(a).columnsAsideLayout==="columns-vertical"?4:3):e.$t(n.meta.title)),1)],2)):(c(),d("div",{key:1,class:C(f(a).columnsAsideLayout)},[m("a",{href:n.meta.isLink,target:"_blank"},[_(o,{name:n.meta.icon},null,8,["name"]),m("div",oe,k(e.$t(n.meta.title)&&e.$t(n.meta.title).length>=4?e.$t(n.meta.title).substr(0,f(a).columnsAsideLayout==="columns-vertical"?4:3):e.$t(n.meta.title)),1)],8,ne)],2))],42,te))),128)),m("div",{ref_key:"columnsAsideActiveRef",ref:A,class:C(f(a).columnsAsideStyle)},null,2)],32)]),_:1})])}}});const fe=Z(ie,[["__scopeId","data-v-e9a1a406"]]);export{fe as default};
