import{d as N,g as H,h as P,a8 as w,s as M,i as j,R as V,a3 as U,j as q,I as i,k as z,ab as K,a1 as Y,a9 as Z,l as G,o as d,a as m,x as A,y as J,e as a,K as p,Y as $,Z as Q,f as C,u as r,q as k,af as W,B as X,_ as ee}from"./index.4042ed24.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=N({__name:"columnsAside",setup(ue){const _=H([]),s=P({columnsAsideList:[],liIndex:0,liOldIndex:null,liHoverIndex:null,liOldPath:null,difference:0,routeSplit:[]}),f=w(),{routesList:x,isColumnsMenuHover:R,isColumnsNavHover:O}=M(f),b=j(),{themeConfig:u}=M(b),v=V(),y=U(),g=H(),D=()=>{var n;s.columnsAsideList=S(x.value);const e=c(v.path);if(Object.keys(e).length<=0)return!1;L((n=e.item)==null?void 0:n.k),i.emit("setSendColumnsChildren",e)},S=e=>e.filter(n=>{var o;return!((o=n.meta)!=null&&o.isHide)}).map(n=>(n=Object.assign({},n),n.children&&(n.children=S(n.children)),n)),c=e=>{const n=e.split("/");let o={children:[]};return s.columnsAsideList.map((t,l)=>{t.path===`/${n[1]}`&&(t.k=l,o.item={...t},o.children=[{...t}],t.children&&(o.children=t.children))}),o},L=e=>{X(()=>{I(e)})},I=e=>{s.liIndex=e,g.value.style.top=`${_.value[e].offsetTop+s.difference}px`},E=(e,n)=>{I(n);let{path:o,redirect:t}=e;t?y.push(t):y.push(o)},T=(e,n)=>{if(!u.value.isColumnsMenuHoverPreload)return!1;let{path:o}=e;s.liOldPath=o,s.liOldIndex=n,s.liHoverIndex=n,i.emit("setSendColumnsChildren",c(o)),f.setColumnsMenuHover(!1),f.setColumnsNavHover(!0)},B=async()=>{await f.setColumnsNavHover(!1),setTimeout(()=>{!R&&!O&&i.emit("restoreDefault")},100)};q(()=>{D(),i.on("restoreDefault",()=>{s.liOldIndex=null,s.liOldPath=null})}),z(()=>{i.off("restoreDefault",()=>{})}),K(e=>{F(e.path),i.emit("setSendColumnsChildren",c(e.path))});const F=e=>{s.routeSplit=e.split("/"),s.routeSplit.shift();const n=`/${s.routeSplit[0]}`,o=s.columnsAsideList.find(t=>t.path===n);if(!o)return!1;setTimeout(()=>{L(o.k)},0)};return Y(Z.state,e=>{if(e.themeConfig.themeConfig.columnsAsideStyle==="columnsRound"?s.difference=3:s.difference=0,!e.routesList.isColumnsMenuHover&&!e.routesList.isColumnsNavHover)s.liHoverIndex=null,i.emit("setSendColumnsChildren",c(v.path));else{if(s.liHoverIndex=s.liOldIndex,!s.liOldPath)return!1;i.emit("setSendColumnsChildren",c(s.liOldPath))}},{deep:!0}),(e,n)=>{const o=G("SvgIcon");return d(),m("div",te,[A(r(W),null,{default:J(()=>[a("ul",{onMouseleave:n[0]||(n[0]=t=>B())},[p(" {{ state.columnsAsideList }} "),(d(!0),m($,null,Q(s.columnsAsideList,(t,l)=>(d(),m("li",{key:l,onClick:h=>E(t,l),onMouseenter:h=>T(t,l),class:C({"layout-columns-active":s.liIndex===l,"layout-columns-hover":s.liHoverIndex===l}),title:e.$t(t.meta.title),ref_for:!0,ref:h=>{h&&(_.value[l]=h)}},[p(" \u4E0D\u663E\u793A\u8D85\u94FE\u63A5\u6216\u8005\u663E\u793Aiframe "),!t.meta.isLink||t.meta.isLink&&t.meta.isIframe?(d(),m("div",{key:0,class:C(r(u).columnsAsideLayout)},[A(o,{name:t.meta.icon},null,8,["name"]),a("div",ne,k(e.$t(t.meta.title)&&e.$t(t.meta.title).length>=4?e.$t(t.meta.title).substr(0,r(u).columnsAsideLayout==="colunmns-vertical"?4:3):e.$t(t.meta.title)),1)],2)):(d(),m($,{key:1},[p(" \u5426\u5219a\u65B0\u7A97\u53E3\u6253\u5F00 "),a("div",{class:C(r(u).columnsAsideLayout)},[a("a",{href:t.meta.isLink,target:"_blank"},[A(o,{name:t.meta.icon},null,8,["name"]),a("div",le,k(e.$t(t.meta.title)&&e.$t(t.meta.title).length>=4?e.$t(t.meta.title).substr(0,r(u).columnsAsideLayout==="colunmns-vertical"?4:3):e.$t(t.meta.title)),1)],8,oe)],2)],2112))],42,se))),128)),p(" \u5206\u680F\u9AD8\u4EAE\u98CE\u683CthemeConfig.columnsAsideStyle: 'columns-round', "),a("div",{ref_key:"columnsAsideActiveRef",ref:g,class:C(r(u).columnsAsideStyle)},null,2)],32)]),_:1})])}}});const re=ee(ie,[["__scopeId","data-v-c97de0f1"],["__file","/data/jenkins/workspace/badp-bcxin-web-5.x-dispatchBusiness/src/layout/component/columnsAside.vue"]]);export{re as default};
