From b327bd8fede313147c324334d84b17d524b3cc92 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 20 Dec 2024 11:19:32 +0800 Subject: [PATCH] fix: fix workflow parameter verification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1050548 --user=王孝刚 【应用】-高级编排语音转文本组件的语音文件为空可以发布应用 https://www.tapd.cn/57709429/s/1634944 --- .../speech_to_text_step_node/i_speech_to_text_node.py | 2 +- .../text_to_speech_step_node/i_text_to_speech_node.py | 2 +- ui/src/views/application-workflow/index.vue | 8 ++------ ui/src/workflow/nodes/speech-to-text-node/index.vue | 8 +++----- ui/src/workflow/nodes/text-to-speech-node/index.vue | 2 +- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/apps/application/flow/step_node/speech_to_text_step_node/i_speech_to_text_node.py b/apps/application/flow/step_node/speech_to_text_step_node/i_speech_to_text_node.py index 7e2a79b56..4753768b9 100644 --- a/apps/application/flow/step_node/speech_to_text_step_node/i_speech_to_text_node.py +++ b/apps/application/flow/step_node/speech_to_text_step_node/i_speech_to_text_node.py @@ -13,7 +13,7 @@ class SpeechToTextNodeSerializer(serializers.Serializer): is_result = serializers.BooleanField(required=False, error_messages=ErrMessage.boolean('是否返回内容')) - audio_list = serializers.ListField(required=False, error_messages=ErrMessage.list("音频")) + audio_list = serializers.ListField(required=True, error_messages=ErrMessage.list("音频文件不能为空", )) class ISpeechToTextNode(INode): diff --git a/apps/application/flow/step_node/text_to_speech_step_node/i_text_to_speech_node.py b/apps/application/flow/step_node/text_to_speech_step_node/i_text_to_speech_node.py index 8b16301a5..1b31f992f 100644 --- a/apps/application/flow/step_node/text_to_speech_step_node/i_text_to_speech_node.py +++ b/apps/application/flow/step_node/text_to_speech_step_node/i_text_to_speech_node.py @@ -13,7 +13,7 @@ class TextToSpeechNodeSerializer(serializers.Serializer): is_result = serializers.BooleanField(required=False, error_messages=ErrMessage.boolean('是否返回内容')) - content_list = serializers.ListField(required=False, error_messages=ErrMessage.list("文本内容")) + content_list = serializers.ListField(required=True, error_messages=ErrMessage.list("文本内容")) model_params_setting = serializers.DictField(required=False, error_messages=ErrMessage.integer("模型参数相关设置")) diff --git a/ui/src/views/application-workflow/index.vue b/ui/src/views/application-workflow/index.vue index fe58d0f38..b0dc53937 100644 --- a/ui/src/views/application-workflow/index.vue +++ b/ui/src/views/application-workflow/index.vue @@ -242,18 +242,14 @@ function clickoutside() { showPopover.value = false } async function publicHandle() { - // 先执行保存 - const obj = { - work_flow: getGraphData() - } - await application.asyncPutApplication(id, obj) // 后执行发布 workflowRef.value ?.validate() - .then(() => { + .then(async () => { const obj = { work_flow: getGraphData() } + await application.asyncPutApplication(id, obj) const workflow = new WorkFlowInstance(obj.work_flow) try { workflow.is_valid() diff --git a/ui/src/workflow/nodes/speech-to-text-node/index.vue b/ui/src/workflow/nodes/speech-to-text-node/index.vue index 8bd2d51a1..5b30970e5 100644 --- a/ui/src/workflow/nodes/speech-to-text-node/index.vue +++ b/ui/src/workflow/nodes/speech-to-text-node/index.vue @@ -92,7 +92,7 @@ prop="audio_list" :rules="{ message: '选择语音文件', - trigger: 'blur', + trigger: 'change', required: true }" > @@ -175,7 +175,7 @@ const wheel = (e: any) => { const form = { stt_model_id: '', is_result: true, - audio_list: ['start-node', 'audio'] + audio_list: [] } const form_data = computed({ @@ -210,9 +210,7 @@ function getProvider() { }) } -const model_change = (model_id?: string) => { - console.log(modelOptions.value) -} +const model_change = (model_id?: string) => {} onMounted(() => { getModel() diff --git a/ui/src/workflow/nodes/text-to-speech-node/index.vue b/ui/src/workflow/nodes/text-to-speech-node/index.vue index 15bbb1682..3d669252a 100644 --- a/ui/src/workflow/nodes/text-to-speech-node/index.vue +++ b/ui/src/workflow/nodes/text-to-speech-node/index.vue @@ -189,7 +189,7 @@ const wheel = (e: any) => { const form = { tts_model_id: '', is_result: true, - content_list: ['start-node', 'content'], + content_list: [], model_params_setting: {} }