From aba33eb00aa01a9296a3871096d064849492e13f Mon Sep 17 00:00:00 2001 From: CaptainB Date: Wed, 20 Nov 2024 10:40:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E7=90=86=E8=A7=A3=E8=8A=82=E7=82=B9=E5=8F=91=E5=B8=83=E6=97=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=A0=A1=E9=AA=8C=E5=BF=85=E5=A1=AB=E9=A1=B9?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/workflow/nodes/image-understand/index.vue | 9 +++++++++ 1 file changed, 9 insertions(+) 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) })