From 1ea31dce9d4b622fad0fc850b0d96fd05e7bafe7 Mon Sep 17 00:00:00 2001
From: gerson <1405270578@qq.com>
Date: 星期日, 09 二月 2025 23:36:32 +0800
Subject: [PATCH] aa

---
 src/components/chat/Chat.vue |   36 ++++++++++++++++++++++--------------
 1 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue
index 0c39d36..410008a 100644
--- a/src/components/chat/Chat.vue
+++ b/src/components/chat/Chat.vue
@@ -105,6 +105,15 @@
 const preQuestion = ref(null);
 
 let lastAxiosSource: CancelTokenSource = null;
+
+// 閫氳繃淇敼 isTalking 鏉ヨЕ鍙戞洿鏂�
+const triggerRefresh = () => {
+	isTalking.value = !isTalking.value;
+
+	nextTick(() => {
+		isTalking.value = !isTalking.value;
+	});
+};
 const questionAi = async (text) => {
 	let judgeParams = null;
 	if (!preQuestion.value) {
@@ -153,7 +162,6 @@
 		};
 		const checkReportEmpty = () => {
 			const isEmpty = !questionRes?.reports || questionRes?.reports?.length === 0;
-
 			return isEmpty;
 		};
 		questionStreamByPost(
@@ -180,6 +188,7 @@
 							}),
 						});
 					}
+					triggerRefresh();
 					return;
 					// chunkRes.value = '鍑嗗鏁版嵁鍒嗘瀽';
 				}
@@ -269,20 +278,20 @@
 					return;
 				}
 
-				// 鏆傛椂涓嶈�冭檻澶氫釜 report鎯呭喌
+				// 鏆傛椂涓嶈�冭檻澶氫釜 report 鎯呭喌
 
-				if (lastIsResult && chunkRes.mode !== 'finish') {
-					const lastTow = computedMessageList.value.at(-1);
-					lastTow.stepGroup.at(-1).value.at(-1).finishLoading = true;
-					// lastTow.content.values = lastTow.content.values.concat([]);
+				// if (lastIsResult && chunkRes.mode !== 'finish') {
+				// 	const lastTow = computedMessageList.value.at(-1);
+				// 	lastTow.stepGroup.at(-1).value.at(-1).finishLoading = true;
+				// 	// lastTow.content.values = lastTow.content.values.concat([]);
 
-					// 寮�濮嬪鍔犳柊鐨� stepGroup
-					computedMessageList.value.at(-1).stepGroup.push({
-						value: [],
-						isShow: true,
-					});
-					lastIsResult = false;
-				}
+				// 	// 寮�濮嬪鍔犳柊鐨� stepGroup
+				// 	computedMessageList.value.at(-1).stepGroup.push({
+				// 		value: [],
+				// 		isShow: true,
+				// 	});
+				// 	lastIsResult = false;
+				// }
 				const lastGroup = computedMessageList.value.at(-1).stepGroup.at(-1);
 				const stepList = lastGroup?.value ?? [];
 				const currentTimeStamp = new Date().getTime();
@@ -290,7 +299,6 @@
 				if (chunkRes.mode === 'finish') {
 					stepList.at(-1).ms = ms;
 					isTalking.value = false;
-
 					return;
 				}
 

--
Gitblit v1.9.3