From a5bac22f6e10b1b662e5ae41055714f234b63d37 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期四, 03 四月 2025 17:27:04 +0800 Subject: [PATCH] GIS系统隐藏 --- src/components/chat/components/playBar/PlayBar.vue | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/src/components/chat/components/playBar/PlayBar.vue b/src/components/chat/components/playBar/PlayBar.vue index 94e7d97..abe07ac 100644 --- a/src/components/chat/components/playBar/PlayBar.vue +++ b/src/components/chat/components/playBar/PlayBar.vue @@ -146,6 +146,18 @@ </div> </el-tooltip> + <el-tooltip v-if="isSupportSpeech" placement="top" :content="recordState.isRecording ? '鍋滄璇煶杈撳叆' : '璇煶杈撳叆'"> + <div class="cursor-pointer size-[24px] relative !z-10 rounded flex-center hover:bg-[#f2f2f2]" @click="speechClick"> + <div v-if="recordState.isRecording" class="cursor-pointer flex items-center space-x-[1px]"> + <div class="w-[2px] h-[6px] bg-[#0284ff] animate-[soundWave_1.5s_ease-in-out_infinite]"></div> + <div class="w-[2px] h-[9px] bg-[#0284ff] animate-[soundWave_1.5s_ease-in-out_infinite_0.1s]"></div> + <div class="w-[2px] h-[12px] bg-[#0284ff] animate-[soundWave_1.5s_ease-in-out_infinite_0.2s]"></div> + <div class="w-[2px] h-[9px] bg-[#0284ff] animate-[soundWave_1.5s_ease-in-out_infinite_0.3s]"></div> + <div class="w-[2px] h-[6px] bg-[#0284ff] animate-[soundWave_1.5s_ease-in-out_infinite_0.4s]"></div> + </div> + <span v-else class="ywifont ywicon-maikefeng !text-[20px]"></span> + </div> + </el-tooltip> <el-tooltip placement="top" content="鍋滄鐢熸垚" v-if="isTalking"> <div class="cursor-pointer !ml-0 size-[38px] bg-[#1d86ff] relative !z-10 rounded-full flex-center" link> <div @@ -157,7 +169,7 @@ </div> </el-tooltip> <el-tooltip v-else placement="top" content="鍙戦��"> - <div class="size-[38px] rounded-full bg-black flex-center" @click="emits('sendClick')"> + <div class="size-[38px] rounded-full bg-black flex-center" @click="sendClick"> <img src="/static/images/wave/QueryImg.png" /> </div> </el-tooltip> @@ -207,6 +219,7 @@ import { newChatRoomClick, sidebarIsShow, toggleSidebar } from '/@/stores/chatRoom'; import MetricValuesPreview from './metricValues/MetricValuesPreview.vue'; +import { useSpeech } from './hook/useSpeech'; const emits = defineEmits(['sendClick', 'stopGenClick']); const props = defineProps({ @@ -214,6 +227,13 @@ isHome: Boolean, msgList: Array, }); + +const sendClick = () => { + if (recordState.isRecording) { + cancelRecording(); + } + emits('sendClick'); +}; const voicePageIsShow = defineModel('voicePageIsShow', { type: Boolean, @@ -246,6 +266,18 @@ commonPhraseRef.value.updatePhrase(); }; +const speechClick = () => { + if (recordState.isRecording) { + stopRecording(); + } else { + startRecording(); + } +}; + +const { isSupportSpeech, startRecording, stopRecording, recordState, cancelRecording } = useSpeech({ + inputText: inputValue, +}); + //#region ====================== 甯哥敤璇姛鑳� ====================== const commonPhraseRef = useCompRef(CommonPhrases); // 甯哥敤璇姛鑳界偣鍑� -- Gitblit v1.9.3