From 401481662fb9a3db7e1206f89f716d7503393d45 Mon Sep 17 00:00:00 2001 From: Lesan <1960681385@qq.com> Date: Fri, 10 Jan 2025 14:33:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85=E7=AD=89=E5=BC=8F?= =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E5=80=BCform=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/nodes-config/RouterNodeConfig.vue | 14 +++++- .../src/nodes-config/components/Condition.vue | 46 +++++++++++++------ 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/RouterNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/RouterNodeConfig.vue index 71192ae7..442cf337 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/RouterNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/RouterNodeConfig.vue @@ -42,7 +42,10 @@ > - + @@ -84,8 +87,17 @@ const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(NodeType.ROUTE const routerGroups = ref([]) const nodeOptions = ref() +const conditionRef = ref([]) // 保存配置 const saveConfig = async () => { + // 校验表单 + let valid = true + for (const item of conditionRef.value) { + if (!(await item.validate())) { + valid = false + } + } + if (!valid) return false const showText = getShowText() if (!showText) return false currentNode.value.name = nodeName.value! diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue index e8fe1d76..85f6e4a0 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue @@ -59,15 +59,24 @@
- - - + + + + +
@@ -80,7 +89,16 @@
- + + +
@@ -122,8 +140,8 @@ import { ConditionType, ProcessVariableEnum } from '../../consts' -import {BpmModelFormType} from '@/utils/constants' -import {useFormFields} from '../../node' +import { BpmModelFormType } from '@/utils/constants' +import { useFormFields } from '../../node' const props = defineProps({ modelValue: { @@ -202,10 +220,10 @@ const addConditionGroup = (conditions) => { const validate = async () => { if (!formRef) return false - return await formRef.value.validate(); + return await formRef.value.validate() } -defineExpose({validate}) +defineExpose({ validate })