import{_ as V}from"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.278ff746.js";import{d as I,al as v,ao as F,am as T,Q as E,k as R,j as $,w as j,a9 as L,o as n,c as u,M as m,u as d,G as b,U as G,F as M,a0 as z,E as p,J as _,a as A,L as S,K as D}from"./vue.65d9dadc.js";import{A as J,i as K,E as Q,j as y}from"./index.373e4c1e.js";import{_ as U}from"./_plugin-vue_export-helper.c27b6911.js";import"./elementPlus.c5b0e04f.js";import"./echarts.72dc8373.js";const q={key:0,class:"layout-navbars-breadcrumb"},H={key:0,class:"layout-navbars-breadcrumb-span"},O={key:1},P=I({__name:"breadcrumb",setup(W){const C=J(),k=K(),{themeConfig:a}=v(k),{routesList:f}=v(C),r=F();T();const e=E({breadcrumbList:[],routeSplit:[],routeSplitFirst:"",routeSplitIndex:1}),w=R(()=>{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=()=>{y.remove("themeConfig"),y.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=Q.setTagsViewNameI18n(r))};return $(()=>{c(r.path)}),j(()=>r.path,()=>{c(r.path)},{deep:!0}),(s,o)=>{const i=V,g=L("el-breadcrumb-item"),l=L("el-breadcrumb");return w.value?(n(),u("div",q,[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(G,{name:"breadcrumb"},{default:b(()=>[(n(!0),u(M,null,z(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",H,[d(a).isBreadcrumbIcon?(n(),p(i,{key:0,name:t.meta.icon,class:"layout-navbars-breadcrumb-iconfont"},null,8,["name"])):_("",!0),A("div",null,S(t.meta.tagsViewName?t.meta.tagsViewName:t.meta.title),1)])):(n(),u("a",O,[d(a).isBreadcrumbIcon?(n(),p(i,{key:0,name:t.meta.icon,class:"layout-navbars-breadcrumb-iconfont"},null,8,["name"])):_("",!0),D(" "+S(s.$t(t.meta.title)),1)]))]),_:2},1024))),128))]),_:1})]),_:1})])):_("",!0)}}});const se=U(P,[["__scopeId","data-v-4bd91e14"]]);export{se as default};
