Skip to content

Commit

Permalink
fix: 修复图片理解节点发布时没有校验必填项的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
liuruibin committed Nov 20, 2024
1 parent 0b67724 commit f5122b8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ui/src/workflow/nodes/image-understand/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -204,6 +205,12 @@ const props = defineProps<{ nodeModel: any }>()
const modelOptions = ref<any>(null)
const providerOptions = ref<Array<Provider>>([])
const aiChatNodeFormRef = ref<FormInstance>()
const validate = () => {
return aiChatNodeFormRef.value?.validate().catch((err) => {
return Promise.reject({ node: props.nodeModel, errMessage: err })
})
}
const wheel = (e: any) => {
if (e.ctrlKey === true) {
Expand Down Expand Up @@ -277,6 +284,8 @@ function submitDialog(val: string) {
onMounted(() => {
getModel()
getProvider()
set(props.nodeModel, 'validate', validate)
})
</script>
Expand Down

0 comments on commit f5122b8

Please sign in to comment.