From 1622a4d80dd86d0fde35af6908937f9be670fee3 Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期二, 17 十二月 2024 10:13:00 +0800
Subject: [PATCH] 停止生成

---
 src/components/chat/components/playBar/PlayBar.vue |   59 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 47 insertions(+), 12 deletions(-)

diff --git a/src/components/chat/components/playBar/PlayBar.vue b/src/components/chat/components/playBar/PlayBar.vue
index cd7bf68..673813b 100644
--- a/src/components/chat/components/playBar/PlayBar.vue
+++ b/src/components/chat/components/playBar/PlayBar.vue
@@ -2,7 +2,7 @@
 	<div class="playInput hl_input rounded-[22px] input-border input-shadow">
 		<!-- 搴旂敤鍦烘櫙 -->
 		<div class="application-scenarios absolute bottom-[114%] left-4">
-			<div class="flex-items-center space-x-2 set-next-group-type">
+			<div class="flex-items-center space-x-2" :class="isHome ? 'set-next-group-type' : ''">
 				<div
 					class="border border-gray-400 border-solid h-8 flex-items-center px-3 py-2 rounded-2xl cursor-pointer space-x-1 hover:bg-[#cae3ff]"
 					:class="{ 'bg-[#c5e0ff]': activeGroupType === item, '!text-[#1c86ff]': activeGroupType === item }"
@@ -65,8 +65,8 @@
 				class="absolute rounded-md bg-white border border-solid border-gray-400 py-2 z-10"
 				:style="{ left: popUpPosition.left + 'px', bottom: popUpPosition.bottom + 'px' }"
 			>
-				<div class="font-bold text-sm text-nowrap overflow-hidden text-ellipsis max-w-80 mb-1 px-2">Ctrl+鏁板瓧蹇嵎杈撳叆</div>
-				<div class="text-gray-400 text-sm text-nowrap overflow-hidden text-ellipsis max-w-80 mb-1 px-2">{{ inputValue }}</div>
+				<div class="font-bold text-nowrap overflow-hidden text-ellipsis max-w-80 mb-1 px-2">Ctrl+鏁板瓧蹇嵎杈撳叆</div>
+				<div class="text-gray-400 text-nowrap overflow-hidden text-ellipsis max-w-80 mb-1 px-2">{{ inputValue }}</div>
 				<div class="max-w-96 flex flex-col">
 					<div
 						class="hover:bg-gray-300 py-2 cursor-pointer px-5 text-nowrap overflow-hidden text-ellipsis"
@@ -74,7 +74,7 @@
 						:key="index"
 						@click="similarClick(item)"
 					>
-						<span class="text-sm text-gray-500 pr-1.5">{{ index + 1 }}</span>
+						<span class="text-gray-500 pr-1.5">{{ index + 1 }}</span>
 						<template v-if="sentenceSplitMap?.[item.question]">
 							<template v-for="part in sentenceSplitMap[item.question]">
 								<span v-if="part.isKeyword" class="text-blue-400 font-bold cursor-pointer">{{ part.partStr }}</span>
@@ -94,11 +94,31 @@
 					<!-- <el-button title="AI璇煶瀵硅瘽" class="cursor-pointer" link style="margin-left: unset" @click="audioChangeWord">
 				<img src="/static/images/wave/HeadImg.png" class="set-img-icon box-border" />
 			</el-button> -->
+					<el-button
+						title="娓呴櫎"
+						class="cursor-pointer"
+						link
+						style="margin-left: unset"
+						@click="clearTextarea"
+						icon="ele-Close"
+						v-if="inputValue"
+					>
+					</el-button>
+					<el-button class="cursor-pointer" link>
+						<el-tooltip placement="top" content="鍋滄鐢熸垚" v-if="isTalking">
+							<div
+								class="size-[28px] stop-breathe rounded-full flex-center border-2 border-solid border-black text-black"
+								@click="emits('stopGenClick')"
+							>
+								<span class="ywifont ywicon-jieshu"></span>
+							</div>
+						</el-tooltip>
 
-					<el-button title="鍙戦��" class="cursor-pointer" link @click="emits('sendClick')">
-						<div class="send">
-							<img src="/static/images/wave/QueryImg.png" />
-						</div>
+						<el-tooltip v-else placement="top" content="鍙戦��">
+							<div class="size-[36px] rounded-full bg-black flex-center" @click="emits('sendClick')">
+								<img src="/static/images/wave/QueryImg.png" />
+							</div>
+						</el-tooltip>
 					</el-button>
 				</div>
 			</div>
@@ -124,7 +144,7 @@
 import { onClickOutside } from '@vueuse/core';
 import type { InputInstance } from 'element-plus';
 import { ElMessage } from 'element-plus';
-import _ from 'lodash';
+import { sortBy } from 'lodash-es';
 import getCaretCoordinates from 'textarea-caret';
 import { computed, nextTick, ref, toRefs, watch } from 'vue';
 import InfoDetail from './InfoDetail.vue';
@@ -132,7 +152,7 @@
 import VoicePage from './voicePage/VoicePage.vue';
 import { getMetricsNames, querySimilarityHistory } from '/@/api/ai/chat';
 import { activeGroupType, groupTypeList, groupTypeMapIcon } from '/@/stores/chatRoom';
-const emits = defineEmits(['sendClick', 'showUpChatClick', 'showDownChatClick']);
+const emits = defineEmits(['sendClick', 'showUpChatClick', 'showDownChatClick', 'stopGenClick']);
 const props = defineProps({
 	isTalking: Boolean,
 	isHome: Boolean,
@@ -207,7 +227,9 @@
 onClickOutside(tipEleRef, () => {
 	triggerShow.value = false;
 });
-
+const clearTextarea = () => {
+	inputValue.value = '';
+};
 const inputText = (text) => {
 	nextTick(() => {
 		setTimeout(() => {
@@ -315,7 +337,7 @@
 			};
 
 			// 鎸� startIndex 鎺掑簭锛屾秷闄ゅ郊姝や箣闂撮噸鍚堝厓绱�
-			sentenceMatchList = _.sortBy(sentenceMatchList, (item) => item.startIndex).filter((value, index, array) => {
+			sentenceMatchList = sortBy(sentenceMatchList, (item) => item.startIndex).filter((value, index, array) => {
 				if (nextIsMerge) {
 					checkNextIsMerge(value, index, array);
 					return false;
@@ -615,4 +637,17 @@
 		}
 	}
 }
+
+.stop-breathe {
+	@keyframes breathe {
+		0%,
+		100% {
+			transform: scale(1);
+		}
+		50% {
+			transform: scale(1.35);
+		}
+	}
+	animation: breathe 3s infinite ease-in-out;
+}
 </style>

--
Gitblit v1.9.3