fix: ensure ttsModelChange executes after DOM updates using nextTick

--bug=1058556 --user=刘瑞斌 【应用】基本信息节点开启语音播放,调试模式下切换模型,点击保存提问后使用语音播放失败 https://www.tapd.cn/62980211/s/1729683
This commit is contained in:
CaptainB 2025-07-12 10:47:32 +08:00
parent 2d734d0aaa
commit 41ad2eeef2

View File

@ -170,7 +170,7 @@
import { groupBy, set } from 'lodash'
import NodeContainer from '@/workflow/common/NodeContainer.vue'
import type { FormInstance } from 'element-plus'
import { ref, computed, onMounted } from 'vue'
import { ref, computed, onMounted, nextTick } from 'vue'
import { MsgError, MsgSuccess, MsgWarning } from '@/utils/message'
import { t } from '@/locales'
import TTSModeParamSettingDialog from '@/views/application/component/TTSModeParamSettingDialog.vue'
@ -265,11 +265,13 @@ function getTTSModel() {
}
function ttsModelChange() {
if (form_data.value.tts_model_id) {
TTSModeParamSettingDialogRef.value?.reset_default(form_data.value.tts_model_id, id)
} else {
refreshTTSForm({})
}
nextTick(() => {
if (form_data.value.tts_model_id) {
TTSModeParamSettingDialogRef.value?.reset_default(form_data.value.tts_model_id, id)
} else {
refreshTTSForm({})
}
})
}
function ttsModelEnableChange() {