From 8ed40110ae35524091e8d765926c6540436427aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Mon, 28 Jul 2025 13:47:40 +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=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80=E5=92=8C?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -调整了智能体卡片的布局结构,优化了标题和描述的显示方式 - 改进了历史对话的展示样式,增加了滚动指示器 - 统一了标签和图标的样式,提升了视觉一致性 - 优化了搜索框和卡片列表的样式,提高了用户体验 --- src/router/routes/modules/agent.ts | 12 +- .../agent/chat/components/HistoryChat.vue | 2 +- src/views/agent/chat/components/history.scss | 10 +- src/views/agent/chat/index.vue | 9 +- src/views/agent/index/index.vue | 6 +- src/views/agent/index/style.scss | 35 +- .../work-flow/components/HistoryChat.vue | 79 ++-- .../agent/work-flow/components/history.scss | 367 ++++++++++-------- 8 files changed, 294 insertions(+), 226 deletions(-) diff --git a/src/router/routes/modules/agent.ts b/src/router/routes/modules/agent.ts index 9d40cf5..c97b82d 100644 --- a/src/router/routes/modules/agent.ts +++ b/src/router/routes/modules/agent.ts @@ -22,19 +22,11 @@ const COMPONENTS: AppRouteRecordRaw[] = [ name: 'AgentIndex', component: () => import('@/views/agent/index'), meta: { + locale:'ai应用', requiresAuth: false, requireLogin: true, }, - }, - { - path: 'index', - name: 'AgentIndex', - component: () => import('@/views/agent/index'), - meta: { - requiresAuth: false, - requireLogin: true, - }, - }, + } ], }, ]; diff --git a/src/views/agent/chat/components/HistoryChat.vue b/src/views/agent/chat/components/HistoryChat.vue index a50095f..b68b64b 100644 --- a/src/views/agent/chat/components/HistoryChat.vue +++ b/src/views/agent/chat/components/HistoryChat.vue @@ -2,7 +2,7 @@
- +
diff --git a/src/views/agent/chat/components/history.scss b/src/views/agent/chat/components/history.scss index 9c9ed88..3ac728c 100644 --- a/src/views/agent/chat/components/history.scss +++ b/src/views/agent/chat/components/history.scss @@ -22,14 +22,16 @@ .image-container { height: 400px; overflow: hidden; - border-radius: 8px; + border-radius: 10px; } .image-container img { width: 100%; height: auto; + padding: 24px; aspect-ratio: 1 / 1; object-fit: cover; + border-radius: 10px; } } @@ -94,12 +96,12 @@ .usage-info { width: 79px; - height: 24px; + height: 34px; position: relative; .count { left: 0px; - top: 0px; + top: 10px; position: absolute; color: var(--Text-2, #3C4043); font-size: 16px; @@ -110,7 +112,7 @@ .label { left: 43px; - top: 3px; + top: 10px; position: absolute; color: var(--Text-3, #737478); font-size: 12px; diff --git a/src/views/agent/chat/index.vue b/src/views/agent/chat/index.vue index 5781bd2..4b98134 100644 --- a/src/views/agent/chat/index.vue +++ b/src/views/agent/chat/index.vue @@ -83,12 +83,12 @@ const initChat = async () => { Object.assign(cozeInfo, data.info); await loadScript('https://lf-cdn.coze.cn/obj/unpkg/flow-platform/chat-app-sdk/1.2.0-beta.10/libs/cn/index.js'); - let cozeConfig = await cozeWebSdkConfig(data.info.bot_id, data.info.name, data.info.auth); + let cozeConfig = await cozeWebSdkConfig(data.info.bot_id, data.info.name, data.info.auth, data.info.user_info); cozeWebSDK = cozeWebSDK = new CozeWebSDK.WebChatClient(cozeConfig); showChatPage(); }; -const cozeWebSdkConfig = (botId, name, auth) => { +const cozeWebSdkConfig = (botId, name, auth, userInfo) => { auth.onRefreshToken = function () { return ''; }; @@ -108,11 +108,12 @@ const cozeWebSdkConfig = (botId, name, auth) => { icon: '', zIndex: 1000, }, - footer:{ - expressionText:"内容由AI生成,无法确保真实准确,仅供参考。", + footer: { + expressionText: '内容由AI生成,无法确保真实准确,仅供参考。', }, }, auth: auth, + userInfo: userInfo, header: { isShow: true, isNeedClose: false, diff --git a/src/views/agent/index/index.vue b/src/views/agent/index/index.vue index c55e5f5..5f467af 100644 --- a/src/views/agent/index/index.vue +++ b/src/views/agent/index/index.vue @@ -1,7 +1,7 @@ -
+
{{ item.name }} @@ -32,7 +32,7 @@