Skip to content

Commit f5122b8

Browse files
committed
fix: 修复图片理解节点发布时没有校验必填项的问题
1 parent 0b67724 commit f5122b8

File tree

1 file changed

+9
-0
lines changed
  • ui/src/workflow/nodes/image-understand

1 file changed

+9
-0
lines changed

ui/src/workflow/nodes/image-understand/index.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ import applicationApi from '@/api/application'
193193
import { app } from '@/main'
194194
import useStore from '@/stores'
195195
import NodeCascader from '@/workflow/common/NodeCascader.vue'
196+
import type { FormInstance } from 'element-plus'
196197
197198
const { model } = useStore()
198199
@@ -204,6 +205,12 @@ const props = defineProps<{ nodeModel: any }>()
204205
const modelOptions = ref<any>(null)
205206
const providerOptions = ref<Array<Provider>>([])
206207
208+
const aiChatNodeFormRef = ref<FormInstance>()
209+
const validate = () => {
210+
return aiChatNodeFormRef.value?.validate().catch((err) => {
211+
return Promise.reject({ node: props.nodeModel, errMessage: err })
212+
})
213+
}
207214
208215
const wheel = (e: any) => {
209216
if (e.ctrlKey === true) {
@@ -277,6 +284,8 @@ function submitDialog(val: string) {
277284
onMounted(() => {
278285
getModel()
279286
getProvider()
287+
288+
set(props.nodeModel, 'validate', validate)
280289
})
281290
282291
</script>

0 commit comments

Comments
 (0)