import{a as O,r as I,aC as M,aB as F,aH as j,_ as K,q as U,W as V,aK as q,w as z,aj as $,c,o as d,S as v,K as E,b as m,R as G,a9 as Q,G as C,u as f,Q as R,t as W}from"./vue.D1BjjNmv.js";import{aK as J,u as X,e as i,aL as Y}from"./index.CL7yl-Wb.js";import{_ as Z}from"./_plugin-vue_export-helper.DlAUqK2U.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 _=I([]),A=I(),h=J(),k=X(),{routesList:x,isColumnsMenuHover:b,isColumnsNavHover:T}=M(h),{themeConfig:a}=M(k),y=F(),L=j(),t=K({columnsAsideList:[],liIndex:0,liOldIndex:null,liHoverIndex:null,liOldPath:null,difference:0,routeSplit:[]}),S=e=>{t.liIndex=e,A.value.style.top=`${_.value[e].offsetTop+t.difference}px`},D=(e,s)=>{S(s);let{path:o,redirect:l}=e;l?L.push(l):L.push(o)},P=(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(()=>{!b&&!T&&i.emit("restoreDefault")},100)},g=e=>{W(()=>{S(e)})},w=()=>{var s;t.columnsAsideList=H(x.value);const e=r(y.path);if(Object.keys(e).length<=0)return!1;g((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},H=e=>e.filter(s=>{var o;return!((o=s.meta)!=null&&o.isHide)}).map(s=>(s=Object.assign({},s),s.children&&(s.children=H(s.children)),s)),B=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(()=>{g(o.k)},0)};return U(()=>{w(),i.on("restoreDefault",()=>{t.liOldIndex=null,t.liOldPath=null})}),V(()=>{i.off("restoreDefault",()=>{})}),q(e=>{B(e.path),i.emit("setSendColumnsChildren",r(e.path))}),z(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 d(),c("div",ee,[v(l,null,{default:E(()=>[m("ul",{onMouseleave:s[0]||(s[0]=n=>N())},[(d(!0),c(G,null,Q(t.columnsAsideList,(n,u)=>(d(),c("li",{key:u,onClick:p=>D(n,u),onMouseenter:p=>P(n,u),ref_for:!0,ref:p=>{p&&(_.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?(d(),c("div",{key:0,class:C(f(a).columnsAsideLayout)},[v(o,{name:n.meta.icon},null,8,["name"]),m("div",se,R(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)):(d(),c("div",{key:1,class:C(f(a).columnsAsideLayout)},[m("a",{href:n.meta.isLink,target:"_blank"},[v(o,{name:n.meta.icon},null,8,["name"]),m("div",oe,R(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})])}}}),de=Z(ie,[["__scopeId","data-v-e9a1a406"]]);export{de as default};
