From be3843585ad0740d7a08f2358d210d01ecf8c47c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=BF=97=E5=86=9B?= <543024265@qq.com> Date: Tue, 29 Jul 2025 16:00:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor(agent):=20=E4=BC=98=E5=8C=96=E5=AE=A2?= =?UTF-8?q?=E6=9C=8D=E5=92=8C=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=92=8C=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整了客服和工作流界面的栅格布局,优化了不同屏幕大小下的显示效果- 改进了历史聊天记录的展示方式,增加了 tooltip 和自适应布局 - 统一了聊天窗口的样式,增加了反馈功能- 优化了工作流内容区域的样式,使其更加适应长内容展示 --- .../agent/chat/components/HistoryChat.vue | 25 +------ src/views/agent/chat/components/history.scss | 36 ++++++++-- src/views/agent/chat/index.vue | 66 ++++++++++++------- src/views/agent/chat/style.scss | 4 ++ src/views/agent/index/style.scss | 1 - .../work-flow/components/DynamicForm.vue | 2 +- .../work-flow/components/HistoryChat.vue | 36 ++-------- .../agent/work-flow/components/history.scss | 1 + src/views/agent/work-flow/index.vue | 5 +- src/views/agent/work-flow/style.scss | 4 ++ 10 files changed, 94 insertions(+), 86 deletions(-) diff --git a/src/views/agent/chat/components/HistoryChat.vue b/src/views/agent/chat/components/HistoryChat.vue index 479aa92..ff992ed 100644 --- a/src/views/agent/chat/components/HistoryChat.vue +++ b/src/views/agent/chat/components/HistoryChat.vue @@ -7,7 +7,9 @@
-
{{ cozeInfo.name }}
+ +
{{ cozeInfo.name }}
+
@@ -34,7 +36,6 @@ diff --git a/src/views/agent/chat/components/history.scss b/src/views/agent/chat/components/history.scss index 8957438..89b5f28 100644 --- a/src/views/agent/chat/components/history.scss +++ b/src/views/agent/chat/components/history.scss @@ -37,7 +37,7 @@ .info-section { align-self: stretch; - padding: 10px 0 0 10px; + padding: 10px 10px 0 12px; display: flex; justify-content: space-between; align-items: flex-start; @@ -55,6 +55,19 @@ font-weight: 400; line-height: 26px; padding: 10px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + max-width: 150px; + flex-shrink: 0; + } + + @media (max-width: 768px) { + .title { + font-size: 16px; + padding: 8px; + max-width: 100px; + } } .tag { @@ -92,16 +105,19 @@ } } } - .usage-info { padding: 12px; - margin-right: 12px; + display: flex; + align-items: center; + gap: 8px; + .count { color: var(--Text-2, #3C4043); font-size: 16px; font-family: 'Alibaba PuHuiTi', sans-serif; font-weight: 400; line-height: 24px; + white-space: nowrap; } .label { @@ -110,8 +126,21 @@ font-family: 'Alibaba PuHuiTi', sans-serif; font-weight: 400; line-height: 20px; + white-space: nowrap; + } + @media (max-width: 768px) { + flex-direction: column; + align-items: flex-start; + gap: 4px; + .count { + font-size: 14px; + } + .label { + font-size: 10px; + } } } + } .description-section { @@ -135,7 +164,6 @@ } - .history-section { align-self: stretch; flex: 1 1 0; diff --git a/src/views/agent/chat/index.vue b/src/views/agent/chat/index.vue index e59834a..2927681 100644 --- a/src/views/agent/chat/index.vue +++ b/src/views/agent/chat/index.vue @@ -2,36 +2,38 @@
返回空间
- - + - - + -
+
-
+
@@ -107,7 +109,7 @@ const cozeInfo = reactive({ let cozeWebSDK = null; const initChat = async () => { const { code, data } = await getChatAgent(query.id); - if (code != 200) { + if (code !== 200) { return false; } @@ -129,15 +131,31 @@ const cozeWebSdkConfig = (botId, name, auth, userInfo) => { ui: { chatBot: { el: document.getElementById('coze-chat-container'), - width: '95%', + width: '100%', height: '100%', title: name, isNeedFunctionCallMessage: true, + feedback: { + isNeedFeedback: true, + feedbackPanel: { + title: '您对这个回答有什么看法?请告诉我们', + placeholder: '请详细描述您的问题...', + tags: [ + { + label: '信息不正确', + }, + { + label: '涉及敏感信息', + isNeedDetail: true, + }, + ], + }, + }, }, base: { icon: '', zIndex: 1000, - lang:'zh-CN' + lang: 'zh-CN', }, footer: { expressionText: '内容由AI生成,无法确保真实准确,仅供参考。', @@ -147,9 +165,9 @@ const cozeWebSdkConfig = (botId, name, auth, userInfo) => { }, conversations: { isNeed: true, - isNeedAddNewConversationBoolean: true, - isNeedQuoteBoolean: true, - } + isNeedAddNewConversation: true, + isNeedQuote: true, + }, }, auth: auth, userInfo: userInfo, diff --git a/src/views/agent/chat/style.scss b/src/views/agent/chat/style.scss index e2128d4..32cc581 100644 --- a/src/views/agent/chat/style.scss +++ b/src/views/agent/chat/style.scss @@ -40,5 +40,9 @@ } } + .toggle-btn{ + margin-top: 10px; + margin-bottom: 10px; + } } diff --git a/src/views/agent/index/style.scss b/src/views/agent/index/style.scss index abc9f94..6fb3d1e 100644 --- a/src/views/agent/index/style.scss +++ b/src/views/agent/index/style.scss @@ -124,7 +124,6 @@ gap: 4px; .status-icon { - width: 12px; height: 12px; } diff --git a/src/views/agent/work-flow/components/DynamicForm.vue b/src/views/agent/work-flow/components/DynamicForm.vue index d3cfb62..b7ccc21 100644 --- a/src/views/agent/work-flow/components/DynamicForm.vue +++ b/src/views/agent/work-flow/components/DynamicForm.vue @@ -79,7 +79,7 @@ const handleSubmit = async () => { padding: 24px; border: 1px solid #d7d7d9; /* 添加灰色边框 */ background: var(--BG-White, white); - height: 70vh; + min-height: 70vh; :deep(.arco-input-wrapper), :deep(.arco-textarea-wrapper) { diff --git a/src/views/agent/work-flow/components/HistoryChat.vue b/src/views/agent/work-flow/components/HistoryChat.vue index 0ff5bb0..37d2ef3 100644 --- a/src/views/agent/work-flow/components/HistoryChat.vue +++ b/src/views/agent/work-flow/components/HistoryChat.vue @@ -2,18 +2,15 @@
- +
-
{{cozeInfo.name}}
+
{{ cozeInfo.name }}
- +
工作流
@@ -30,16 +27,14 @@
- {{cozeInfo.description}} + {{ cozeInfo.description }}
-