From 4741f3737fb0c3a61463d98b0e7bfd6c8c40e12a Mon Sep 17 00:00:00 2001 From: Lesan <1960681385@qq.com> Date: Thu, 9 Jan 2025 09:04:22 +0800 Subject: [PATCH 1/9] =?UTF-8?q?fix:=20defaultFlowId=E7=94=B1=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SimpleProcessDesignerV2/src/NodeHandler.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue index 25e54f6b..b72c4cab 100644 --- a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue +++ b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue @@ -247,8 +247,7 @@ const addNode = (type: number) => { name: NODE_DEFAULT_NAME.get(NodeType.ROUTE_BRANCH_NODE) as string, showText: '', type: NodeType.ROUTE_BRANCH_NODE, - childNode: props.childNode, - defaultFlowId: 'Flow_' + generateUUID() + childNode: props.childNode } emits('update:childNode', data) } -- Gitee From 777564673e474da006c28521fedd0c485af29897 Mon Sep 17 00:00:00 2001 From: Lesan <1960681385@qq.com> Date: Thu, 9 Jan 2025 09:19:23 +0800 Subject: [PATCH 2/9] =?UTF-8?q?fix:=20=E6=A3=80=E6=9F=A5=E6=89=80=E6=9C=89?= =?UTF-8?q?route->router?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/NodeHandler.vue | 8 +++---- .../src/ProcessNodeTree.vue | 6 ++--- .../SimpleProcessDesignerV2/src/consts.ts | 10 ++++---- ...uteNodeConfig.vue => RouterNodeConfig.vue} | 23 +++++++++---------- .../nodes/{RouteNode.vue => RouterNode.vue} | 10 ++++---- .../detail/ProcessInstanceSimpleViewer.vue | 2 +- 6 files changed, 29 insertions(+), 30 deletions(-) rename src/components/SimpleProcessDesignerV2/src/nodes-config/{RouteNodeConfig.vue => RouterNodeConfig.vue} (91%) rename src/components/SimpleProcessDesignerV2/src/nodes/{RouteNode.vue => RouterNode.vue} (90%) diff --git a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue index b72c4cab..1000e953 100644 --- a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue +++ b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue @@ -46,7 +46,7 @@
延迟器
-
+
@@ -241,12 +241,12 @@ const addNode = (type: number) => { } emits('update:childNode', data) } - if (type === NodeType.ROUTE_BRANCH_NODE) { + if (type === NodeType.ROUTER_BRANCH_NODE) { const data: SimpleFlowNode = { id: 'GateWay_' + generateUUID(), - name: NODE_DEFAULT_NAME.get(NodeType.ROUTE_BRANCH_NODE) as string, + name: NODE_DEFAULT_NAME.get(NodeType.ROUTER_BRANCH_NODE) as string, showText: '', - type: NodeType.ROUTE_BRANCH_NODE, + type: NodeType.ROUTER_BRANCH_NODE, childNode: props.childNode } emits('update:childNode', data) diff --git a/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue b/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue index 4c87d5b0..26ef13dd 100644 --- a/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue +++ b/src/components/SimpleProcessDesignerV2/src/ProcessNodeTree.vue @@ -45,8 +45,8 @@ @update:flow-node="handleModelValueUpdate" /> - @@ -73,7 +73,7 @@ import ExclusiveNode from './nodes/ExclusiveNode.vue' import ParallelNode from './nodes/ParallelNode.vue' import InclusiveNode from './nodes/InclusiveNode.vue' import DelayTimerNode from './nodes/DelayTimerNode.vue' -import RouteNode from './nodes/RouteNode.vue' +import RouterNode from './nodes/RouterNode.vue' import { SimpleFlowNode, NodeType } from './consts' import { useWatchNode } from './node' defineOptions({ diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts index 55808c96..039c5349 100644 --- a/src/components/SimpleProcessDesignerV2/src/consts.ts +++ b/src/components/SimpleProcessDesignerV2/src/consts.ts @@ -48,7 +48,7 @@ export enum NodeType { /** * 路由分支节点 */ - ROUTE_BRANCH_NODE = 54 + ROUTER_BRANCH_NODE = 54 } export enum NodeId { @@ -116,7 +116,7 @@ export interface SimpleFlowNode { // 延迟设置 delaySetting?: DelaySetting // 路由分支 - routerGroups?: RouteCondition[] + routerGroups?: RouterCondition[] defaultFlowId?: string // 签名 signEnable?: boolean @@ -471,7 +471,7 @@ NODE_DEFAULT_TEXT.set(NodeType.COPY_TASK_NODE, '请配置抄送人') NODE_DEFAULT_TEXT.set(NodeType.CONDITION_NODE, '请设置条件') NODE_DEFAULT_TEXT.set(NodeType.START_USER_NODE, '请设置发起人') NODE_DEFAULT_TEXT.set(NodeType.DELAY_TIMER_NODE, '请设置延迟器') -NODE_DEFAULT_TEXT.set(NodeType.ROUTE_BRANCH_NODE, '请设置路由节点') +NODE_DEFAULT_TEXT.set(NodeType.ROUTER_BRANCH_NODE, '请设置路由节点') export const NODE_DEFAULT_NAME = new Map() NODE_DEFAULT_NAME.set(NodeType.USER_TASK_NODE, '审批人') @@ -479,7 +479,7 @@ NODE_DEFAULT_NAME.set(NodeType.COPY_TASK_NODE, '抄送人') NODE_DEFAULT_NAME.set(NodeType.CONDITION_NODE, '条件') NODE_DEFAULT_NAME.set(NodeType.START_USER_NODE, '发起人') NODE_DEFAULT_NAME.set(NodeType.DELAY_TIMER_NODE, '延迟器') -NODE_DEFAULT_NAME.set(NodeType.ROUTE_BRANCH_NODE, '路由分支') +NODE_DEFAULT_NAME.set(NodeType.ROUTER_BRANCH_NODE, '路由分支') // 候选人策略。暂时不从字典中取。 后续可能调整。控制显示顺序 export const CANDIDATE_STRATEGY: DictDataVO[] = [ @@ -660,7 +660,7 @@ export const DELAY_TYPE = [ /** * 路由分支结构定义 */ -export type RouteCondition = { +export type RouterCondition = { nodeId: string conditionType: ConditionType conditionExpression: string diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/RouteNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/RouterNodeConfig.vue similarity index 91% rename from src/components/SimpleProcessDesignerV2/src/nodes-config/RouteNodeConfig.vue rename to src/components/SimpleProcessDesignerV2/src/nodes-config/RouterNodeConfig.vue index 62170fc0..d51e27be 100644 --- a/src/components/SimpleProcessDesignerV2/src/nodes-config/RouteNodeConfig.vue +++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/RouterNodeConfig.vue @@ -37,7 +37,7 @@ :value="node.value" /> - 删除
@@ -46,7 +46,7 @@ - + 新增路由分支
@@ -61,11 +61,11 @@ -- Gitee 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 7/9] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85=E7=AD=89?= =?UTF-8?q?=E5=BC=8F=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 })