重命名历史任务的接口

pull/2/head
YunaiV 2022-01-18 23:48:44 +08:00
parent 2de81e438a
commit adc6076deb
7 changed files with 30 additions and 30 deletions

View File

@ -64,12 +64,12 @@ public class BpmTaskController {
return success(true);
}
@GetMapping("/historic-list-by-process-instance-id")
@GetMapping("/list-by-process-instance-id")
@ApiOperation(value = "获得指定流程实例的任务列表", notes = "包括完成的、未完成的")
@ApiImplicitParam(name = "processInstanceId", value = "流程实例的编号", required = true, dataTypeClass = String.class)
public CommonResult<List<BpmTaskRespVO>> getHistoricTaskListByProcessInstanceId(
public CommonResult<List<BpmTaskRespVO>> getTaskListByProcessInstanceId(
@RequestParam("processInstanceId") String processInstanceId) {
return success(taskService.getHistoricTaskListByProcessInstanceId(processInstanceId));
return success(taskService.getTaskListByProcessInstanceId(processInstanceId));
}
/**

View File

@ -30,7 +30,7 @@ public interface BpmTaskService {
* @param processInstanceId
* @return
*/
List<BpmTaskRespVO> getHistoricTaskListByProcessInstanceId(String processInstanceId);
List<BpmTaskRespVO> getTaskListByProcessInstanceId(String processInstanceId);
/**
*

View File

@ -92,7 +92,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
}
@Override
public List<BpmTaskRespVO> getHistoricTaskListByProcessInstanceId(String processInstanceId) {
public List<BpmTaskRespVO> getTaskListByProcessInstanceId(String processInstanceId) {
// 获得任务列表
List<HistoricTaskInstance> tasks = historyService.createHistoricTaskInstanceQuery()
.processInstanceId(processInstanceId)

File diff suppressed because one or more lines are too long

View File

@ -48,9 +48,9 @@ export function updateTaskAssignee(data) {
})
}
export function getHistoricTaskListByProcessInstanceId(processInstanceId) {
export function getTaskListByProcessInstanceId(processInstanceId) {
return request({
url: '/bpm/task/historic-list-by-process-instance-id?processInstanceId=' + processInstanceId,
url: '/bpm/task/list-by-process-instance-id?processInstanceId=' + processInstanceId,
method: 'get',
})
}

View File

@ -94,7 +94,7 @@ export default {
let completeTask = this.tasks.find(m => m.definitionKey === n.id)
let todoTask = this.tasks.find(m => !m.endTime)
let endTask = this.tasks[this.tasks.length - 1]
if (n.$type === 'bpmn:UserTask') {
if (n.$type === 'bpmn:UserTask') { //
if (completeTask) {
canvas.addMarker(n.id, completeTask.endTime ? 'highlight' : 'highlight-todo');
// console.log(n.id + ' : ' + (completeTask.endTime ? 'highlight' : 'highlight-todo'));
@ -118,14 +118,14 @@ export default {
}
});
}
} else if (n.$type === 'bpmn:ExclusiveGateway') {
} else if (n.$type === 'bpmn:ExclusiveGateway') { //
n.outgoing?.forEach(nn => {
let targetTask = this.tasks.find(m => m.definitionKey === nn.targetRef.id)
if (targetTask) {
canvas.addMarker(nn.id, targetTask.endTime ? 'highlight' : 'highlight-todo');
}
})
} else if (n.$type === 'bpmn:ParallelGateway') {
} else if (n.$type === 'bpmn:ParallelGateway') { //
if (completeTask) {
canvas.addMarker(n.id, completeTask.endTime ? 'highlight' : 'highlight-todo')
n.outgoing?.forEach(nn => {
@ -136,7 +136,7 @@ export default {
}
})
}
} else if (n.$type === 'bpmn:StartEvent') {
} else if (n.$type === 'bpmn:StartEvent') { //
n.outgoing?.forEach(nn => {
let completeTask = this.tasks.find(m => m.definitionKey === nn.targetRef.id)
if (completeTask) {
@ -145,7 +145,7 @@ export default {
return
}
});
} else if (n.$type === 'bpmn:EndEvent') {
} else if (n.$type === 'bpmn:EndEvent') { //
if (endTask.definitionKey === n.id && endTask.endTime) {
canvas.addMarker(n.id, 'highlight')
return

View File

@ -1,7 +1,7 @@
<template>
<div class="app-container">
<!-- 审批信息 -->
<el-card class="box-card" v-loading="processInstanceLoading" v-for="(item, index) in tasks" :key="index">
<el-card class="box-card" v-loading="processInstanceLoading" v-for="(item, index) in runningTasks" :key="index">
<div slot="header" class="clearfix">
<span class="el-icon-picture-outline">审批任务{{ item.name }}</span>
</div>
@ -38,14 +38,14 @@
</div>
</el-col>
</el-card>
<el-card class="box-card" v-loading="historicTasksLoad">
<el-card class="box-card" v-loading="tasksLoad">
<div slot="header" class="clearfix">
<span class="el-icon-picture-outline">审批记录</span>
</div>
<el-col :span="16" :offset="4" >
<div class="block">
<el-timeline>
<el-timeline-item v-for="(item, index) in historicTasks" :key="index"
<el-timeline-item v-for="(item, index) in tasks" :key="index"
:icon="getTimelineItemIcon(item)" :type="getTimelineItemType(item)">
<p style="font-weight: 700">任务{{ item.name }}</p>
<el-card :body-style="{ padding: '10px' }">
@ -73,7 +73,7 @@
<div slot="header" class="clearfix">
<span class="el-icon-picture-outline">流程图</span>
</div>
<my-process-viewer key="designer" v-model="bpmnXML" v-bind="bpmnControlForm" :taskData="historicTasks" />
<my-process-viewer key="designer" v-model="bpmnXML" v-bind="bpmnControlForm" :taskData="tasks" />
</el-card>
<!-- 对话框(转派审批人) -->
@ -100,7 +100,7 @@ import store from "@/store";
import {decodeFields} from "@/utils/formGenerator";
import Parser from '@/components/parser/Parser'
import {createProcessInstance, getProcessInstance} from "@/api/bpm/processInstance";
import {approveTask, getHistoricTaskListByProcessInstanceId, rejectTask, updateTaskAssignee} from "@/api/bpm/task";
import {approveTask, getTaskListByProcessInstanceId, rejectTask, updateTaskAssignee} from "@/api/bpm/task";
import {getDate} from "@/utils/dateUtils";
import {listSimpleUsers} from "@/api/system/user";
@ -130,11 +130,11 @@ export default {
},
//
historicTasksLoad: true,
historicTasks: [],
tasksLoad: true,
tasks: [],
//
tasks: [],
runningTasks: [],
auditForms: [],
auditRule: {
comment: [{ required: true, message: "审批建议不能为空", trigger: "blur" }],
@ -208,14 +208,14 @@ export default {
});
//
this.historicTasksLoad = true;
this.tasks = [];
this.tasksLoad = true;
this.runningTasks = [];
this.auditForms = [];
getHistoricTaskListByProcessInstanceId(this.id).then(response => {
getTaskListByProcessInstanceId(this.id).then(response => {
//
this.historicTasks = response.data;
this.tasks = response.data;
//
this.historicTasks.sort((a, b) => {
this.tasks.sort((a, b) => {
//
if (a.endTime && b.endTime) {
return b.endTime - a.endTime;
@ -231,21 +231,21 @@ export default {
//
const userId = store.getters.userId;
this.historicTasks.forEach(task => {
this.tasks.forEach(task => {
if (task.result !== 1) { //
return;
}
if (!task.assigneeUser || task.assigneeUser.id !== userId) { //
return;
}
this.tasks.push({...task});
this.runningTasks.push({...task});
this.auditForms.push({
comment: ''
})
});
//
this.historicTasksLoad = false;
this.tasksLoad = false;
});
},
/** 处理选择流程的按钮操作 **/
@ -325,7 +325,7 @@ export default {
},
/** 处理审批通过和不通过的操作 */
handleAudit(task, pass) {
const index = this.tasks.indexOf(task);
const index = this.runningTasks.indexOf(task);
this.$refs['form' + index][0].validate(valid => {
if (!valid) {
return;