add:历史节点显示颜色
This commit is contained in:
@@ -2,6 +2,7 @@ package org.nl.wms.flow_manage.flow.controller.execution;
|
|||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@@ -77,6 +78,7 @@ public class ExecutionController {
|
|||||||
}
|
}
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/dtl/{proc_inst_id}")
|
@GetMapping("/dtl/{proc_inst_id}")
|
||||||
public ResponseEntity<Object> getDtl(@PathVariable String proc_inst_id) {
|
public ResponseEntity<Object> getDtl(@PathVariable String proc_inst_id) {
|
||||||
List<ActHiExecution> list = iActHiExecutionService.list(new LambdaQueryWrapper<ActHiExecution>().eq(ActHiExecution::getProc_inst_id, proc_inst_id));
|
List<ActHiExecution> list = iActHiExecutionService.list(new LambdaQueryWrapper<ActHiExecution>().eq(ActHiExecution::getProc_inst_id, proc_inst_id));
|
||||||
@@ -96,7 +98,7 @@ public class ExecutionController {
|
|||||||
|
|
||||||
@GetMapping(value = "/confirm/{proc_inst_id}")
|
@GetMapping(value = "/confirm/{proc_inst_id}")
|
||||||
public ResponseEntity<Object> flowConfirm(@PathVariable String proc_inst_id) {
|
public ResponseEntity<Object> flowConfirm(@PathVariable String proc_inst_id) {
|
||||||
return new ResponseEntity<>(flowOperationService.flowConfirm(proc_inst_id,null), HttpStatus.OK);
|
return new ResponseEntity<>(flowOperationService.flowConfirm(proc_inst_id, null), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/queryByParentId/{id}")
|
@GetMapping(value = "/queryByParentId/{id}")
|
||||||
@@ -116,4 +118,9 @@ public class ExecutionController {
|
|||||||
executionService.updateById(dto);
|
executionService.updateById(dto);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/queryHisActivityId/{proc_inst_id}")
|
||||||
|
public ResponseEntity<Object> queryHisActivityId(@PathVariable String proc_inst_id) {
|
||||||
|
return new ResponseEntity<>(executionService.queryHisActivityId(proc_inst_id), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import org.nl.wms.flow_manage.flow.service.execution.dao.ActRuExecution;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.wms.flow_manage.flow.service.execution.dto.ExecutionQuery;
|
import org.nl.wms.flow_manage.flow.service.execution.dto.ExecutionQuery;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 流程实例表 服务类
|
* 流程实例表 服务类
|
||||||
@@ -16,4 +18,6 @@ import org.nl.wms.flow_manage.flow.service.execution.dto.ExecutionQuery;
|
|||||||
public interface IActRuExecutionService extends IService<ActRuExecution> {
|
public interface IActRuExecutionService extends IService<ActRuExecution> {
|
||||||
|
|
||||||
Object getAll(ExecutionQuery query, PageQuery page);
|
Object getAll(ExecutionQuery query, PageQuery page);
|
||||||
|
|
||||||
|
List<String> queryHisActivityId(String proc_inst_id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.wms.flow_manage.flow.service.execution.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -16,9 +17,12 @@ import org.nl.wms.flow_manage.flow.service.execution.dao.mapper.ActRuExecutionMa
|
|||||||
import org.nl.wms.flow_manage.flow.service.execution.IActRuExecutionService;
|
import org.nl.wms.flow_manage.flow.service.execution.IActRuExecutionService;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.nl.wms.flow_manage.flow.service.execution.dto.ExecutionQuery;
|
import org.nl.wms.flow_manage.flow.service.execution.dto.ExecutionQuery;
|
||||||
|
import org.nl.wms.flow_manage.flow.service.history.IActHiExecutionService;
|
||||||
|
import org.nl.wms.flow_manage.flow.service.history.dao.ActHiExecution;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,11 +38,13 @@ public class ActRuExecutionServiceImpl extends ServiceImpl<ActRuExecutionMapper,
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IActReProcdefService procdefService;
|
private IActReProcdefService procdefService;
|
||||||
|
@Autowired
|
||||||
|
private IActHiExecutionService iActHiExecutionService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getAll(ExecutionQuery query, PageQuery page) {
|
public Object getAll(ExecutionQuery query, PageQuery page) {
|
||||||
//判断是否存在子实例
|
//判断是否存在子实例
|
||||||
QueryWrapper<ActRuExecution> build = (QueryWrapper)query.build();
|
QueryWrapper<ActRuExecution> build = (QueryWrapper) query.build();
|
||||||
build.isNull("parent_id");
|
build.isNull("parent_id");
|
||||||
Page<ActRuExecution> executionPage = this.page(page.build(), build);
|
Page<ActRuExecution> executionPage = this.page(page.build(), build);
|
||||||
List<ActRuExecution> records = executionPage.getRecords();
|
List<ActRuExecution> records = executionPage.getRecords();
|
||||||
@@ -46,6 +52,24 @@ public class ActRuExecutionServiceImpl extends ServiceImpl<ActRuExecutionMapper,
|
|||||||
return TableDataInfo.build(executionPage);
|
return TableDataInfo.build(executionPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> queryHisActivityId(String proc_inst_id) {
|
||||||
|
List<ActHiExecution> list = iActHiExecutionService.list(new LambdaQueryWrapper<ActHiExecution>().eq(ActHiExecution::getProc_inst_id, proc_inst_id));
|
||||||
|
List<String> allHisActivityId = new ArrayList<>();
|
||||||
|
this.queryHisActivityId(list, allHisActivityId);
|
||||||
|
return allHisActivityId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void queryHisActivityId(List<ActHiExecution> list, List<String> allHisActivityId) {
|
||||||
|
for (ActHiExecution actHiExecution : list) {
|
||||||
|
if (StrUtil.isNotBlank(actHiExecution.getParent_id())) {
|
||||||
|
List<ActHiExecution> parentList = iActHiExecutionService.list(new LambdaQueryWrapper<ActHiExecution>().eq(ActHiExecution::getProc_inst_id, actHiExecution.getParent_id()));
|
||||||
|
this.queryHisActivityId(parentList, allHisActivityId);
|
||||||
|
}
|
||||||
|
allHisActivityId.add(actHiExecution.getActivity_id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void findChildren(List<ActRuExecution> records) {
|
private void findChildren(List<ActRuExecution> records) {
|
||||||
for (ActRuExecution record : records) {
|
for (ActRuExecution record : records) {
|
||||||
LambdaQueryWrapper<ActRuExecution> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActRuExecution> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import {
|
|||||||
sequence,
|
sequence,
|
||||||
registerSubProcess,
|
registerSubProcess,
|
||||||
} from '../../view_flow/registerNode'
|
} from '../../view_flow/registerNode'
|
||||||
|
import curdExecution from './curdExecution'
|
||||||
//const demoData = require('./data.json')
|
//const demoData = require('./data.json')
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -167,10 +167,22 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.lf.render(JSON.parse(json))
|
this.lf.render(JSON.parse(json))
|
||||||
}
|
}
|
||||||
|
const proc_inst_id = row.proc_inst_id;
|
||||||
|
|
||||||
|
this.queryHisActivityId(proc_inst_id)
|
||||||
const nodeModel = this.lf.getNodeModelById(row.activity_id);
|
const nodeModel = this.lf.getNodeModelById(row.activity_id);
|
||||||
nodeModel.setStyle("stroke", "red")
|
nodeModel.setStyle("stroke", "red")
|
||||||
nodeModel.setStyle("stroke-width", "2.5")
|
nodeModel.setStyle("stroke-width", "2.5")
|
||||||
},
|
},
|
||||||
|
queryHisActivityId(proc_inst_id) {
|
||||||
|
curdExecution.queryHisActivityId(proc_inst_id).then(res => {
|
||||||
|
res.forEach((activity_id) => {
|
||||||
|
const nodeModel = this.lf.getNodeModelById(activity_id);
|
||||||
|
nodeModel.setStyle("stroke", "red")
|
||||||
|
nodeModel.setStyle("stroke-width", "1")
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
closeDialog() {
|
closeDialog() {
|
||||||
this.$data.dialogVisible = false
|
this.$data.dialogVisible = false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -89,6 +89,13 @@ export function flowConfirm(inst_id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function queryHisActivityId(proc_inst_id) {
|
||||||
|
return request({
|
||||||
|
url: '/api/bpmnExecution/queryHisActivityId/' + proc_inst_id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
@@ -101,5 +108,6 @@ export default {
|
|||||||
getDeploymentById,
|
getDeploymentById,
|
||||||
getDtl,
|
getDtl,
|
||||||
changeActive,
|
changeActive,
|
||||||
flowConfirm
|
flowConfirm,
|
||||||
|
queryHisActivityId
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</el-switch>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务类型" prop="task_type">
|
<el-form-item label="任务类型" prop="task_type">
|
||||||
<el-select @change="formData.skipExpression = ''" clearable v-model="formData.category" placeholder="请选择" style="width: 370px;">
|
<el-select @change="() => { formData.skipExpression = ''; formData.auxParam = ''; }" clearable v-model="formData.category" placeholder="请选择" style="width: 370px;">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in taskTypes"
|
v-for="item in taskTypes"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class ResizableDiamondModel extends DiamondResize.model {
|
|||||||
getTextStyle() {
|
getTextStyle() {
|
||||||
const style = super.getTextStyle();
|
const style = super.getTextStyle();
|
||||||
const height = super.height;
|
const height = super.height;
|
||||||
style.fontSize = height / 10;
|
style.fontSize = height / 20;
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ class ResizableDiamondView extends DiamondResize.view {
|
|||||||
const {stroke} = style;
|
const {stroke} = style;
|
||||||
const iconWidth = width; // 图标宽度
|
const iconWidth = width; // 图标宽度
|
||||||
const iconHeight = height; // 图标高度
|
const iconHeight = height; // 图标高度
|
||||||
const iconX = x - iconWidth / 2; // 调整图标位置的X坐标
|
const iconX = x - iconWidth / 2 + 3.5; // 调整图标位置的X坐标
|
||||||
const iconY = y - iconHeight / 2; // 调整图标位置的Y坐标
|
const iconY = y - iconHeight / 2; // 调整图标位置的Y坐标
|
||||||
return h(
|
return h(
|
||||||
'svg',
|
'svg',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class ResizableDiamondModel extends DiamondResize.model {
|
|||||||
getTextStyle() {
|
getTextStyle() {
|
||||||
const style = super.getTextStyle();
|
const style = super.getTextStyle();
|
||||||
const height = super.height;
|
const height = super.height;
|
||||||
style.fontSize = height / 10;
|
style.fontSize = height / 20;
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,10 +61,10 @@ class ResizableDiamondView extends DiamondResize.view {
|
|||||||
const {x, y, width, height} = model;
|
const {x, y, width, height} = model;
|
||||||
const style = model.getNodeStyle();
|
const style = model.getNodeStyle();
|
||||||
const {stroke} = style;
|
const {stroke} = style;
|
||||||
const iconWidth = width / 3; // 图标宽度
|
const iconWidth = width; // 图标宽度
|
||||||
const iconHeight = height / 3; // 图标高度
|
const iconHeight = height; // 图标高度
|
||||||
const iconX = x - iconWidth; // 调整图标位置的X坐标
|
const iconX = x - iconWidth / 2 + 3.5; // 调整图标位置的X坐标
|
||||||
const iconY = y - iconHeight; // 调整图标位置的Y坐标
|
const iconY = y - iconHeight / 2; // 调整图标位置的Y坐标
|
||||||
return h(
|
return h(
|
||||||
'svg',
|
'svg',
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user