Skip to content

Commit

Permalink
fix: fix workflow parameter verification
Browse files Browse the repository at this point in the history
--bug=1050548 --user=王孝刚 【应用】-高级编排语音转文本组件的语音文件为空可以发布应用 https://www.tapd.cn/57709429/s/1634944
  • Loading branch information
wxg0103 committed Dec 20, 2024
1 parent 64fb771 commit e7bc876
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("模型参数相关设置"))

Expand Down
8 changes: 2 additions & 6 deletions ui/src/views/application-workflow/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 3 additions & 5 deletions ui/src/workflow/nodes/speech-to-text-node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
prop="audio_list"
:rules="{
message: '选择语音文件',
trigger: 'blur',
trigger: 'change',
required: true
}"
>
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -210,9 +210,7 @@ function getProvider() {
})
}
const model_change = (model_id?: string) => {
console.log(modelOptions.value)
}
const model_change = (model_id?: string) => {}
onMounted(() => {
getModel()
Expand Down
2 changes: 1 addition & 1 deletion ui/src/workflow/nodes/text-to-speech-node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
}
Expand Down

0 comments on commit e7bc876

Please sign in to comment.