diff --git a/ui/src/views/application/ApplicationSetting.vue b/ui/src/views/application/ApplicationSetting.vue index b4e4296d76..a1ed1f4142 100644 --- a/ui/src/views/application/ApplicationSetting.vue +++ b/ui/src/views/application/ApplicationSetting.vue @@ -543,7 +543,7 @@ import type { FormInstance, FormRules } from 'element-plus' import type { ApplicationFormType } from '@/api/type/application' import type { Provider } from '@/api/type/model' import { relatedObject } from '@/utils/utils' -import { MsgSuccess } from '@/utils/message' +import { MsgSuccess, MsgWarning } from '@/utils/message' import useStore from '@/stores' import { t } from '@/locales' @@ -634,6 +634,14 @@ function submitSystemDialog(val: string) { } const submit = async (formEl: FormInstance | undefined) => { + if (applicationForm.value.tts_model_enable && !applicationForm.value.tts_model_id && applicationForm.value.tts_type === 'TTS') { + MsgWarning(t('请选择语音播放模型')) + return + } + if (applicationForm.value.stt_model_enable && !applicationForm.value.stt_model_id) { + MsgWarning(t('请选择语音输入模型')) + return + } if (!formEl) return await formEl.validate((valid, fields) => { if (valid) { diff --git a/ui/src/workflow/nodes/base-node/index.vue b/ui/src/workflow/nodes/base-node/index.vue index 670be6d9f4..14eb4539db 100644 --- a/ui/src/workflow/nodes/base-node/index.vue +++ b/ui/src/workflow/nodes/base-node/index.vue @@ -258,7 +258,7 @@ import useStore from '@/stores' import applicationApi from '@/api/application' import type { Provider } from '@/api/type/model' import FieldFormDialog from './component/FieldFormDialog.vue' -import { MsgError } from '@/utils/message' +import { MsgError, MsgWarning } from '@/utils/message' import { t } from '@/locales' const { model } = useStore() @@ -308,6 +308,14 @@ const form_data = computed({ const baseNodeFormRef = ref() const validate = () => { + if (form_data.value.tts_model_enable && !form_data.value.tts_model_id && form_data.value.tts_type === 'TTS') { + MsgWarning(t('请选择语音播放模型')) + return + } + if (form_data.value.stt_model_enable && !form_data.value.stt_model_id) { + MsgWarning(t('请选择语音输入模型')) + return + } return baseNodeFormRef.value?.validate().catch((err) => { return Promise.reject({ node: props.nodeModel, errMessage: err }) })