From 4c8b0ef430b2f02d2cd0452dd86f154d6f1d859e Mon Sep 17 00:00:00 2001 From: FinalFinancialFreedom Date: Mon, 29 Aug 2022 08:43:12 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0servicetask=E7=9A=84=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=92=8Ctodo=E9=AB=98=E4=BA=AE=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0servicetask=E8=8A=82=E7=82=B9=E7=9A=84hover=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: FinalFinancialFreedom --- .../package/designer/ProcessViewer.vue | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/yudao-ui-admin/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue b/yudao-ui-admin/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue index 45a9702f4..7b5d0f82e 100644 --- a/yudao-ui-admin/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue +++ b/yudao-ui-admin/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue @@ -119,10 +119,10 @@ export default { // console.log(this.bpmnModeler.getDefinitions().rootElements[0].flowElements); this.bpmnModeler.getDefinitions().rootElements[0].flowElements?.forEach(n => { let activity = activityList.find(m => m.key === n.id) // 找到对应的活动 + if (!activity) { + return; + } if (n.$type === 'bpmn:UserTask') { // 用户任务 - if (!activity) { - return; - } // 处理用户任务的高亮 const task = this.taskList.find(m => m.id === activity.taskId); // 找到活动对应的 taskId if (!task) { @@ -158,9 +158,6 @@ export default { } }); } else if (n.$type === 'bpmn:ExclusiveGateway') { // 排它网关 - if (!activity) { - return - } // 设置【bpmn:ExclusiveGateway】排它网关的高亮 canvas.addMarker(n.id, this.getActivityHighlightCss(activity)); // 查找需要高亮的连线 @@ -185,9 +182,6 @@ export default { canvas.addMarker(matchNN.id, this.getActivityHighlightCss(matchActivity)); } } else if (n.$type === 'bpmn:ParallelGateway') { // 并行网关 - if (!activity) { - return - } // 设置【bpmn:ParallelGateway】并行网关的高亮 canvas.addMarker(n.id, this.getActivityHighlightCss(activity)); n.outgoing?.forEach(nn => { @@ -213,6 +207,17 @@ export default { return; } canvas.addMarker(n.id, this.getResultCss(this.processInstance.result)); + } else if (n.$type === 'bpmn:ServiceTask'){ //服务任务 + if(activity.startTime>0 && activity.endTime===0){//进入执行,标识进行色 + canvas.addMarker(n.id, this.getResultCss(1)); + } + if(activity.endTime>0){// 执行完成,节点标识完成色, 所有outgoing标识完成色。 + canvas.addMarker(n.id, this.getResultCss(2)); + const outgoing = this.getActivityOutgoing(activity) + outgoing?.forEach(out=>{ + canvas.addMarker(out.id,this.getResultCss(2)) + }) + } } }) }, @@ -268,6 +273,10 @@ export default { !this.elementOverlayIds && (this.elementOverlayIds = {}); !this.overlays && (this.overlays = this.bpmnModeler.get("overlays")); // 展示信息 + const activity = this.activityList.find(m => m.key === element.id); + if (!activity) { + return; + } if (!this.elementOverlayIds[element.id] && element.type !== "bpmn:Process") { let html = `

Elemet id: ${element.id}

@@ -279,10 +288,6 @@ export default {

创建时间:${this.parseTime(this.processInstance.createTime)}`; } else if (element.type === 'bpmn:UserTask') { // debugger - const activity = this.activityList.find(m => m.key === element.id); - if (!activity) { - return; - } let task = this.taskList.find(m => m.id === activity.taskId); // 找到活动对应的 taskId if (!task) { return; @@ -297,6 +302,14 @@ export default { if (task.reason) { html += `

审批建议:${task.reason}

` } + } else if (element.type === 'bpmn:ServiceTask' && this.processInstance) { + if(activity.startTime>0){ + html = `

创建时间:${this.parseTime(activity.startTime)}

`; + } + if(activity.endTime>0){ + html += `

结束时间:${this.parseTime(activity.endTime)}

` + } + console.log(html) } else if (element.type === 'bpmn:EndEvent' && this.processInstance) { html = `

结果:${this.getDictDataLabel(this.DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, this.processInstance.result)}

`; if (this.processInstance.endTime) { @@ -471,4 +484,4 @@ export default { color: #fafafa; width: 200px; } - + \ No newline at end of file