fix(流程管理):

1.修复流程完成后流程图渲染失败问题
approve-sys
DESKTOP-J8LE24C\cqjx 4 years ago
parent 78a20f70f4
commit 95694f44bd

@ -493,7 +493,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
public AjaxResult stopProcess(FlowTaskVo flowTaskVo) { public AjaxResult stopProcess(FlowTaskVo flowTaskVo) {
Task task = taskService.createTaskQuery().processInstanceId(flowTaskVo.getInstanceId()).singleResult(); Task task = taskService.createTaskQuery().processInstanceId(flowTaskVo.getInstanceId()).singleResult();
if (task == null) { if (task == null) {
throw new CustomException("流程未启动或已执行完成,无法撤回"); throw new CustomException("流程未启动或已执行完成,取消申请失败");
} }
SysUser loginUser = SecurityUtils.getLoginUser().getUser(); SysUser loginUser = SecurityUtils.getLoginUser().getUser();

@ -159,7 +159,6 @@ export default {
await this.modeler.importXML(data) await this.modeler.importXML(data)
this.adjustPalette() this.adjustPalette()
this.fitViewport() this.fitViewport()
console.log(this.taskList)
if (this.taskList) { if (this.taskList) {
this.fillColor() this.fillColor()
} }
@ -222,79 +221,6 @@ export default {
fillColor() { fillColor() {
const canvas = this.modeler.get('canvas') const canvas = this.modeler.get('canvas')
this.modeler._definitions.rootElements[0].flowElements.forEach(n => { this.modeler._definitions.rootElements[0].flowElements.forEach(n => {
// if (n.$type === 'bpmn:UserTask') {
// const completeTask = this.taskList.find(m => m.key === n.id)
// const todoTask = this.taskList.find(m => !m.completed)
// const endTask = this.taskList[this.taskList.length - 1]
// if (completeTask) {
// canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo')
// n.outgoing?.forEach(nn => {
// const targetTask = this.taskList.find(m => m.key === nn.targetRef.id)
// if (targetTask) {
// //
// if (nn.targetRef.$type === 'bpmn:ExclusiveGateway') {
// // canvas.addMarker(nn.id, 'highlight');
// canvas.addMarker(nn.id, completeTask.completed ? 'highlight' : 'highlight-todo')
// canvas.addMarker(nn.targetRef.id, completeTask.completed ? 'highlight' : 'highlight-todo')
// nn.targetRef.outgoing?.forEach(line => {
// debugger
// if (todoTask.key === line.targetRef.id) {
// canvas.addMarker(line.id, todoTask.completed ? 'highlight' : 'highlight-todo')
// }else if(completeTask.key === line.targetRef.id){
// canvas.addMarker(line.id, completeTask.completed ? 'highlight' : 'highlight-todo')
// }
// })
// //
// }else if (nn.targetRef.$type === 'bpmn:ParallelGateway') {
// // canvas.addMarker(nn.id, 'highlight');
// debugger
// canvas.addMarker(nn.id, completeTask.completed ? 'highlight' : 'highlight-todo')
// canvas.addMarker(nn.targetRef.id, completeTask.completed ? 'highlight' : 'highlight-todo')
// nn.targetRef.outgoing?.forEach(line => {
// debugger
// if (todoTask.key === line.targetRef.id) {
// canvas.addMarker(line.id, todoTask.completed ? 'highlight' : 'highlight-todo')
// }else {
// canvas.addMarker(line.id, completeTask.completed ? 'highlight' : 'highlight-todo')
// }
// })
// }else {
// canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo')
// canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo')
// }
//
// }
// // else if (nn.targetRef.$type === 'bpmn:ExclusiveGateway') {
// // debugger
// // // canvas.addMarker(nn.id, 'highlight');
// // canvas.addMarker(nn.id, completeTask.completed ? 'highlight' : 'highlight-todo')
// // canvas.addMarker(nn.targetRef.id, completeTask.completed ? 'highlight' : 'highlight-todo')
// // }
// // else if (nn.targetRef.$type === 'bpmn:EndEvent') {
// // if (!todoTask && endTask.key === n.id) {
// // canvas.addMarker(nn.id, 'highlight')
// // canvas.addMarker(nn.targetRef.id, 'highlight')
// // }
// // if (!completeTask.completed) {
// // canvas.addMarker(nn.id, 'highlight-todo')
// // canvas.addMarker(nn.targetRef.id, 'highlight-todo')
// // }
// // }
// })
// }
// }
// else if (n.$type === 'bpmn:ExclusiveGateway') {
// n.outgoing.forEach(nn => {
// const targetTask = this.taskList.find(m => m.key === nn.targetRef.id)
// if (targetTask) {
// canvas.addMarker(n.id, targetTask.completed ? 'highlight' : 'highlight-todo')
// canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo')
// }
// })
// }
const completeTask = this.taskList.find(m => m.key === n.id) const completeTask = this.taskList.find(m => m.key === n.id)
const todoTask = this.taskList.find(m => !m.completed) const todoTask = this.taskList.find(m => !m.completed)
const endTask = this.taskList[this.taskList.length - 1] const endTask = this.taskList[this.taskList.length - 1]
@ -304,8 +230,7 @@ export default {
n.outgoing?.forEach(nn => { n.outgoing?.forEach(nn => {
const targetTask = this.taskList.find(m => m.key === nn.targetRef.id) const targetTask = this.taskList.find(m => m.key === nn.targetRef.id)
if (targetTask) { if (targetTask) {
debugger if (todoTask && completeTask.key === todoTask.key && !todoTask.completed){
if (completeTask.key === todoTask.key && !todoTask.completed){
canvas.addMarker(nn.id, todoTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(nn.id, todoTask.completed ? 'highlight' : 'highlight-todo')
canvas.addMarker(nn.targetRef.id, todoTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(nn.targetRef.id, todoTask.completed ? 'highlight' : 'highlight-todo')
}else { }else {
@ -317,7 +242,7 @@ export default {
} }
} }
// //
if (n.$type === 'bpmn:ExclusiveGateway') { else if (n.$type === 'bpmn:ExclusiveGateway') {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo')
n.outgoing?.forEach(nn => { n.outgoing?.forEach(nn => {
@ -330,8 +255,10 @@ export default {
}) })
} }
}
// //
} if (n.$type === 'bpmn:ParallelGateway') { else if (n.$type === 'bpmn:ParallelGateway') {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo')
n.outgoing?.forEach(nn => { n.outgoing?.forEach(nn => {
@ -344,9 +271,7 @@ export default {
}) })
} }
} }
else if (n.$type === 'bpmn:StartEvent') {
if (n.$type === 'bpmn:StartEvent') {
n.outgoing.forEach(nn => { n.outgoing.forEach(nn => {
const completeTask = this.taskList.find(m => m.key === nn.targetRef.id) const completeTask = this.taskList.find(m => m.key === nn.targetRef.id)
if (completeTask) { if (completeTask) {
@ -356,10 +281,8 @@ export default {
} }
}) })
} }
if (n.$type === 'bpmn:EndEvent') { else if (n.$type === 'bpmn:EndEvent') {
const endTask = this.taskList[this.taskList.length - 1]
if (endTask.key === n.id && endTask.completed) { if (endTask.key === n.id && endTask.completed) {
// canvas.addMarker(nn.id, 'highlight')
canvas.addMarker(n.id, 'highlight') canvas.addMarker(n.id, 'highlight')
return return
} }

Loading…
Cancel
Save