fix: 统一AI详情页面包屑与Tab导航表现

- 为工作流、插件、知识库、聊天助手详情路由恢复面包屑与Tab参与并保持父模块高亮

- 列表卡片跳转统一追加 navTitle 与 pageKey,详情页Tab标题与面包屑优先显示卡片名称

- 工作流设计页、知识库详情页、聊天助手设置页在深链缺少 navTitle 时自动 replace 补写
This commit is contained in:
2026-03-11 20:07:00 +08:00
parent c933971a75
commit 99f792f6de
13 changed files with 146 additions and 13 deletions

View File

@@ -85,12 +85,27 @@ export function useTabbar() {
await closeTabByKey(key);
};
function resolveNavTitle(navTitleQuery: unknown): string {
const rawValue = Array.isArray(navTitleQuery)
? navTitleQuery[0]
: navTitleQuery;
if (typeof rawValue !== 'string' || !rawValue.trim()) {
return '';
}
try {
return decodeURIComponent(rawValue);
} catch {
return rawValue;
}
}
function wrapperTabLocale(tab: RouteLocationNormalizedGeneric) {
const navTitle = tab?.meta?.navTitle as string | undefined;
return {
...tab,
meta: {
...tab?.meta,
title: $t(tab?.meta?.title as string),
title: navTitle || $t(tab?.meta?.title as string),
},
};
}
@@ -106,10 +121,16 @@ export function useTabbar() {
watch(
() => route.fullPath,
() => {
const meta = route.matched?.[route.matched.length - 1]?.meta;
const routeMeta = route.matched?.[route.matched.length - 1]?.meta;
const navTitle = resolveNavTitle(route.query.navTitle);
const meta = {
...(routeMeta || route.meta),
navTitle,
title: navTitle || (routeMeta?.title ?? route.meta?.title),
};
tabbarStore.addTab({
...route,
meta: meta || route.meta,
meta,
});
},
{ immediate: true },