From 9f880255e8961cd26c52a87ad40bada377bab98c Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期二, 05 十一月 2024 17:17:36 +0800
Subject: [PATCH] primary

---
 src/components/chat/components/playBar/PlayBar.vue |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/src/components/chat/components/playBar/PlayBar.vue b/src/components/chat/components/playBar/PlayBar.vue
index e9ba850..e5749f8 100644
--- a/src/components/chat/components/playBar/PlayBar.vue
+++ b/src/components/chat/components/playBar/PlayBar.vue
@@ -126,14 +126,23 @@
 import { ElMessage } from 'element-plus';
 import _ from 'lodash';
 import getCaretCoordinates from 'textarea-caret';
-import { computed, nextTick, ref } from 'vue';
+import { computed, nextTick, ref, toRefs, watch } from 'vue';
 import InfoDetail from './InfoDetail.vue';
 import CommonPhrases from './phrase/CommonPhrases.vue';
 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 props = defineProps(['isTalking', 'isHome']);
+const props = defineProps({
+	isTalking: Boolean,
+	isHome: Boolean,
+	setCommonQuestionInfo: {
+		type: Object,
+		default: {},
+	},
+});
+
+const { setCommonQuestionInfo } = toRefs(props);
 const voicePageIsShow = defineModel('voicePageIsShow', {
 	type: Boolean,
 	default: false,
@@ -429,11 +438,10 @@
 
 //#region ====================== 褰撳墠搴旂敤鍦烘櫙 ======================
 const currentGroupTypeIsShow = computed(() => !!activeGroupType.value);
-
 const groupTypeClick = (item) => {
 	activeGroupType.value = item;
-
 	inputRef.value.focus();
+	commonPhrasesRef.value.getCommonPhrases();
 };
 
 // 鍏抽棴褰撳墠 groupType 闈㈡澘
@@ -451,6 +459,16 @@
 	inputValue.value = val;
 	isShowPhrase.value = false;
 };
+watch(setCommonQuestionInfo, (val) => {
+	if (!props.isHome) {
+		let obj = {
+			id: val?.historyId,
+			question: val?.content.values,
+		};
+		commonPhrasesRef.value.commonChatByUser(obj);
+		isShowPhrase.value = true;
+	}
+});
 //#endregion
 </script>
 <style scoped lang="scss">

--
Gitblit v1.9.3