From 991ce2105b4b16dfd81b1937a78834068c898c09 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 22 Jan 2022 21:10:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20bpm=20=E9=AB=98=E4=BA=AE?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=9B=BE=E7=9A=84=E6=8E=92=E5=AE=83=E8=8A=82?= =?UTF-8?q?=E7=82=B9~~~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../package/designer/ProcessViewer.vue | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/yudao-admin-ui/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue b/yudao-admin-ui/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue index 9d2154659..66660094b 100644 --- a/yudao-admin-ui/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue +++ b/yudao-admin-ui/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue @@ -154,12 +154,32 @@ export default { } }); } else if (n.$type === 'bpmn:ExclusiveGateway') { // 排它网关 + if (!activity) { + return + } + // 设置【bpmn:ExclusiveGateway】排它网关的高亮 + canvas.addMarker(n.id, this.getActivityHighlightCss(activity)); + // 查找需要高亮的连线 + let matchNN = undefined; + let matchActivity = undefined; n.outgoing?.forEach(nn => { - let targetTask = activityList.find(m => m.key === nn.targetRef.id); - if (targetTask) { - canvas.addMarker(nn.id, targetTask.endTime ? 'highlight' : 'highlight-todo'); + let targetActivity = activityList.find(m => m.key === nn.targetRef.id); + if (!targetActivity) { + return; + } + // 特殊判断 endEvent 类型的原因,ExclusiveGateway 可能后续连有 2 个路径: + // 1. 一个是 UserTask => EndEvent + // 2. 一个是 EndEvent + // 在选择路径 1 时,其实 EndEvent 可能也存在,导致 1 和 2 都高亮,显然是不正确的。 + // 所以,在 matchActivity 为 EndEvent 时,需要进行覆盖~~ + if (!matchActivity || matchActivity.type === 'endEvent') { + matchNN = nn; + matchActivity = targetActivity; } }) + if (matchNN && matchActivity) { + canvas.addMarker(matchNN.id, this.getActivityHighlightCss(matchActivity)); + } } else if (n.$type === 'bpmn:ParallelGateway') { // 并行网关 if (!activity) { return