perf: 优化工作流与智能体编排界面性能
- 使用登录态独立全屏壳层承载编排页面 - 保留鉴权、锁屏、水印及原有设计器功能 - 增加独立路由回归测试
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import agentDesignRoutes from '../routes/external/agent-design';
|
||||
import agentRoutes from '../routes/modules/agent';
|
||||
|
||||
describe('agent design route', () => {
|
||||
it('keeps the standalone designer outside dynamic menu routes', () => {
|
||||
const designRoute = agentDesignRoutes.find(
|
||||
(route) => route.name === 'AgentDesigner',
|
||||
);
|
||||
|
||||
expect(agentRoutes.some((route) => route.name === 'AgentDesigner')).toBe(
|
||||
false,
|
||||
);
|
||||
expect(designRoute).toBeDefined();
|
||||
expect(designRoute?.path).toBe('/ai/agents/designer/:id');
|
||||
expect(designRoute?.meta).toMatchObject({
|
||||
activePath: '/ai/agents',
|
||||
hideInBreadcrumb: true,
|
||||
hideInMenu: true,
|
||||
hideInTab: true,
|
||||
noBasicLayout: true,
|
||||
openInNewWindow: true,
|
||||
});
|
||||
expect(designRoute?.meta?.ignoreAccess).not.toBe(true);
|
||||
expect(designRoute?.component).toBeTypeOf('function');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import workflowRoutes from '../routes/modules/workflow';
|
||||
|
||||
describe('workflow design route', () => {
|
||||
it('uses the authenticated standalone shell without exposing a menu or tab', () => {
|
||||
const designRoute = workflowRoutes.find(
|
||||
(route) => route.name === 'WorkflowDesign',
|
||||
);
|
||||
|
||||
expect(designRoute).toBeDefined();
|
||||
expect(designRoute?.path).toBe('/ai/workflow/design');
|
||||
expect(designRoute?.meta).toMatchObject({
|
||||
activePath: '/ai/workflow',
|
||||
hideInBreadcrumb: true,
|
||||
hideInMenu: true,
|
||||
hideInTab: true,
|
||||
noBasicLayout: true,
|
||||
});
|
||||
expect(designRoute?.meta?.ignoreAccess).not.toBe(true);
|
||||
expect(designRoute?.component).toBeTypeOf('function');
|
||||
});
|
||||
});
|
||||
23
easyflow-ui-admin/app/src/router/routes/external/agent-design.ts
vendored
Normal file
23
easyflow-ui-admin/app/src/router/routes/external/agent-design.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { $t } from '#/locales';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: 'AgentDesigner',
|
||||
path: '/ai/agents/designer/:id',
|
||||
component: () =>
|
||||
import('#/views/ai/agents/AgentDesignerStandaloneView.vue'),
|
||||
meta: {
|
||||
title: $t('menus.ai.agents'),
|
||||
openInNewWindow: true,
|
||||
hideInMenu: true,
|
||||
hideInTab: true,
|
||||
hideInBreadcrumb: true,
|
||||
noBasicLayout: true,
|
||||
activePath: '/ai/agents',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default routes;
|
||||
@@ -1,19 +1,6 @@
|
||||
import type {RouteRecordRaw} from 'vue-router';
|
||||
|
||||
import {$t} from '#/locales';
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
name: 'AgentDesigner',
|
||||
path: '/ai/agents/designer/:id',
|
||||
component: () => import('#/views/ai/agents/AgentDesigner.vue'),
|
||||
meta: {
|
||||
title: $t('menus.ai.agents'),
|
||||
openInNewWindow: true,
|
||||
hideInMenu: true,
|
||||
activePath: '/ai/agents',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'AgentChat',
|
||||
path: '/ai/agent-chat',
|
||||
|
||||
@@ -8,11 +8,15 @@ const routes: RouteRecordRaw[] = [
|
||||
icon: 'ant-design:apartment-outlined',
|
||||
title: '工作流设计',
|
||||
hideInMenu: true,
|
||||
hideInTab: true,
|
||||
hideInBreadcrumb: true,
|
||||
noBasicLayout: true,
|
||||
activePath: '/ai/workflow',
|
||||
},
|
||||
name: 'WorkflowDesign',
|
||||
path: '/ai/workflow/design',
|
||||
component: () => import('#/views/ai/workflow/WorkflowDesign.vue'),
|
||||
component: () =>
|
||||
import('#/views/ai/workflow/WorkflowDesignStandaloneView.vue'),
|
||||
},
|
||||
{
|
||||
meta: {
|
||||
|
||||
Reference in New Issue
Block a user