feat: support autoplay answer for tts model

This commit is contained in:
wangdan-fit2cloud 2025-01-03 16:41:42 +08:00 committed by 刘瑞斌
parent b2879da541
commit 6c44622e95
2 changed files with 160 additions and 155 deletions

View File

@ -402,9 +402,10 @@
<template #label> <template #label>
<div class="flex-between"> <div class="flex-between">
<span class="mr-4">语音播放</span> <span class="mr-4">语音播放</span>
<div> <div class="flex">
<el-checkbox v-model="applicationForm.tts_autoplay">自动播放</el-checkbox> <el-checkbox v-model="applicationForm.tts_autoplay">自动播放</el-checkbox>
<el-switch <el-switch
class="ml-8"
size="small" size="small"
v-model="applicationForm.tts_model_enable" v-model="applicationForm.tts_model_enable"
@change="ttsModelEnableChange" @change="ttsModelEnableChange"
@ -412,6 +413,7 @@
</div> </div>
</div> </div>
</template> </template>
<div class="w-full">
<el-radio-group <el-radio-group
v-model="applicationForm.tts_type" v-model="applicationForm.tts_type"
v-show="applicationForm.tts_model_enable" v-show="applicationForm.tts_model_enable"
@ -420,10 +422,11 @@
<el-radio value="BROWSER">浏览器播放(免费)</el-radio> <el-radio value="BROWSER">浏览器播放(免费)</el-radio>
<el-radio value="TTS">TTS模型</el-radio> <el-radio value="TTS">TTS模型</el-radio>
</el-radio-group> </el-radio-group>
</div>
<div class="flex-between w-full">
<el-select <el-select
v-if="applicationForm.tts_type === 'TTS' && applicationForm.tts_model_enable" v-if="applicationForm.tts_type === 'TTS' && applicationForm.tts_model_enable"
v-model="applicationForm.tts_model_id" v-model="applicationForm.tts_model_id"
class="w-full"
popper-class="select-model" popper-class="select-model"
@change="ttsModelChange()" @change="ttsModelChange()"
placeholder="请选择语音合成模型" placeholder="请选择语音合成模型"
@ -484,14 +487,13 @@
</el-select> </el-select>
<el-button <el-button
v-if="applicationForm.tts_type === 'TTS'" v-if="applicationForm.tts_type === 'TTS'"
type="primary"
link
@click="openTTSParamSettingDialog" @click="openTTSParamSettingDialog"
:disabled="!applicationForm.tts_model_id" :disabled="!applicationForm.tts_model_id"
class="mr-8" class="ml-8"
> >
<el-icon class="mr-4"><Setting /></el-icon> <el-icon><Operation /></el-icon>
</el-button> </el-button>
</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>

View File

@ -166,9 +166,10 @@
<template #label> <template #label>
<div class="flex-between"> <div class="flex-between">
<span class="mr-4">语音播放</span> <span class="mr-4">语音播放</span>
<div> <div class="flex">
<el-checkbox v-model="form_data.tts_autoplay">自动播放</el-checkbox> <el-checkbox v-model="form_data.tts_autoplay">自动播放</el-checkbox>
<el-switch <el-switch
class="ml-8"
size="small" size="small"
v-model="form_data.tts_model_enable" v-model="form_data.tts_model_enable"
@change="ttsModelEnableChange" @change="ttsModelEnableChange"
@ -176,10 +177,13 @@
</div> </div>
</div> </div>
</template> </template>
<div class="w-full">
<el-radio-group v-model="form_data.tts_type" v-show="form_data.tts_model_enable"> <el-radio-group v-model="form_data.tts_type" v-show="form_data.tts_model_enable">
<el-radio label="浏览器播放(免费)" value="BROWSER" /> <el-radio label="浏览器播放(免费)" value="BROWSER" />
<el-radio label="TTS模型" value="TTS" /> <el-radio label="TTS模型" value="TTS" />
</el-radio-group> </el-radio-group>
</div>
<div class="flex-between w-full">
<el-select <el-select
v-if="form_data.tts_type === 'TTS' && form_data.tts_model_enable" v-if="form_data.tts_type === 'TTS' && form_data.tts_model_enable"
v-model="form_data.tts_model_id" v-model="form_data.tts_model_id"
@ -243,16 +247,15 @@
</el-select> </el-select>
<el-button <el-button
v-if="form_data.tts_type === 'TTS' && form_data.tts_model_enable" v-if="form_data.tts_type === 'TTS' && form_data.tts_model_enable"
type="primary"
link
@click="openTTSParamSettingDialog" @click="openTTSParamSettingDialog"
:disabled="!form_data.tts_model_id" :disabled="!form_data.tts_model_id"
class="mr-4" class="ml-8"
> >
<el-icon class="mr-4"> <el-icon>
<Setting /> <el-icon><Operation /></el-icon>
</el-icon> </el-icon>
</el-button> </el-button>
</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<TTSModeParamSettingDialog ref="TTSModeParamSettingDialogRef" @refresh="refreshTTSForm" /> <TTSModeParamSettingDialog ref="TTSModeParamSettingDialogRef" @refresh="refreshTTSForm" />