From 0f62897b6c82b90f3d0cbac88b75be99e30b70d1 Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期二, 05 十一月 2024 11:16:14 +0800
Subject: [PATCH] 暂时注释掉用户的复制功能

---
 src/components/chat/Chat.vue                                    |    4 ++--
 src/components/chat/components/playBar/phrase/CommonPhrases.vue |   14 ++++++++++----
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue
index 7cdd1a9..2e98bfd 100644
--- a/src/components/chat/Chat.vue
+++ b/src/components/chat/Chat.vue
@@ -109,12 +109,12 @@
 										v-if="item.role === RoleEnum.user && item.content?.values"
 										class="absolute flex items-center right-0 mr-4 space-x-2"
 									>
-										<div class="flex items-center justify-center size-[20px]">
+										<!-- <div class="flex items-center justify-center size-[20px]">
 											<i
 												class="p-2 ywifont ywicon-copy cursor-pointer hover:text-[#0284ff] font-medium !text-[15px] hover:!text-[18px]"
 												@click="copyUserClick(item)"
 											/>
-										</div>
+										</div> -->
 										<div class="flex items-center justify-center size-[20px]">
 											<i
 												class="p-2 ywifont ywicon-cubelifangti cursor-pointer hover:text-[#0284ff] text-[#000] font-[590] !text-[15px] hover:!text-[18px]"
diff --git a/src/components/chat/components/playBar/phrase/CommonPhrases.vue b/src/components/chat/components/playBar/phrase/CommonPhrases.vue
index ec1735c..ad627dc 100644
--- a/src/components/chat/components/playBar/phrase/CommonPhrases.vue
+++ b/src/components/chat/components/playBar/phrase/CommonPhrases.vue
@@ -59,7 +59,7 @@
 </template>
 
 <script setup lang="ts">
-import { ElMessageBox } from 'element-plus';
+import { ElMessageBox, ElMessage } from 'element-plus';
 import { computed, onMounted, reactive, ref } from 'vue';
 import { addUserSample, deleteUserSample, listUserSample, updateUserSample } from '/@/api/ai/chat';
 import { activeGroupType, activeRoomId, activeSampleId, setRoomConfig } from '/@/stores/chatRoom';
@@ -168,14 +168,20 @@
 	activeSampleId.value = item.id;
 };
 const commonChatByUser = (data) => {
-	state.inputCommonPhrases = data.question;
-	addCommonPhrasesData();
+	const question = data.question;
+	const isCommon = commonPhrases.value.findIndex((item) => item.question === question) > -1;
+	if (isCommon) {
+		return ElMessage.warning('璇ラ棶棰樺凡瀛樺湪甯哥敤璇腑');
+	} else {
+		state.inputCommonPhrases = question;
+		addCommonPhrasesData();
+	}
 };
 //#endregion
 onMounted(() => {
 	getCommonPhrases();
 });
-defineExpose({ commonChatByUser,getCommonPhrases });
+defineExpose({ commonChatByUser, getCommonPhrases });
 </script>
 <style scoped lang="scss">
 .container {

--
Gitblit v1.9.3