From 81a36d72ccd398c4ce703f46b025aea61d6afe19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Fri, 18 Jul 2025 10:11:13 +0800 Subject: [PATCH] =?UTF-8?q?refactor(agent):=20=E9=87=8D=E6=9E=84=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E4=BD=93=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优化了路由配置,调整了菜单项的层级结构 - 重构了聊天页面的逻辑,简化了配置项 - 优化了历史聊天组件的使用方式 - 调整了智能体列表的展示样式 --- src/api/all/agent.ts | 1 + src/router/routes/modules/agent.ts | 19 ++----- src/views/Agent/Chat/index.vue | 84 +++++++----------------------- src/views/Agent/Index/index.vue | 12 +---- 4 files changed, 26 insertions(+), 90 deletions(-) diff --git a/src/api/all/agent.ts b/src/api/all/agent.ts index d8cee3c..f95c0c9 100644 --- a/src/api/all/agent.ts +++ b/src/api/all/agent.ts @@ -1,6 +1,7 @@ import Http from '@/api'; // 获取聊天智能体 export const getChatAgent = (id: number) => { + console.log('param.id',id); return Http.get(`/v1/agent/getChatAgent/${id}`); }; diff --git a/src/router/routes/modules/agent.ts b/src/router/routes/modules/agent.ts index f36fcb4..24544a0 100644 --- a/src/router/routes/modules/agent.ts +++ b/src/router/routes/modules/agent.ts @@ -7,24 +7,24 @@ const COMPONENTS: AppRouteRecordRaw[] = [ { path: '/agent', name: 'Agent', - redirect: 'agent/listData', + redirect: 'agent/index', meta: { locale: '扣子智能体', icon: IconRepository, requiresAuth: true, requireLogin: true, roles: ['*'], - id: MENU_GROUP_IDS.AGENT, + id: MENU_GROUP_IDS.PROPERTY_ID, }, children: [ { path: 'index', - name: 'AgentListData', + name: 'AgentIndex', component: () => import('@/views/agent/index'), meta: { - locale: '智能体列表', requiresAuth: false, requireLogin: true, + id: MENU_GROUP_IDS.WORK_BENCH_ID, }, }, { @@ -35,16 +35,7 @@ const COMPONENTS: AppRouteRecordRaw[] = [ hideSidebar: true, requiresAuth: false, requireLogin: true, - }, - }, - { - path: 'workFlow', - name: 'AgentWorkFlow', - component: () => import('@/views/agent/work-flow'), - meta: { - hideSidebar: true, - requiresAuth: false, - requireLogin: true, + id: MENU_GROUP_IDS.WORK_BENCH_ID, }, }, ], diff --git a/src/views/Agent/Chat/index.vue b/src/views/Agent/Chat/index.vue index b2a0231..5f42670 100644 --- a/src/views/Agent/Chat/index.vue +++ b/src/views/Agent/Chat/index.vue @@ -4,11 +4,7 @@