From 43521ebfcdd69b6e6efec4dae84959c3d793ab0a Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期五, 11 十月 2024 11:39:53 +0800
Subject: [PATCH] 聊天项增加 key

---
 src/components/chat/hooks/useScrollLoad.ts |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/components/chat/hooks/useScrollLoad.ts b/src/components/chat/hooks/useScrollLoad.ts
index 9b4e761..1366c96 100644
--- a/src/components/chat/hooks/useScrollLoad.ts
+++ b/src/components/chat/hooks/useScrollLoad.ts
@@ -1,11 +1,11 @@
-import { Ref, ShallowRef, nextTick, onBeforeUnmount, ref } from 'vue';
+import { Ref, ShallowRef, nextTick, onBeforeUnmount, ref, unref } from 'vue';
 import { LOAD_CHAT_LIMIT } from '../constants';
 import { AnswerType, ChatContent, ChatMessage, RoleEnum } from '../model/types';
 import { GetHistoryAnswer, QueryHistoryDetail } from '/@/api/ai/chat';
 
 type UseScrollLoadOption = {
 	container: ShallowRef<HTMLDivElement>;
-	historyGroupId: string;
+	historyGroupId: string | Ref<string>;
 	messageList: Ref<ChatMessage[]>;
 	parseAnswerContent: (res: any) => ChatContent;
 };
@@ -79,7 +79,7 @@
 	 */
 	const loadRangeData = async (lastEnd = nextUserMsgEndIndex.value) => {
 		const res = await QueryHistoryDetail({
-			history_group_id: historyGroupId,
+			history_group_id: unref(historyGroupId),,
 			last_end: lastEnd,
 			last_count: LOAD_CHAT_LIMIT,
 		});
@@ -97,7 +97,6 @@
 	//婊氬姩鐩戝惉
 	async function onChatListScroll() {
 		if (container.value.scrollTop == 0) {
-			console.log('婊氬姩鍒伴《閮ㄤ簡');
 
 			// 鏇村鏁版嵁姝e湪鍔犺浇鏃�
 			if (moreIsLoading.value) {

--
Gitblit v1.9.3