From 491e9f84eea10f0b9e8dfff8316ba67dfd50ccac Mon Sep 17 00:00:00 2001 From: Amy0104 <97265214+Amy0104@users.noreply.github.com> Date: Mon, 18 Apr 2022 14:09:32 +0800 Subject: [PATCH] [Fix][UI] Fix condition task connection failure. (#9548) --- .../workflow/components/dag/use-canvas-init.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-canvas-init.ts b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-canvas-init.ts index c83e751ac0..bc7a809b19 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-canvas-init.ts +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-canvas-init.ts @@ -114,7 +114,15 @@ export function useCanvasInit(options: Options) { const sourceData = sourceCell.getData() if (!sourceData) return true if (sourceData.taskType !== 'CONDITIONS') return true - return (graph.value?.getConnectedEdges(sourceCell).length || 0) <= 2 + const edges = graph.value?.getConnectedEdges(sourceCell) + if (!edges || edges.length < 2) return true + let len = 0 + return !edges.some((edge) => { + if (edge.getSourceCellId() === sourceCell.id) { + len++ + } + return len > 2 + }) } return true