import{_ as V}from"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.e9645613.js";import{d as I,ay as S,aD as T,az as F,Z as R,k as E,j as $,w as j,ai as v,o as n,c as u,U as m,u as d,O as b,a0 as z,F as D,a8 as M,M as p,R as _,a as A,T as y,S as G}from"./vue.adf17aba.js";import{A as O,i as U,E as Z,j as C}from"./index.ad3efb29.js";import{_ as q}from"./_plugin-vue_export-helper.c27b6911.js";import"./elementPlus.4833989a.js";import"./echarts.72dc8373.js";const H={key:0,class:"layout-navbars-breadcrumb"},J={key:0,class:"layout-navbars-breadcrumb-span"},K={key:1},P=I({__name:"breadcrumb",setup(Q){const L=O(),k=U(),{themeConfig:a}=S(k),{routesList:f}=S(L),r=T();F();const e=R({breadcrumbList:[],routeSplit:[],routeSplitFirst:"",routeSplitIndex:1}),w=E(()=>{c(r.path);const{layout:s,isBreadcrumb:o}=a.value;return s==="classic"||s==="transverse"?!1:!!o}),x=()=>{a.value.isCollapse=!a.value.isCollapse,B()},B=()=>{C.remove("themeConfig"),C.set("themeConfig",a.value)},h=s=>{s.forEach(o=>{e.routeSplit.forEach((i,g,l)=>{e.routeSplitFirst===o.path&&(e.routeSplitFirst+=`/${l[e.routeSplitIndex]}`,e.breadcrumbList.push(o),e.routeSplitIndex++,o.children&&h(o.children))})})},c=s=>{if(!a.value.isBreadcrumb)return!1;e.breadcrumbList=[f.value[0]],e.routeSplit=s.split("/"),e.routeSplit.shift(),e.routeSplitFirst=`/${e.routeSplit[0]}`,e.routeSplitIndex=1,h(f.value),(r.name==="home"||r.name==="notFound"&&e.breadcrumbList.length>1)&&e.breadcrumbList.shift(),e.breadcrumbList.length>0&&(e.breadcrumbList[e.breadcrumbList.length-1].meta.tagsViewName=Z.setTagsViewNameI18n(r))};return $(()=>{c(r.path)}),j(()=>r.path,()=>{c(r.path)},{deep:!0}),(s,o)=>{const i=V,g=v("el-breadcrumb-item"),l=v("el-breadcrumb");return w.value?(n(),u("div",H,[m(i,{class:"layout-navbars-breadcrumb-icon",name:d(a).isCollapse?"ele-Expand":"ele-Fold",size:16,onClick:x},null,8,["name"]),m(l,{class:"layout-navbars-breadcrumb-hide"},{default:b(()=>[m(z,{name:"breadcrumb"},{default:b(()=>[(n(!0),u(D,null,M(e.breadcrumbList,(t,N)=>(n(),p(g,{key:t.meta.tagsViewName?t.meta.tagsViewName:t.meta.title},{default:b(()=>[N===e.breadcrumbList.length-1?(n(),u("span",J,[d(a).isBreadcrumbIcon?(n(),p(i,{key:0,name:t.meta.icon,class:"layout-navbars-breadcrumb-iconfont"},null,8,["name"])):_("",!0),A("div",null,y(t.meta.tagsViewName?t.meta.tagsViewName:t.meta.title),1)])):(n(),u("a",K,[d(a).isBreadcrumbIcon?(n(),p(i,{key:0,name:t.meta.icon,class:"layout-navbars-breadcrumb-iconfont"},null,8,["name"])):_("",!0),G(" "+y(s.$t(t.meta.title)),1)]))]),_:2},1024))),128))]),_:1})]),_:1})])):_("",!0)}}});const se=q(P,[["__scopeId","data-v-4bd91e14"]]);export{se as default};
