import{_ as w}from"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.e9645613.js";import{d as F,r as S,ay as $,aD as B,az as j,Z as U,j as z,Y as V,aH as E,w as Y,ai as Z,o as c,c as d,U as _,O as q,a as m,F as G,a8 as J,I as C,u as f,T as M,n as K}from"./vue.adf17aba.js";import{A as Q,i as W,k as i,D as X}from"./index.ad3efb29.js";import{_ as ee}from"./_plugin-vue_export-helper.c27b6911.js";import"./elementPlus.4833989a.js";import"./echarts.72dc8373.js";const te={class:"layout-columns-aside"},se=["onClick","onMouseenter","title"],ne={class:"columns-vertical-title font12"},oe=["href"],le={class:"columns-vertical-title font12"},ie=F({__name:"columnsAside",setup(ae){const v=S([]),A=S(),h=Q(),O=W(),{routesList:k,isColumnsMenuHover:R,isColumnsNavHover:x}=$(h),{themeConfig:a}=$(O),y=B(),L=j(),t=U({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`},D=(e,s)=>{g(s);let{path:o,redirect:l}=e;l?L.push(l):L.push(o)},T=(e,s)=>{if(!a.value.isColumnsMenuHoverPreload)return!1;let{path:o}=e;t.liOldPath=o,t.liOldIndex=s,t.liHoverIndex=s,i.emit("setSendColumnsChildren",u(o)),h.setColumnsMenuHover(!1),h.setColumnsNavHover(!0)},b=async()=>{await h.setColumnsNavHover(!1),setTimeout(()=>{!R&&!x&&i.emit("restoreDefault")},100)},H=e=>{K(()=>{g(e)})},P=()=>{var s;t.columnsAsideList=I(k.value);const e=u(y.path);if(Object.keys(e).length<=0)return!1;H((s=e.item)==null?void 0:s.k),i.emit("setSendColumnsChildren",e)},u=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)),N=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(()=>{H(o.k)},0)};return z(()=>{P(),i.on("restoreDefault",()=>{t.liOldIndex=null,t.liOldPath=null})}),V(()=>{i.off("restoreDefault",()=>{})}),E(e=>{N(e.path),i.emit("setSendColumnsChildren",u(e.path))}),Y(X.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",u(y.path));else{if(t.liHoverIndex=t.liOldIndex,!t.liOldPath)return!1;i.emit("setSendColumnsChildren",u(t.liOldPath))}},{deep:!0}),(e,s)=>{const o=w,l=Z("el-scrollbar");return c(),d("div",te,[_(l,null,{default:q(()=>[m("ul",{onMouseleave:s[0]||(s[0]=n=>b())},[(c(!0),d(G,null,J(t.columnsAsideList,(n,r)=>(c(),d("li",{key:r,onClick:p=>D(n,r),onMouseenter:p=>T(n,r),ref_for:!0,ref:p=>{p&&(v.value[r]=p)},class:C({"layout-columns-active":t.liIndex===r,"layout-columns-hover":t.liHoverIndex===r}),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",ne,M(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",le,M(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,oe)],2))],42,se))),128)),m("div",{ref_key:"columnsAsideActiveRef",ref:A,class:C(f(a).columnsAsideStyle)},null,2)],32)]),_:1})])}}});const he=ee(ie,[["__scopeId","data-v-6ced2c39"]]);export{he as default};
