fix: 统一详情页返回上级列表

- 修正管理端插件、工作流与系统详情页返回目标

- 修正用户中心执行记录与助手详情返回目标

- 保留审批页签及关联资源筛选上下文
This commit is contained in:
2026-07-28 12:23:36 +08:00
parent 1404c2ddc5
commit dc35ddc3e4
14 changed files with 144 additions and 11 deletions

View File

@@ -0,0 +1,20 @@
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { describe, expect, it } from 'vitest';
function readViewSource(relativePath: string) {
return readFileSync(resolve('app/src/views', relativePath), 'utf8');
}
describe('detail return navigation', () => {
it.each([
['execHistory/details/index.vue', '/execHistory'],
['assistantMarket/assistant/index.vue', '/assistantMarket'],
])('returns %s to its fixed parent list', (relativePath, parentPath) => {
const source = readViewSource(relativePath);
expect(source).not.toMatch(/router\.(?:back|go)\s*\(/);
expect(source).toContain(`path: '${parentPath}'`);
});
});

View File

@@ -234,7 +234,11 @@ function currentSwitchingRoundIds() {
<ElMain
class="border-border bg-background !flex flex-col rounded-xl border !p-6"
>
<ElSpace :size="16" class="cursor-pointer" @click="router.back()">
<ElSpace
:size="16"
class="cursor-pointer"
@click="router.replace({ path: '/assistantMarket' })"
>
<ElIcon :size="24"><ArrowLeft /></ElIcon>
<ElSpace :size="12">
<ElAvatar :size="36" :src="botInfo.icon || defaultBotAvatar" />

View File

@@ -81,7 +81,11 @@ const steps = computed(() => {
<template>
<ElContainer class="bg-background-deep h-full">
<ElHeader class="!p-8 !pb-0" height="auto">
<ElSpace class="cursor-pointer" :size="10" @click="router.back()">
<ElSpace
class="cursor-pointer"
:size="10"
@click="router.replace({ path: '/execHistory' })"
>
<ElIcon size="24"><ArrowLeft /></ElIcon>
<h1 class="text-2xl font-medium">
{{ route.query.title }}