From c9b6d9a10160ca1d18237a0728bac87ec8ff16da Mon Sep 17 00:00:00 2001
From: gerson <1405270578@qq.com>
Date: 星期二, 21 一月 2025 16:16:43 +0800
Subject: [PATCH] 屏蔽非当前聊天室chat_start

---
 src/components/chat/Chat.vue |   42 ++++++++++++++++++++++++++----------------
 1 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue
index 1247ef7..edbcb0d 100644
--- a/src/components/chat/Chat.vue
+++ b/src/components/chat/Chat.vue
@@ -21,17 +21,20 @@
 
 		<!-- 杈撳叆鍖哄煙 -->
 		<template #input-area>
-			<PlayBar
-				ref="playBarRef"
-				v-model:voicePageIsShow="voicePageIsShow"
-				:isTalking="isTalking"
-				:isHome="false"
-				:msgList="computedMessageList"
-				v-model="messageContent.values"
-				@sendClick="sendClick"
-				@stopGenClick="stopGenClick"
-				:style="{ width: chatWidth }"
-			/>
+			<div class="w-full ">
+				<PlayBar
+					ref="playBarRef"
+					v-model:voicePageIsShow="voicePageIsShow"
+					:isTalking="isTalking"
+					:isHome="false"
+					:msgList="computedMessageList"
+					v-model="messageContent.values"
+					@sendClick="sendClick"
+					@stopGenClick="stopGenClick"
+					:style="{ width: chatWidth }"
+					class="mx-auto"
+				/>
+			</div>
 		</template>
 
 		<!-- 鎶藉眽 -->
@@ -78,7 +81,9 @@
 import { useSyncMsg } from './hooks/useSyncMsg';
 const containerRef = useCompRef(ChatContainer);
 const chatListDom = computed(() => containerRef.value?.chatListDom);
-
+const scrollToBottom = () => {
+	containerRef.value?.scrollToBottom();
+};
 const { loadReplyData, parseContent, parseExtraContent, convertProcessItem, convertProcessToStep, formatShowTimeYear } = useLoadData();
 const voicePageIsShow = ref(false);
 let isTalking = ref(false);
@@ -427,9 +432,17 @@
 	loadReplyData,
 });
 useSyncMsg({
-	msgList: computedMessageList,
+	msgList: messageList,
 	updateLoadIndex,
 	historyGroupId: currentRouteId,
+	checkCanSync: (data) => {
+		return !isTalking.value && !moreIsLoading.value;
+	},
+	showTip: (data) => {
+		playBarRef.value.showSyncTip(data);
+	},
+	loadReplyData,
+	scrollToBottom,
 });
 const chatListLoading = ref(true);
 
@@ -443,9 +456,6 @@
 		values: activeChatRoom.value?.title,
 	};
 	sendChatMessage();
-};
-const scrollToBottom = () => {
-	containerRef.value?.scrollToBottom();
 };
 
 const initHistoryChat = () => {

--
Gitblit v1.9.3