From 92d2ea48d343fc00d81905167d033c40200ea716 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期二, 04 三月 2025 15:56:19 +0800
Subject: [PATCH] 快速引用;去重

---
 src/components/chat/hooks/useAssistantContentOpt.ts |   26 +++++++-------------------
 1 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/src/components/chat/hooks/useAssistantContentOpt.ts b/src/components/chat/hooks/useAssistantContentOpt.ts
index f03e8d9..ff2ec9f 100644
--- a/src/components/chat/hooks/useAssistantContentOpt.ts
+++ b/src/components/chat/hooks/useAssistantContentOpt.ts
@@ -10,13 +10,11 @@
 
 export type AssistantContentOptOption = {
 	sendChatMessage: any;
-	displayMessageList: ComputedRef<ChatMessage[]>;
 };
 
 export const useAssistantContentOpt = (option: AssistantContentOptOption) => {
-	const { sendChatMessage, displayMessageList } = option;
+	const { sendChatMessage } = option;
 	const { copy } = useClipboard();
-	const preQuestion = ref(null);
 
 	const copyClick = (item) => {
 		const type = item.content.type;
@@ -37,7 +35,6 @@
 			answer_state: toSetState,
 		});
 		item.state = toSetState;
-		
 	};
 
 	const unLikeClick = async (item) => {
@@ -47,8 +44,6 @@
 			answer_state: toSetState,
 		});
 		item.state = toSetState;
-
-	
 	};
 	const feedbackPosition = ref({
 		x: 0,
@@ -89,15 +84,10 @@
 	// 		feedbackContent.value = '';
 	// 	}
 	// );
-	const showAskMore = computed(() => {
-		if (!displayMessageList.value || displayMessageList.value.length === 0) return false;
-		const last = displayMessageList.value.at(-1);
-		const isShow = last?.role === RoleEnum.assistant && last?.content?.values && last.content?.askMoreList?.length > 0;
-		return isShow && !isSharePage ;
-	});
+
 
 	const showFixQuestion = (item) => {
-		const isShow = item?.role === RoleEnum.assistant && item?.content?.values && item.content?.origin?.err_json?.fix_question;
+		const isShow = item?.role === RoleEnum.assistant  && item.content?.origin?.sample_question?.length > 0 && !isSharePage.value;
 		return isShow;
 	};
 	const askMoreClick = (item) => {
@@ -106,15 +96,15 @@
 	};
 
 	const fixQuestionClick = (item, originData) => {
-		if (!item.question) return;
-		preQuestion.value = originData?.question;
+		if (!item) return;
+		// preQuestion.value = originData?.question;
 		try {
 			sendChatMessage({
 				type: AnswerType.Text,
-				values: item.question,
+				values: item,
 			});
 		} finally {
-			preQuestion.value = null;
+			// preQuestion.value = null;
 		}
 	};
 
@@ -131,8 +121,6 @@
 		feedbackClick,
 		askMoreClick,
 		fixQuestionClick,
-		preQuestion,
-		showAskMore,
 		showFixQuestion,
 	};
 };

--
Gitblit v1.9.3