1 |
- var z=Object.defineProperty,J=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var S=(c,s,a)=>s in c?z(c,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):c[s]=a,x=(c,s)=>{for(var a in s||(s={}))X.call(s,a)&&S(c,a,s[a]);if(N)for(var a of N(s))Y.call(s,a)&&S(c,a,s[a]);return c},P=(c,s)=>J(c,Q(s));var D=(c,s,a)=>new Promise((y,g)=>{var C=f=>{try{p(a.next(f))}catch(_){g(_)}},h=f=>{try{p(a.throw(f))}catch(_){g(_)}},p=f=>f.done?y(f.value):Promise.resolve(f.value).then(C,h);p((a=a.apply(c,s)).next())});import{d as Z,f as q,Y as H,h as K,Z as i,_ as b,k as G,a8 as d,u as o,a1 as U,a9 as W,F as L,aa as T,a7 as k,ad as I,ab as V,a0 as M,G as F}from"./vue-ByATgq5d.js";import{p as ee,j as ae,J as ne,u as te,e as se,aw as re,aG as ue,au as le,bw as ce,N as O}from"./entry/index-C5x3nItD.js";import{bP as oe,x as ie,X as fe,bQ as me,l as de}from"./antd-FjOLgRLC.js";const he={key:1},pe={key:1},be=Z({name:"LayoutBreadcrumb",__name:"Breadcrumb",props:{theme:ee.oneOf(["dark","light"])},setup(c){const s=q([]),{currentRoute:a}=H(),{prefixCls:y}=ae("layout-breadcrumb"),{getShowBreadCrumbIcon:g}=ne(),C=te(),{t:h}=se();K(()=>D(this,null,function*(){var w,E,R,A;if(a.value.name===re)return;const l=yield ue(),t=a.value.matched,n=t==null?void 0:t[t.length-1];let e=a.value.path;n&&((w=n==null?void 0:n.meta)!=null&&w.currentActiveMenu)&&(e=n.meta.currentActiveMenu);const r=le(l,e),u=l.filter(j=>j.path===r[0]),m=p(u,r);if(!m||m.length===0){s.value=[];return}const v=f(m);(E=a.value.meta)!=null&&E.currentActiveMenu&&!((R=a.value.meta)!=null&&R.hideBreadcrumb)&&v.push(P(x({},a.value),{name:((A=a.value.meta)==null?void 0:A.title)||a.value.name})),s.value=v}));function p(l,t){const n=[];return l.forEach(e=>{var r,u;t.includes(e.path)&&n.push(P(x({},e),{name:((r=e.meta)==null?void 0:r.title)||e.name})),(u=e.children)!=null&&u.length&&n.push(...p(e.children,t))}),n}function f(l){return ce(l,t=>{const{meta:n,name:e}=t;if(!n)return!!e;const{title:r,hideBreadcrumb:u,hideMenu:m}=n;return!(!r||u||m)}).filter(t=>{var n;return!((n=t.meta)!=null&&n.hideBreadcrumb)})}function _(l){const{children:t,redirect:n,meta:e}=l;if(!(t!=null&&t.length&&!n)&&!(e!=null&&e.carryParam))if(n&&de(n))C(n);else{let r="";l.path?r=l.path:r="",r=/^\//.test(r)?r:`/${r}`,C(r)}}function $(l,t){return l.indexOf(t)!==l.length-1}function B(l){var t;return l.icon||((t=l.meta)==null?void 0:t.icon)}return(l,t)=>{const n=W("router-link");return i(),b("div",{class:U([o(y),`${o(y)}--${c.theme}`])},[G(o(oe),null,{default:d(()=>[(i(!0),b(L,null,T(s.value,e=>{var r;return i(),k(o(me),{key:e.name},I({default:d(()=>[o(g)&&B(e)?(i(),k(O,{key:0,icon:B(e)},null,8,["icon"])):V("",!0),$(s.value,e)?(i(),k(n,{key:2,to:"",onClick:u=>_(e)},{default:d(()=>[F(M(o(h)(e.meta.title||e.name)),1)]),_:2},1032,["onClick"])):(i(),b("span",he,M(o(h)(e.meta.title||e.name)),1))]),_:2},[e.children&&!((r=e.meta)!=null&&r.hideChildrenInMenu)?{name:"overlay",fn:d(()=>[G(o(ie),null,{default:d(()=>[(i(!0),b(L,null,T(e.children,u=>(i(),k(o(fe),{key:u.name},{default:d(()=>{var m;return[o(g)&&B(u)?(i(),k(O,{key:0,icon:B(u)},null,8,["icon"])):V("",!0),$(s.value,u)?(i(),k(n,{key:2,to:"",onClick:v=>_(u)},{default:d(()=>{var v;return[F(M(o(h)(((v=u.meta)==null?void 0:v.title)||u.name)),1)]}),_:2},1032,["onClick"])):(i(),b("span",pe,M(o(h)(((m=u.meta)==null?void 0:m.title)||u.name)),1))]}),_:2},1024))),128))]),_:2},1024)]),key:"0"}:void 0]),1024)}),128))]),_:1})],2)}}});export{be as default};
|