diff --git a/ui/src/workflow/nodes/image-understand/index.vue b/ui/src/workflow/nodes/image-understand/index.vue index 4c7252ad9..6ca722d29 100644 --- a/ui/src/workflow/nodes/image-understand/index.vue +++ b/ui/src/workflow/nodes/image-understand/index.vue @@ -193,6 +193,7 @@ import applicationApi from '@/api/application' import { app } from '@/main' import useStore from '@/stores' import NodeCascader from '@/workflow/common/NodeCascader.vue' +import type { FormInstance } from 'element-plus' const { model } = useStore() @@ -204,6 +205,12 @@ const props = defineProps<{ nodeModel: any }>() const modelOptions = ref(null) const providerOptions = ref>([]) +const aiChatNodeFormRef = ref() +const validate = () => { + return aiChatNodeFormRef.value?.validate().catch((err) => { + return Promise.reject({ node: props.nodeModel, errMessage: err }) + }) +} const wheel = (e: any) => { if (e.ctrlKey === true) { @@ -277,6 +284,8 @@ function submitDialog(val: string) { onMounted(() => { getModel() getProvider() + + set(props.nodeModel, 'validate', validate) })