wujingjing
2025-04-10 8aa7ffddc511138d61d64029157c11cfccc5431d
src/components/chat/components/playBar/PlayBar.vue
@@ -145,7 +145,20 @@
                           <span class="ywifont ywicon-fujian !text-[20px] font-bold"></span>
                        </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 +170,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 +220,8 @@
import { newChatRoomClick, sidebarIsShow, toggleSidebar } from '/@/stores/chatRoom';
import MetricValuesPreview from './metricValues/MetricValuesPreview.vue';
import { useSpeech } from './hook/useSpeech';
import { useDigitalHuman } from './hook/useDigitalHuman';
const emits = defineEmits(['sendClick', 'stopGenClick']);
const props = defineProps({
@@ -214,6 +229,13 @@
   isHome: Boolean,
   msgList: Array,
});
const sendClick = () => {
   if (recordState.isRecording) {
      cancelRecording();
   }
   emits('sendClick');
};
const voicePageIsShow = defineModel('voicePageIsShow', {
   type: Boolean,
@@ -236,7 +258,9 @@
   inputValue: inputValue,
   inputRef: inputRef,
});
const { openDigitalHuman, isHumanTalking, digitalHumanIsShow } = useDigitalHuman({
   container: '.duix-container',
});
const clearTextarea = () => {
   inputValue.value = '';
};
@@ -245,6 +269,18 @@
   inputRef.value.focus();
   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);
@@ -292,6 +328,7 @@
   pastTarget: inputRef as any,
   attachFileList: attachList,
});
const deleteAttachInIndex = (index: number) => {
   const attach = attachList.value[index];
   if (attach.type === 'file') {