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

@@ -203,6 +203,27 @@ const pluginSelectRef = ref();
const updatePluginNode = ref<any>(null);
const pageLoading = ref(false);
const chainInfo = ref<any>(null);
function syncNavTitle(title: string) {
if (!title) {
return;
}
const query = route.query as Record<string, any>;
const navTitle = Array.isArray(query.navTitle)
? query.navTitle[0]
: query.navTitle;
if (typeof navTitle === 'string' && navTitle.trim()) {
return;
}
router.replace({
path: route.path,
query: {
...query,
pageKey: query.pageKey || '/ai/workflow',
navTitle: title,
},
});
}
// functions
async function loadCustomNode() {
customNode.value = await getCustomNode({
@@ -264,6 +285,7 @@ async function getWorkflowInfo(workflowId: any) {
tinyFlowData.value = workflowInfo.value.content
? JSON.parse(workflowInfo.value.content)
: {};
syncNavTitle(workflowInfo.value?.title || '');
});
}
async function getLlmList() {

View File

@@ -170,6 +170,9 @@ function reset() {
function showDialog(row: any, importMode = false) {
saveDialog.value.openDialog({ ...row }, importMode);
}
function resolveNavTitle(row: any) {
return row?.title || row?.name || '';
}
function remove(row: any) {
ElMessageBox.confirm($t('message.deleteAlert'), $t('message.noticeTitle'), {
confirmButtonText: $t('message.ok'),
@@ -202,6 +205,8 @@ function toDesignPage(row: any) {
name: 'WorkflowDesign',
query: {
id: row.id,
pageKey: '/ai/workflow',
navTitle: resolveNavTitle(row),
},
});
}