提交代码
parent
5db1b3227b
commit
c73c50feef
|
@ -0,0 +1,75 @@
|
||||||
|
package com.ruoyi.flowable.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.ruoyi.common.enums.SysRoleEnum;
|
||||||
|
import com.ruoyi.flowable.service.IFlowBusinessKeyService;
|
||||||
|
import com.ruoyi.system.domain.FlowProcDefDto;
|
||||||
|
import com.ruoyi.system.domain.FlowTaskEntity;
|
||||||
|
import com.ruoyi.system.service.ISysDeptService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 业务工作流程自定义
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2021-04-03
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "流程定义")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/flowable/businessKey")
|
||||||
|
public class FlowBusinessKeyController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysDeptService sysDeptService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IFlowBusinessKeyService flowBusinessKeyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件查询所有流任务
|
||||||
|
* @param flowTaskEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/allList")
|
||||||
|
public TableDataInfo allList(FlowTaskEntity flowTaskEntity) {
|
||||||
|
startPage();
|
||||||
|
flowTaskEntity.setNowRole(Convert.toStr(getUserFirstRole()));
|
||||||
|
if(SysRoleEnum.ZGS.getCode().equals(flowTaskEntity.getNowRole())){
|
||||||
|
flowTaskEntity.setNowDept(Convert.toStr(sysDeptService.getZGSDeptId(getDeptId())));
|
||||||
|
}else{
|
||||||
|
flowTaskEntity.setNowDept(Convert.toStr(getDeptId()));
|
||||||
|
}
|
||||||
|
flowTaskEntity.setNowUser(Convert.toStr(getUserId()));
|
||||||
|
return getDataTable(flowBusinessKeyService.selectAllFlowTaskByParams(flowTaskEntity));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件统计所有流任务
|
||||||
|
* @param flowTaskEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/queryCount")
|
||||||
|
public AjaxResult queryCount(FlowTaskEntity flowTaskEntity) {
|
||||||
|
flowTaskEntity.setNowRole(Convert.toStr(getUserFirstRole()));
|
||||||
|
if(SysRoleEnum.ZGS.getCode().equals(flowTaskEntity.getNowRole())){
|
||||||
|
flowTaskEntity.setNowDept(Convert.toStr(sysDeptService.getZGSDeptId(getDeptId())));
|
||||||
|
}else{
|
||||||
|
flowTaskEntity.setNowDept(Convert.toStr(getDeptId()));
|
||||||
|
}
|
||||||
|
flowTaskEntity.setNowUser(Convert.toStr(getUserId()));
|
||||||
|
return success(flowBusinessKeyService.quueryCount(flowTaskEntity));
|
||||||
|
}
|
||||||
|
}
|
|
@ -60,11 +60,20 @@ public class FlowDefinitionController extends BaseController {
|
||||||
@ApiOperation(value = "流程定义列表", response = FlowProcDefDto.class)
|
@ApiOperation(value = "流程定义列表", response = FlowProcDefDto.class)
|
||||||
public AjaxResult list(@ApiParam(value = "当前页码", required = true) @RequestParam Integer pageNum,
|
public AjaxResult list(@ApiParam(value = "当前页码", required = true) @RequestParam Integer pageNum,
|
||||||
@ApiParam(value = "每页条数", required = true) @RequestParam Integer pageSize,
|
@ApiParam(value = "每页条数", required = true) @RequestParam Integer pageSize,
|
||||||
@ApiParam(value = "流程名称", required = false) @RequestParam(required = false) String name,
|
@ApiParam(value = "流程类型", required = false) @RequestParam(required = false) String category,
|
||||||
@ApiParam(value = "流程类型", required = false) @RequestParam(required = false) String category) {
|
@ApiParam(value = "流程名称", required = false) @RequestParam(required = false) String name) {
|
||||||
return AjaxResult.success(flowDefinitionService.list(category, name, pageNum, pageSize));
|
return AjaxResult.success(flowDefinitionService.list(category, name, pageNum, pageSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/myList")
|
||||||
|
@ApiOperation(value = "流程定义列表", response = FlowProcDefDto.class)
|
||||||
|
public AjaxResult myList(@ApiParam(value = "当前页码", required = true) @RequestParam Integer pageNum,
|
||||||
|
@ApiParam(value = "每页条数", required = true) @RequestParam Integer pageSize,
|
||||||
|
@ApiParam(value = "流程类型", required = false) @RequestParam(required = false) String category,
|
||||||
|
@ApiParam(value = "流程名称", required = false) @RequestParam(required = false) String name) {
|
||||||
|
return AjaxResult.success(flowDefinitionService.myList(getUsername(), category, name, pageNum, pageSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "导入流程文件", notes = "上传bpmn20的xml文件")
|
@ApiOperation(value = "导入流程文件", notes = "上传bpmn20的xml文件")
|
||||||
@PostMapping("/import")
|
@PostMapping("/import")
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.ruoyi.flowable.domain.dto;
|
package com.ruoyi.flowable.domain.dto;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
@ -9,8 +8,6 @@ import lombok.Setter;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>工作流任务<p>
|
* <p>工作流任务<p>
|
||||||
|
@ -23,6 +20,9 @@ import java.util.Map;
|
||||||
@ApiModel("工作流任务相关-返回参数")
|
@ApiModel("工作流任务相关-返回参数")
|
||||||
public class FlowTaskDto implements Serializable {
|
public class FlowTaskDto implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("业务名称")
|
||||||
|
private String businessKeyName;
|
||||||
|
|
||||||
@ApiModelProperty("任务编号")
|
@ApiModelProperty("任务编号")
|
||||||
private String taskId;
|
private String taskId;
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class FlowQueryVo {
|
||||||
@ApiModelProperty("流程名称")
|
@ApiModelProperty("流程名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty("流程类型")
|
@ApiModelProperty("流程类别")
|
||||||
private String category;
|
private String category;
|
||||||
|
|
||||||
@ApiModelProperty("开始时间")
|
@ApiModelProperty("开始时间")
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.ruoyi.flowable.service;
|
||||||
|
|
||||||
|
import com.ruoyi.system.domain.FlowTaskEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2021-04-03 14:41
|
||||||
|
*/
|
||||||
|
public interface IFlowBusinessKeyService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件查询所有流任务
|
||||||
|
* @param flowTaskEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<FlowTaskEntity> selectAllFlowTaskByParams(FlowTaskEntity flowTaskEntity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件统计所有流任务
|
||||||
|
* @param flowTaskEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String,Object> quueryCount(FlowTaskEntity flowTaskEntity);
|
||||||
|
}
|
|
@ -16,15 +16,28 @@ public interface IFlowDefinitionService {
|
||||||
|
|
||||||
boolean exist(String processDefinitionKey);
|
boolean exist(String processDefinitionKey);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程定义列表
|
* 流程定义列表
|
||||||
*
|
*
|
||||||
|
* @param category 流程类别
|
||||||
|
* @param name 流程名称
|
||||||
* @param pageNum 当前页码
|
* @param pageNum 当前页码
|
||||||
* @param pageSize 每页条数
|
* @param pageSize 每页条数
|
||||||
* @return 流程定义分页列表数据
|
* @return 流程定义分页列表数据
|
||||||
*/
|
*/
|
||||||
Page<FlowProcDefDto> list(String category, String name,Integer pageNum, Integer pageSize);
|
Page<FlowProcDefDto> list(String category,String name,Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义列表
|
||||||
|
*
|
||||||
|
* @param username 用户名称
|
||||||
|
* @param category 流程类别
|
||||||
|
* @param name 流程名称
|
||||||
|
* @param pageNum 当前页码
|
||||||
|
* @param pageSize 每页条数
|
||||||
|
* @return 流程定义分页列表数据
|
||||||
|
*/
|
||||||
|
Page<FlowProcDefDto> myList(String username, String category,String name,Integer pageNum, Integer pageSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入流程文件
|
* 导入流程文件
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.ruoyi.flowable.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.flowable.service.IFlowBusinessKeyService;
|
||||||
|
import com.ruoyi.system.domain.FlowTaskEntity;
|
||||||
|
import com.ruoyi.system.mapper.FlowBusinessKeyMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务工作流程自定义
|
||||||
|
*
|
||||||
|
* @author Tony
|
||||||
|
* @date 2021-04-03
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class FlowBusinessKeyServiceImpl implements IFlowBusinessKeyService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FlowBusinessKeyMapper flowBusinessKeyMapper;
|
||||||
|
/**
|
||||||
|
* 根据条件查询所有流任务
|
||||||
|
* @param flowTaskEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<FlowTaskEntity> selectAllFlowTaskByParams(FlowTaskEntity flowTaskEntity) {
|
||||||
|
return flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件统计所有流任务
|
||||||
|
* @param flowTaskEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String,Object> quueryCount(FlowTaskEntity flowTaskEntity) {
|
||||||
|
flowTaskEntity.setActiveName("await");
|
||||||
|
int awaitSize = flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity).size();
|
||||||
|
flowTaskEntity.setActiveName("finished");
|
||||||
|
int finishedSize = flowBusinessKeyMapper.selectAllFlowTaskByParams(flowTaskEntity).size();
|
||||||
|
Map<String, Object> dataMap = new HashMap<>();
|
||||||
|
dataMap.put("await",awaitSize);
|
||||||
|
dataMap.put("finished",finishedSize);
|
||||||
|
return dataMap;
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,6 +3,7 @@ package com.ruoyi.flowable.service.impl;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
@ -29,6 +30,7 @@ import org.flowable.image.impl.DefaultProcessDiagramGenerator;
|
||||||
import org.flowable.task.api.Task;
|
import org.flowable.task.api.Task;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -75,6 +77,8 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
|
||||||
/**
|
/**
|
||||||
* 流程定义列表
|
* 流程定义列表
|
||||||
*
|
*
|
||||||
|
* @param category 流程类别
|
||||||
|
* @param name 流程名称
|
||||||
* @param pageNum 当前页码
|
* @param pageNum 当前页码
|
||||||
* @param pageSize 每页条数
|
* @param pageSize 每页条数
|
||||||
* @return 流程定义分页列表数据
|
* @return 流程定义分页列表数据
|
||||||
|
@ -82,48 +86,47 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
|
||||||
@Override
|
@Override
|
||||||
public Page<FlowProcDefDto> list(String category, String name, Integer pageNum, Integer pageSize) {
|
public Page<FlowProcDefDto> list(String category, String name, Integer pageNum, Integer pageSize) {
|
||||||
Page<FlowProcDefDto> page = new Page<>();
|
Page<FlowProcDefDto> page = new Page<>();
|
||||||
// // 流程定义列表数据查询
|
|
||||||
// final ProcessDefinitionQuery processDefinitionQuery = repositoryService.createProcessDefinitionQuery();
|
|
||||||
// if (StringUtils.isNotEmpty(name)) {
|
|
||||||
// processDefinitionQuery.processDefinitionNameLike(name);
|
|
||||||
// }
|
|
||||||
//// processDefinitionQuery.orderByProcessDefinitionKey().asc();
|
|
||||||
// page.setTotal(processDefinitionQuery.count());
|
|
||||||
// List<ProcessDefinition> processDefinitionList = processDefinitionQuery.listPage(pageSize * (pageNum - 1), pageSize);
|
|
||||||
//
|
|
||||||
// List<FlowProcDefDto> dataList = new ArrayList<>();
|
|
||||||
// for (ProcessDefinition processDefinition : processDefinitionList) {
|
|
||||||
// String deploymentId = processDefinition.getDeploymentId();
|
|
||||||
// Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();
|
|
||||||
// FlowProcDefDto reProcDef = new FlowProcDefDto();
|
|
||||||
// BeanUtils.copyProperties(processDefinition, reProcDef);
|
|
||||||
// SysForm sysForm = sysDeployFormService.selectSysDeployFormByDeployId(deploymentId);
|
|
||||||
// if (Objects.nonNull(sysForm)) {
|
|
||||||
// reProcDef.setFormName(sysForm.getFormName());
|
|
||||||
// reProcDef.setFormId(sysForm.getFormId());
|
|
||||||
// }
|
|
||||||
// // 流程定义时间
|
|
||||||
// reProcDef.setDeploymentTime(deployment.getDeploymentTime());
|
|
||||||
// dataList.add(reProcDef);
|
|
||||||
// }
|
|
||||||
PageHelper.startPage(pageNum, pageSize);
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
final List<FlowProcDefDto> dataList = flowDeployMapper.selectDeployList(category, name);
|
final List<FlowProcDefDto> dataList = flowDeployMapper.selectDeployList(category,name);
|
||||||
/**
|
|
||||||
* 这里不启用挂载表单
|
|
||||||
*/
|
|
||||||
// 加载挂表单
|
// 加载挂表单
|
||||||
//for (FlowProcDefDto procDef : dataList) {
|
for (FlowProcDefDto procDef : dataList) {
|
||||||
//SysForm sysForm = sysDeployFormService.selectSysDeployFormByDeployId(procDef.getDeploymentId());
|
SysForm sysForm = sysDeployFormService.selectSysDeployFormByDeployId(procDef.getDeploymentId());
|
||||||
//if (Objects.nonNull(sysForm)) {
|
if (Objects.nonNull(sysForm)) {
|
||||||
// procDef.setFormName(sysForm.getFormName());
|
procDef.setFormName(sysForm.getFormName());
|
||||||
// procDef.setFormId(sysForm.getFormId());
|
procDef.setFormId(sysForm.getFormId());
|
||||||
//}
|
}
|
||||||
//}
|
}
|
||||||
page.setTotal(new PageInfo(dataList).getTotal());
|
page.setTotal(new PageInfo(dataList).getTotal());
|
||||||
page.setRecords(dataList);
|
page.setRecords(dataList);
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程定义列表
|
||||||
|
*
|
||||||
|
* @param category 流程类别
|
||||||
|
* @param name 流程名称
|
||||||
|
* @param pageNum 当前页码
|
||||||
|
* @param pageSize 每页条数
|
||||||
|
* @return 流程定义分页列表数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Page<FlowProcDefDto> myList(String username, String category, String name, Integer pageNum, Integer pageSize) {
|
||||||
|
Page<FlowProcDefDto> page = new Page<>();
|
||||||
|
PageHelper.startPage(pageNum, pageSize);
|
||||||
|
final List<FlowProcDefDto> dataList = flowDeployMapper.selectMyDeployList(username, category ,name);
|
||||||
|
// 加载挂表单
|
||||||
|
for (FlowProcDefDto procDef : dataList) {
|
||||||
|
SysForm sysForm = sysDeployFormService.selectSysDeployFormByDeployId(procDef.getDeploymentId());
|
||||||
|
if (Objects.nonNull(sysForm)) {
|
||||||
|
procDef.setFormName(sysForm.getFormName());
|
||||||
|
procDef.setFormId(sysForm.getFormId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
page.setTotal(new PageInfo(dataList).getTotal());
|
||||||
|
page.setRecords(dataList);
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入流程文件
|
* 导入流程文件
|
||||||
|
@ -191,6 +194,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables) {
|
public AjaxResult startProcessInstanceById(String procDefId, Map<String, Object> variables) {
|
||||||
try {
|
try {
|
||||||
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId)
|
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId)
|
||||||
|
@ -202,19 +206,19 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
|
||||||
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
||||||
identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
|
identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
|
||||||
variables.put(ProcessConstants.PROCESS_INITIATOR, sysUser.getUserId());
|
variables.put(ProcessConstants.PROCESS_INITIATOR, sysUser.getUserId());
|
||||||
runtimeService.startProcessInstanceById(procDefId, variables);
|
ProcessInstance processInstance;
|
||||||
// 流程发起时 跳过发起人节点
|
if(variables.get("businessKey")!=null){
|
||||||
// SysUser sysUser = SecurityUtils.getLoginUser().getUser();
|
processInstance = runtimeService.startProcessInstanceById(procDefId, Convert.toStr(variables.get("businessKey")),variables);
|
||||||
// identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
|
}else{
|
||||||
// variables.put(ProcessConstants.PROCESS_INITIATOR, "");
|
processInstance = runtimeService.startProcessInstanceById(procDefId, variables);
|
||||||
// ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables);
|
}
|
||||||
// // 给第一步申请人节点设置任务执行人和意见
|
// 给第一步申请人节点设置任务执行人和意见
|
||||||
// Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();
|
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();
|
||||||
// if (Objects.nonNull(task)) {
|
if (Objects.nonNull(task)) {
|
||||||
// taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), sysUser.getNickName() + "发起流程申请");
|
taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), sysUser.getNickName() + "发起流程申请");
|
||||||
//// taskService.setAssignee(task.getId(), sysUser.getUserId().toString());
|
taskService.setAssignee(task.getId(), Convert.toStr(sysUser.getUserId()));
|
||||||
// taskService.complete(task.getId(), variables);
|
taskService.complete(task.getId(), variables);
|
||||||
// }
|
}
|
||||||
return AjaxResult.success("流程启动成功");
|
return AjaxResult.success("流程启动成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.alibaba.fastjson2.TypeReference;
|
import com.alibaba.fastjson2.TypeReference;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
import com.ruoyi.flowable.common.constant.ProcessConstants;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||||
|
@ -28,6 +29,7 @@ import com.ruoyi.flowable.service.IFlowTaskService;
|
||||||
import com.ruoyi.flowable.service.ISysDeployFormService;
|
import com.ruoyi.flowable.service.ISysDeployFormService;
|
||||||
import com.ruoyi.flowable.service.ISysFormService;
|
import com.ruoyi.flowable.service.ISysFormService;
|
||||||
import com.ruoyi.system.domain.SysForm;
|
import com.ruoyi.system.domain.SysForm;
|
||||||
|
import com.ruoyi.system.mapper.FlowBusinessKeyMapper;
|
||||||
import com.ruoyi.system.service.ISysRoleService;
|
import com.ruoyi.system.service.ISysRoleService;
|
||||||
import com.ruoyi.system.service.ISysUserService;
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -86,6 +88,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
||||||
private ISysDeployFormService sysInstanceFormService;
|
private ISysDeployFormService sysInstanceFormService;
|
||||||
@Resource
|
@Resource
|
||||||
private ISysFormService sysFormService;
|
private ISysFormService sysFormService;
|
||||||
|
@Resource
|
||||||
|
private FlowBusinessKeyMapper flowBusinessKeyMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 完成任务
|
* 完成任务
|
||||||
|
@ -521,46 +525,45 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
||||||
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.listPage(queryVo.getPageSize() * (queryVo.getPageNum() - 1), queryVo.getPageSize());
|
List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.listPage(queryVo.getPageSize() * (queryVo.getPageNum() - 1), queryVo.getPageSize());
|
||||||
page.setTotal(historicProcessInstanceQuery.count());
|
page.setTotal(historicProcessInstanceQuery.count());
|
||||||
List<FlowTaskDto> flowList = new ArrayList<>();
|
List<FlowTaskDto> flowList = new ArrayList<>();
|
||||||
for (HistoricProcessInstance hisIns : historicProcessInstances) {
|
if(CollectionUtils.isNotEmpty(historicProcessInstances)){
|
||||||
FlowTaskDto flowTask = new FlowTaskDto();
|
for (HistoricProcessInstance hisIns : historicProcessInstances) {
|
||||||
flowTask.setCreateTime(hisIns.getStartTime());
|
FlowTaskDto flowTask = new FlowTaskDto();
|
||||||
flowTask.setFinishTime(hisIns.getEndTime());
|
flowTask.setCreateTime(hisIns.getStartTime());
|
||||||
flowTask.setProcInsId(hisIns.getId());
|
flowTask.setFinishTime(hisIns.getEndTime());
|
||||||
|
flowTask.setProcInsId(hisIns.getId());
|
||||||
// 计算耗时
|
// 计算耗时
|
||||||
if (Objects.nonNull(hisIns.getEndTime())) {
|
if (Objects.nonNull(hisIns.getEndTime())) {
|
||||||
long time = hisIns.getEndTime().getTime() - hisIns.getStartTime().getTime();
|
long time = hisIns.getEndTime().getTime() - hisIns.getStartTime().getTime();
|
||||||
flowTask.setDuration(getDate(time));
|
flowTask.setDuration(getDate(time));
|
||||||
} else {
|
} else {
|
||||||
long time = System.currentTimeMillis() - hisIns.getStartTime().getTime();
|
long time = System.currentTimeMillis() - hisIns.getStartTime().getTime();
|
||||||
flowTask.setDuration(getDate(time));
|
flowTask.setDuration(getDate(time));
|
||||||
}
|
|
||||||
// 流程定义信息
|
|
||||||
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
|
|
||||||
.processDefinitionId(hisIns.getProcessDefinitionId())
|
|
||||||
.singleResult();
|
|
||||||
flowTask.setDeployId(pd.getDeploymentId());
|
|
||||||
flowTask.setProcDefName(pd.getName());
|
|
||||||
flowTask.setProcDefVersion(pd.getVersion());
|
|
||||||
flowTask.setCategory(pd.getCategory());
|
|
||||||
flowTask.setProcDefVersion(pd.getVersion());
|
|
||||||
// 当前所处流程
|
|
||||||
List<Task> taskList = taskService.createTaskQuery().processInstanceId(hisIns.getId()).list();
|
|
||||||
if (CollectionUtils.isNotEmpty(taskList)) {
|
|
||||||
flowTask.setTaskId(taskList.get(0).getId());
|
|
||||||
flowTask.setTaskName(taskList.get(0).getName());
|
|
||||||
if (StringUtils.isNotBlank(taskList.get(0).getAssignee())) {
|
|
||||||
// 当前任务节点办理人信息
|
|
||||||
SysUser sysUser = sysUserService.selectUserById(Long.parseLong(taskList.get(0).getAssignee()));
|
|
||||||
if (Objects.nonNull(sysUser)) {
|
|
||||||
flowTask.setAssigneeId(sysUser.getUserId());
|
|
||||||
flowTask.setAssigneeName(sysUser.getNickName());
|
|
||||||
flowTask.setAssigneeDeptName(Objects.nonNull(sysUser.getDept()) ? sysUser.getDept().getDeptName() : "");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
// 流程定义信息
|
||||||
List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
|
ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
|
||||||
if(CollectionUtils.isNotEmpty(historicTaskInstance)){
|
.processDefinitionId(hisIns.getProcessDefinitionId())
|
||||||
|
.singleResult();
|
||||||
|
flowTask.setDeployId(pd.getDeploymentId());
|
||||||
|
flowTask.setProcDefName(pd.getName());
|
||||||
|
flowTask.setProcDefVersion(pd.getVersion());
|
||||||
|
flowTask.setCategory(pd.getCategory());
|
||||||
|
flowTask.setProcDefVersion(pd.getVersion());
|
||||||
|
// 当前所处流程
|
||||||
|
List<Task> taskList = taskService.createTaskQuery().processInstanceId(hisIns.getId()).list();
|
||||||
|
if (CollectionUtils.isNotEmpty(taskList)) {
|
||||||
|
flowTask.setTaskId(taskList.get(0).getId());
|
||||||
|
flowTask.setTaskName(taskList.get(0).getName());
|
||||||
|
if (StringUtils.isNotBlank(taskList.get(0).getAssignee())) {
|
||||||
|
// 当前任务节点办理人信息
|
||||||
|
SysUser sysUser = sysUserService.selectUserById(Long.parseLong(taskList.get(0).getAssignee()));
|
||||||
|
if (Objects.nonNull(sysUser)) {
|
||||||
|
flowTask.setAssigneeId(sysUser.getUserId());
|
||||||
|
flowTask.setAssigneeName(sysUser.getNickName());
|
||||||
|
flowTask.setAssigneeDeptName(Objects.nonNull(sysUser.getDept()) ? sysUser.getDept().getDeptName() : "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
|
||||||
flowTask.setTaskId(historicTaskInstance.get(0).getId());
|
flowTask.setTaskId(historicTaskInstance.get(0).getId());
|
||||||
flowTask.setTaskName(historicTaskInstance.get(0).getName());
|
flowTask.setTaskName(historicTaskInstance.get(0).getName());
|
||||||
if (StringUtils.isNotBlank(historicTaskInstance.get(0).getAssignee())) {
|
if (StringUtils.isNotBlank(historicTaskInstance.get(0).getAssignee())) {
|
||||||
|
@ -573,8 +576,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
flowList.add(flowTask);
|
||||||
}
|
}
|
||||||
flowList.add(flowTask);
|
|
||||||
}
|
}
|
||||||
page.setRecords(flowList);
|
page.setRecords(flowList);
|
||||||
return AjaxResult.success(page);
|
return AjaxResult.success(page);
|
||||||
|
|
|
@ -0,0 +1,308 @@
|
||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>工作流任务<p>
|
||||||
|
*
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2021-04-03
|
||||||
|
*/
|
||||||
|
public class FlowTaskEntity extends BaseEntity{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("业务名称")
|
||||||
|
private String businessKeyName;
|
||||||
|
|
||||||
|
@ApiModelProperty("任务编号")
|
||||||
|
private String taskId;
|
||||||
|
|
||||||
|
@ApiModelProperty("任务执行编号")
|
||||||
|
private String executionId;
|
||||||
|
|
||||||
|
@ApiModelProperty("任务名称")
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
@ApiModelProperty("任务Key")
|
||||||
|
private String taskDefKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("任务执行人Id")
|
||||||
|
private Long assigneeId;
|
||||||
|
|
||||||
|
@ApiModelProperty("部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@ApiModelProperty("流程发起人部门名称")
|
||||||
|
private String startDeptName;
|
||||||
|
|
||||||
|
@ApiModelProperty("任务执行人名称")
|
||||||
|
private String assigneeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("任务执行人部门")
|
||||||
|
private String assigneeDeptName;;
|
||||||
|
|
||||||
|
@ApiModelProperty("流程发起人Id")
|
||||||
|
private String startUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("流程发起人名称")
|
||||||
|
private String startUserName;
|
||||||
|
|
||||||
|
@ApiModelProperty("流程类型")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@ApiModelProperty("流程变量信息")
|
||||||
|
private Object procVars;
|
||||||
|
|
||||||
|
@ApiModelProperty("局部变量信息")
|
||||||
|
private Object taskLocalVars;
|
||||||
|
|
||||||
|
@ApiModelProperty("流程部署编号")
|
||||||
|
private String deployId;
|
||||||
|
|
||||||
|
@ApiModelProperty("流程ID")
|
||||||
|
private String procDefId;
|
||||||
|
|
||||||
|
@ApiModelProperty("流程key")
|
||||||
|
private String procDefKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("流程定义名称")
|
||||||
|
private String procDefName;
|
||||||
|
|
||||||
|
@ApiModelProperty("流程定义内置使用版本")
|
||||||
|
private int procDefVersion;
|
||||||
|
|
||||||
|
@ApiModelProperty("流程实例ID")
|
||||||
|
private String procInsId;
|
||||||
|
|
||||||
|
@ApiModelProperty("历史流程实例ID")
|
||||||
|
private String hisProcInsId;
|
||||||
|
|
||||||
|
@ApiModelProperty("任务耗时")
|
||||||
|
private String duration;
|
||||||
|
|
||||||
|
@ApiModelProperty("候选执行人")
|
||||||
|
private String candidate;
|
||||||
|
|
||||||
|
@ApiModelProperty("任务创建时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("任务完成时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date finishTime;
|
||||||
|
|
||||||
|
public String getBusinessKeyName() {
|
||||||
|
return businessKeyName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBusinessKeyName(String businessKeyName) {
|
||||||
|
this.businessKeyName = businessKeyName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskId() {
|
||||||
|
return taskId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskId(String taskId) {
|
||||||
|
this.taskId = taskId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExecutionId() {
|
||||||
|
return executionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutionId(String executionId) {
|
||||||
|
this.executionId = executionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskName() {
|
||||||
|
return taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskName(String taskName) {
|
||||||
|
this.taskName = taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskDefKey() {
|
||||||
|
return taskDefKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskDefKey(String taskDefKey) {
|
||||||
|
this.taskDefKey = taskDefKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAssigneeId() {
|
||||||
|
return assigneeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssigneeId(Long assigneeId) {
|
||||||
|
this.assigneeId = assigneeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeptName() {
|
||||||
|
return deptName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeptName(String deptName) {
|
||||||
|
this.deptName = deptName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartDeptName() {
|
||||||
|
return startDeptName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartDeptName(String startDeptName) {
|
||||||
|
this.startDeptName = startDeptName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAssigneeName() {
|
||||||
|
return assigneeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssigneeName(String assigneeName) {
|
||||||
|
this.assigneeName = assigneeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAssigneeDeptName() {
|
||||||
|
return assigneeDeptName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAssigneeDeptName(String assigneeDeptName) {
|
||||||
|
this.assigneeDeptName = assigneeDeptName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartUserId() {
|
||||||
|
return startUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartUserId(String startUserId) {
|
||||||
|
this.startUserId = startUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartUserName() {
|
||||||
|
return startUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartUserName(String startUserName) {
|
||||||
|
this.startUserName = startUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCategory() {
|
||||||
|
return category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategory(String category) {
|
||||||
|
this.category = category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getProcVars() {
|
||||||
|
return procVars;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcVars(Object procVars) {
|
||||||
|
this.procVars = procVars;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getTaskLocalVars() {
|
||||||
|
return taskLocalVars;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskLocalVars(Object taskLocalVars) {
|
||||||
|
this.taskLocalVars = taskLocalVars;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeployId() {
|
||||||
|
return deployId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeployId(String deployId) {
|
||||||
|
this.deployId = deployId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProcDefId() {
|
||||||
|
return procDefId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcDefId(String procDefId) {
|
||||||
|
this.procDefId = procDefId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProcDefKey() {
|
||||||
|
return procDefKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcDefKey(String procDefKey) {
|
||||||
|
this.procDefKey = procDefKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProcDefName() {
|
||||||
|
return procDefName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcDefName(String procDefName) {
|
||||||
|
this.procDefName = procDefName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getProcDefVersion() {
|
||||||
|
return procDefVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcDefVersion(int procDefVersion) {
|
||||||
|
this.procDefVersion = procDefVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProcInsId() {
|
||||||
|
return procInsId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcInsId(String procInsId) {
|
||||||
|
this.procInsId = procInsId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHisProcInsId() {
|
||||||
|
return hisProcInsId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHisProcInsId(String hisProcInsId) {
|
||||||
|
this.hisProcInsId = hisProcInsId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDuration() {
|
||||||
|
return duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDuration(String duration) {
|
||||||
|
this.duration = duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCandidate() {
|
||||||
|
return candidate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCandidate(String candidate) {
|
||||||
|
this.candidate = candidate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getFinishTime() {
|
||||||
|
return finishTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinishTime(Date finishTime) {
|
||||||
|
this.finishTime = finishTime;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.system.domain.FlowTaskEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 工作流业务相关
|
||||||
|
*/
|
||||||
|
public interface FlowBusinessKeyMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件查询所有流任务
|
||||||
|
* @param flowTaskEntity
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<FlowTaskEntity> selectAllFlowTaskByParams(FlowTaskEntity flowTaskEntity);
|
||||||
|
}
|
|
@ -16,8 +16,18 @@ public interface FlowDeployMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程定义列表
|
* 流程定义列表
|
||||||
* @param name
|
* @param category 流程类别
|
||||||
|
* @param name 流程名称
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<FlowProcDefDto> selectDeployList(@Param("category")String category, @Param("name")String name);
|
List<FlowProcDefDto> selectDeployList(@Param("category")String category, @Param("name")String name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的流程定义列表
|
||||||
|
* @param username 登录用户
|
||||||
|
* @param category 流程类别
|
||||||
|
* @param name 流程名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<FlowProcDefDto> selectMyDeployList(@Param("username")String username, @Param("category")String category, @Param("name")String name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.system.mapper.FlowBusinessKeyMapper">
|
||||||
|
|
||||||
|
<select id="selectAllFlowTaskByParams" parameterType="com.ruoyi.system.domain.FlowTaskEntity" resultType="com.ruoyi.system.domain.FlowTaskEntity">
|
||||||
|
SELECT
|
||||||
|
fa.procInsId,
|
||||||
|
fa.deployId,
|
||||||
|
fa.createTime,
|
||||||
|
fa.finishTime,
|
||||||
|
fa.duration,
|
||||||
|
fa.procDefKey,
|
||||||
|
fa.procDefName,
|
||||||
|
fa.procDefVersion,
|
||||||
|
fa.category,
|
||||||
|
fa.businessKey,
|
||||||
|
fa.businessDeptId,
|
||||||
|
fa.businessKeyName,
|
||||||
|
fa.startUserId,
|
||||||
|
fa.startUserName,
|
||||||
|
fa.startDeptName,
|
||||||
|
fa.taskId,
|
||||||
|
fa.taskName,
|
||||||
|
fa.assigneeId,
|
||||||
|
fa.assigneeName,
|
||||||
|
fa.assigneeDeptName
|
||||||
|
FROM
|
||||||
|
vw_flow_all fa
|
||||||
|
<where>
|
||||||
|
<if test="procDefName != null and procDefName != ''"> and fa.procDefName like concat('%', #{procDefName}, '%')</if>
|
||||||
|
<if test="businessKeyName != null and businessKeyName != ''"> and fa.businessKeyName like concat('%', #{businessKeyName}, '%')</if>
|
||||||
|
<if test="category != null and category != ''"> and fa.category = #{category}</if>
|
||||||
|
<if test="params.beginDate != null and params.beginDate != '' and params.endDate != null and params.endDate != ''"> and fa.createTime between #{params.beginDate} and #{params.endDate}</if>
|
||||||
|
<!-- 查询条件-项目部门 -->
|
||||||
|
<if test="projectDeptId != null "> and fa.businesDeptId = #{projectDeptId}</if>
|
||||||
|
<!--子部门数据-->
|
||||||
|
<if test='nowRole == "4"'> and fa.businesDeptId = #{nowDept}</if>
|
||||||
|
<!--监理单位/总包公司/分包单位查询当前关联数据-->
|
||||||
|
<if test='nowRole == "5" or nowRole == "6" or nowRole == "7"'> and fa.businesDeptId = #{nowDept}</if>
|
||||||
|
<!--普通用户查询项目人员-->
|
||||||
|
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> and fa.startUserId = #{nowUser}</if>
|
||||||
|
<if test='activeName == "await"'> and fa.finishTime is null</if>
|
||||||
|
<if test='activeName == "finished"'> and fa.finishTime is not null</if>
|
||||||
|
</where>
|
||||||
|
order by fa.createTime desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -3,10 +3,8 @@
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ruoyi.system.mapper.FlowDeployMapper">
|
<mapper namespace="com.ruoyi.system.mapper.FlowDeployMapper">
|
||||||
|
|
||||||
|
|
||||||
<select id="selectDeployList" resultType="com.ruoyi.system.domain.FlowProcDefDto">
|
<select id="selectDeployList" resultType="com.ruoyi.system.domain.FlowProcDefDto">
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
rp.id_ as id,
|
rp.id_ as id,
|
||||||
rp.deployment_id_ as deploymentId,
|
rp.deployment_id_ as deploymentId,
|
||||||
|
@ -18,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
rd.deploy_time_ as deploymentTime
|
rd.deploy_time_ as deploymentTime
|
||||||
FROM
|
FROM
|
||||||
act_re_procdef rp
|
act_re_procdef rp
|
||||||
LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
|
LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
|
||||||
<where>
|
<where>
|
||||||
<if test="name != null and name != ''">
|
<if test="name != null and name != ''">
|
||||||
and rd.name_ like concat('%', #{name}, '%')
|
and rd.name_ like concat('%', #{name}, '%')
|
||||||
|
@ -30,5 +28,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by rd.deploy_time_ desc
|
order by rd.deploy_time_ desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMyDeployList" resultType="com.ruoyi.system.domain.FlowProcDefDto">
|
||||||
|
SELECT
|
||||||
|
DISTINCT rp.id_ as id,
|
||||||
|
rp.deployment_id_ as deploymentId,
|
||||||
|
rd.name_ as name,
|
||||||
|
rd.category_ as category,
|
||||||
|
rp.key_ as flowKey,
|
||||||
|
rp.version_ as version,
|
||||||
|
rp.suspension_state_ as suspensionState,
|
||||||
|
rd.deploy_time_ as deploymentTime
|
||||||
|
FROM
|
||||||
|
act_re_procdef rp
|
||||||
|
LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
|
||||||
|
left join act_re_procdef_role rpr on rp.key_ = rpr.PROCDEF_KEY_
|
||||||
|
left join sys_user_role sur on sur.role_id = rpr.ROLE_ID_
|
||||||
|
left join sys_user su on su.user_id = sur.user_id
|
||||||
|
<where>
|
||||||
|
su.user_name = #{username}
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
and rd.name_ like concat('%', #{name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="category != null and category != ''">
|
||||||
|
and rd.category_ = #{category}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by rd.deploy_time_ desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -1,51 +1,25 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
:model="queryParams"
|
<el-form-item label="名称" prop="name">
|
||||||
ref="queryForm"
|
|
||||||
:inline="true"
|
|
||||||
v-show="showSearch"
|
|
||||||
label-width="68px"
|
|
||||||
>
|
|
||||||
<el-form-item label="流程名称" prop="name">
|
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.name"
|
v-model="queryParams.name"
|
||||||
placeholder="请输入流程名称"
|
placeholder="请输入名称"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="small"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="流程分类" prop="category">
|
<el-form-item label="开始时间" prop="deployTime">
|
||||||
<el-select
|
<el-date-picker clearable size="small"
|
||||||
v-model="queryParams.category"
|
v-model="queryParams.deployTime"
|
||||||
@keyup.enter.native="handleQuery"
|
type="date"
|
||||||
placeholder="请选择流程分类"
|
value-format="yyyy-MM-dd"
|
||||||
clearable
|
placeholder="选择时间">
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.sys_process_category"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="开始时间" prop="deployTime" v-if="false">
|
|
||||||
<el-date-picker
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
v-model="queryParams.deployTime"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择时间"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
>搜索</el-button
|
|
||||||
>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -67,8 +41,7 @@
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleLoadXml"
|
@click="handleLoadXml"
|
||||||
>新增</el-button
|
>新增</el-button>
|
||||||
>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -79,53 +52,25 @@
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['system:deployment:remove']"
|
v-hasPermi="['system:deployment:remove']"
|
||||||
>删除</el-button
|
>删除</el-button>
|
||||||
>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-alert title="流程设计说明" type="success">
|
<el-alert title="流程设计说明" type="success">
|
||||||
<template slot="title">
|
<template slot='title'>
|
||||||
<p>流程设计说明:</p>
|
<p>流程设计说明:</p>
|
||||||
<div>1、XML文件中的流程定义id属性用作流程定义的key参数。</div>
|
<div>1、XML文件中的流程定义id属性用作流程定义的key参数。</div>
|
||||||
<div>
|
<div>2、XML文件中的流程定义name属性用作流程定义的name参数。如果未给定name属性,会使用id作为name。</div>
|
||||||
2、XML文件中的流程定义name属性用作流程定义的name参数。如果未给定name属性,会使用id作为name。
|
<div>3、当每个唯一key的流程第一次部署时,指定版本为1。对其后所有使用相同key的流程定义,部署时版本会在该key当前已部署的最高版本号基础上加1。key参数用于区分流程定义。</div>
|
||||||
</div>
|
<div>4、id参数设置为{processDefinitionKey}:{processDefinitionVersion}:{generated-id},其中generated-id是一个唯一数字,用以保证在集群环境下,流程定义缓存中,流程id的唯一性。</div>
|
||||||
<div>
|
|
||||||
3、当每个唯一key的流程第一次部署时,指定版本为1。对其后所有使用相同key的流程定义,部署时版本会在该key当前已部署的最高版本号基础上加1。key参数用于区分流程定义。
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
4、id参数设置为{processDefinitionKey}:{processDefinitionVersion}:{generated-id},其中generated-id是一个唯一数字,用以保证在集群环境下,流程定义缓存中,流程id的唯一性。
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-alert>
|
</el-alert>
|
||||||
<el-table
|
<el-table v-loading="loading" fit :data="definitionList" border @selection-change="handleSelectionChange">
|
||||||
v-loading="loading"
|
|
||||||
fit
|
|
||||||
:data="definitionList"
|
|
||||||
border
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column
|
<el-table-column label="流程编号" align="center" prop="deploymentId" :show-overflow-tooltip="true"/>
|
||||||
label="流程编号"
|
<el-table-column label="流程标识" align="center" prop="flowKey" :show-overflow-tooltip="true" />
|
||||||
align="center"
|
|
||||||
prop="deploymentId"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="流程标识"
|
|
||||||
align="center"
|
|
||||||
prop="flowKey"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column label="流程分类" align="center" prop="category" />
|
<el-table-column label="流程分类" align="center" prop="category" />
|
||||||
<el-table-column
|
<el-table-column label="流程名称" align="center" width="120" :show-overflow-tooltip="true">
|
||||||
label="流程名称"
|
|
||||||
align="center"
|
|
||||||
width="120"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="handleReadImage(scope.row.deploymentId)">
|
<el-button type="text" @click="handleReadImage(scope.row.deploymentId)">
|
||||||
<span>{{ scope.row.name }}</span>
|
<span>{{ scope.row.name }}</span>
|
||||||
|
@ -134,11 +79,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="业务表单" align="center" :show-overflow-tooltip="true">
|
<el-table-column label="业务表单" align="center" :show-overflow-tooltip="true">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button v-if="scope.row.formId" type="text" @click="handleForm(scope.row.formId)">
|
||||||
v-if="scope.row.formId"
|
|
||||||
type="text"
|
|
||||||
@click="handleForm(scope.row.formId)"
|
|
||||||
>
|
|
||||||
<span>{{ scope.row.formName }}</span>
|
<span>{{ scope.row.formName }}</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
<label v-else>暂无表单</label>
|
<label v-else>暂无表单</label>
|
||||||
|
@ -146,7 +87,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="流程版本" align="center">
|
<el-table-column label="流程版本" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag size="medium">v{{ scope.row.version }}</el-tag>
|
<el-tag size="medium" >v{{ scope.row.version }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" align="center">
|
<el-table-column label="状态" align="center">
|
||||||
|
@ -155,64 +96,20 @@
|
||||||
<el-tag type="warning" v-if="scope.row.suspensionState === 2">挂起</el-tag>
|
<el-tag type="warning" v-if="scope.row.suspensionState === 2">挂起</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column label="部署时间" align="center" prop="deploymentTime" width="180"/>
|
||||||
label="部署时间"
|
<el-table-column label="操作" width="250" fixed="right"class-name="small-padding fixed-width">
|
||||||
align="center"
|
|
||||||
prop="deploymentTime"
|
|
||||||
width="180"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="操作"
|
|
||||||
width="250"
|
|
||||||
fixed="right"
|
|
||||||
class-name="small-padding fixed-width"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button @click="handleLoadXml(scope.row)" icon="el-icon-edit-outline" type="text" size="small">设计</el-button>
|
||||||
@click="handleLoadXml(scope.row)"
|
<el-button @click="handleAddForm(scope.row)" icon="el-icon-edit-el-icon-s-promotion" type="text" size="small" v-if="scope.row.formId == null">配置主表单</el-button>
|
||||||
icon="el-icon-edit-outline"
|
<el-button @click="handleUpdateSuspensionState(scope.row)" icon="el-icon-video-pause" type="text" size="small" v-if="scope.row.suspensionState === 1">挂起</el-button>
|
||||||
type="text"
|
<el-button @click="handleUpdateSuspensionState(scope.row)" icon="el-icon-video-play" type="text" size="small" v-if="scope.row.suspensionState === 2">激活</el-button>
|
||||||
size="small"
|
<el-button @click="handleDelete(scope.row)" icon="el-icon-delete" type="text" size="small" v-hasPermi="['system:deployment:remove']">删除</el-button>
|
||||||
>设计</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
@click="handleAddForm(scope.row)"
|
|
||||||
icon="el-icon-edit-el-icon-s-promotion"
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
v-if="scope.row.formId == null"
|
|
||||||
>配置主表单</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
@click="handleUpdateSuspensionState(scope.row)"
|
|
||||||
icon="el-icon-video-pause"
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
v-if="scope.row.suspensionState === 1"
|
|
||||||
>挂起</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
@click="handleUpdateSuspensionState(scope.row)"
|
|
||||||
icon="el-icon-video-play"
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
v-if="scope.row.suspensionState === 2"
|
|
||||||
>激活</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
v-hasPermi="['system:deployment:remove']"
|
|
||||||
>删除</el-button
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total > 0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@ -233,18 +130,13 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- bpmn20.xml导入对话框 -->
|
<!-- bpmn20.xml导入对话框 -->
|
||||||
<el-dialog
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||||
:title="upload.title"
|
|
||||||
:visible.sync="upload.open"
|
|
||||||
width="400px"
|
|
||||||
append-to-body
|
|
||||||
>
|
|
||||||
<el-upload
|
<el-upload
|
||||||
ref="upload"
|
ref="upload"
|
||||||
:limit="1"
|
:limit="1"
|
||||||
accept=".xml"
|
accept=".xml"
|
||||||
:headers="upload.headers"
|
:headers="upload.headers"
|
||||||
:action="upload.url + '?name=' + upload.name + '&category=' + upload.category"
|
:action="upload.url + '?name=' + upload.name+'&category='+ upload.category"
|
||||||
:disabled="upload.isUploading"
|
:disabled="upload.isUploading"
|
||||||
:on-progress="handleFileUploadProgress"
|
:on-progress="handleFileUploadProgress"
|
||||||
:on-success="handleFileSuccess"
|
:on-success="handleFileSuccess"
|
||||||
|
@ -257,7 +149,7 @@
|
||||||
<em>点击上传</em>
|
<em>点击上传</em>
|
||||||
</div>
|
</div>
|
||||||
<div class="el-upload__tip" slot="tip">
|
<div class="el-upload__tip" slot="tip">
|
||||||
流程名称:<el-input v-model="upload.name" />
|
流程名称:<el-input v-model="upload.name"/>
|
||||||
流程分类:
|
流程分类:
|
||||||
<div>
|
<div>
|
||||||
<!-- <el-input v-model="upload.category"/>-->
|
<!-- <el-input v-model="upload.category"/>-->
|
||||||
|
@ -271,9 +163,7 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="el-upload__tip" style="color: red" slot="tip">
|
<div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“bpmn20.xml”格式文件!</div>
|
||||||
提示:仅允许导入“bpmn20.xml”格式文件!
|
|
||||||
</div>
|
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
|
@ -282,30 +172,20 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 流程图 -->
|
<!-- 流程图 -->
|
||||||
<el-dialog
|
<el-dialog :title="readImage.title" :visible.sync="readImage.open" width="70%" append-to-body>
|
||||||
:title="readImage.title"
|
|
||||||
:visible.sync="readImage.open"
|
|
||||||
width="70%"
|
|
||||||
append-to-body
|
|
||||||
>
|
|
||||||
<!-- <el-image :src="readImage.src"></el-image> -->
|
<!-- <el-image :src="readImage.src"></el-image> -->
|
||||||
<flow :flowData="flowData" />
|
<flow :flowData="flowData"/>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!--表单配置详情-->
|
<!--表单配置详情-->
|
||||||
<el-dialog :title="formTitle" :visible.sync="formConfOpen" width="50%" append-to-body>
|
<el-dialog :title="formTitle" :visible.sync="formConfOpen" width="50%" append-to-body>
|
||||||
<div class="test-form">
|
<div class="test-form">
|
||||||
<parser :key="new Date().getTime()" :form-conf="formConf" />
|
<parser :key="new Date().getTime()" :form-conf="formConf" />
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!--挂载表单-->
|
<!--挂载表单-->
|
||||||
<el-dialog
|
<el-dialog :title="formDeployTitle" :visible.sync="formDeployOpen" width="60%" append-to-body>
|
||||||
:title="formDeployTitle"
|
|
||||||
:visible.sync="formDeployOpen"
|
|
||||||
width="60%"
|
|
||||||
append-to-body
|
|
||||||
>
|
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="10" :xs="24">
|
<el-col :span="10" :xs="24">
|
||||||
<el-table
|
<el-table
|
||||||
|
@ -314,19 +194,12 @@
|
||||||
border
|
border
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
style="width: 100%"
|
style="width: 100%">
|
||||||
>
|
|
||||||
<el-table-column label="表单编号" align="center" prop="formId" />
|
<el-table-column label="表单编号" align="center" prop="formId" />
|
||||||
<el-table-column label="表单名称" align="center" prop="formName" />
|
<el-table-column label="表单名称" align="center" prop="formName" />
|
||||||
<el-table-column
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
label="操作"
|
|
||||||
align="center"
|
|
||||||
class-name="small-padding fixed-width"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" @click="submitFormDeploy(scope.row)"
|
<el-button size="mini" type="text" @click="submitFormDeploy(scope.row)">确定</el-button>
|
||||||
>确定</el-button
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -334,7 +207,7 @@
|
||||||
<pagination
|
<pagination
|
||||||
small
|
small
|
||||||
layout="prev, pager, next"
|
layout="prev, pager, next"
|
||||||
v-show="formTotal > 0"
|
v-show="formTotal>0"
|
||||||
:total="formTotal"
|
:total="formTotal"
|
||||||
:page.sync="formQueryParams.pageNum"
|
:page.sync="formQueryParams.pageNum"
|
||||||
:limit.sync="formQueryParams.pageSize"
|
:limit.sync="formQueryParams.pageSize"
|
||||||
|
@ -371,21 +244,21 @@ import {
|
||||||
updateDeployment,
|
updateDeployment,
|
||||||
exportDeployment,
|
exportDeployment,
|
||||||
definitionStart,
|
definitionStart,
|
||||||
flowXmlAndNode,
|
flowXmlAndNode
|
||||||
} from "@/api/flowable/definition";
|
} from "@/api/flowable/definition";
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from "@/utils/auth";
|
||||||
import { getForm, addDeployForm, listForm } from "@/api/flowable/form";
|
import { getForm, addDeployForm ,listForm } from "@/api/flowable/form";
|
||||||
import Parser from "@/components/parser/Parser";
|
import Parser from '@/components/parser/Parser'
|
||||||
import flow from "@/views/flowable/task/myProcess/send/flow";
|
import flow from '@/views/flowable/task/myProcess/send/flow'
|
||||||
import Model from "./model";
|
import Model from './model';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Definition",
|
name: "Definition",
|
||||||
dicts: ["sys_process_category"],
|
dicts: ['sys_process_category'],
|
||||||
components: {
|
components: {
|
||||||
Parser,
|
Parser,
|
||||||
flow,
|
flow,
|
||||||
Model,
|
Model
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -413,9 +286,9 @@ export default {
|
||||||
formDeployOpen: false,
|
formDeployOpen: false,
|
||||||
formDeployTitle: "",
|
formDeployTitle: "",
|
||||||
formList: [],
|
formList: [],
|
||||||
formTotal: 0,
|
formTotal:0,
|
||||||
formConf: {}, // 默认表单数据
|
formConf: {}, // 默认表单数据
|
||||||
readImage: {
|
readImage:{
|
||||||
open: false,
|
open: false,
|
||||||
src: "",
|
src: "",
|
||||||
},
|
},
|
||||||
|
@ -432,7 +305,7 @@ export default {
|
||||||
// 设置上传的请求头部
|
// 设置上传的请求头部
|
||||||
headers: { Authorization: "Bearer " + getToken() },
|
headers: { Authorization: "Bearer " + getToken() },
|
||||||
// 上传的地址
|
// 上传的地址
|
||||||
url: process.env.VUE_APP_BASE_API + "/flowable/definition/import",
|
url: process.env.VUE_APP_BASE_API + "/flowable/definition/import"
|
||||||
},
|
},
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
|
@ -446,25 +319,26 @@ export default {
|
||||||
derivedFrom: null,
|
derivedFrom: null,
|
||||||
derivedFromRoot: null,
|
derivedFromRoot: null,
|
||||||
parentDeploymentId: null,
|
parentDeploymentId: null,
|
||||||
engineVersion: null,
|
engineVersion: null
|
||||||
},
|
},
|
||||||
formQueryParams: {
|
formQueryParams:{
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
// 挂载表单到流程实例
|
// 挂载表单到流程实例
|
||||||
formDeployParam: {
|
formDeployParam:{
|
||||||
formId: null,
|
formId: null,
|
||||||
deployId: null,
|
deployId: null
|
||||||
},
|
},
|
||||||
deployId: "",
|
deployId: '',
|
||||||
currentRow: null,
|
currentRow: null,
|
||||||
// xml
|
// xml
|
||||||
flowData: {},
|
flowData: {},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {},
|
rules: {
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -480,22 +354,20 @@ export default {
|
||||||
/** 查询流程定义列表 */
|
/** 查询流程定义列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listDefinition(this.queryParams).then((response) => {
|
listDefinition(this.queryParams).then(response => {
|
||||||
this.definitionList = response.data.records;
|
this.definitionList = response.data.records;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleClose(done) {
|
handleClose(done) {
|
||||||
this.$confirm("确定要关闭吗?关闭未保存的修改都会丢失?", "提示", {
|
this.$confirm('确定要关闭吗?关闭未保存的修改都会丢失?', '提示', {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: '取消',
|
||||||
type: "warning",
|
type: 'warning'
|
||||||
})
|
}).then(() => {
|
||||||
.then(() => {
|
done();
|
||||||
done();
|
}).catch(() => {});
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -514,7 +386,7 @@ export default {
|
||||||
derivedFrom: null,
|
derivedFrom: null,
|
||||||
derivedFromRoot: null,
|
derivedFromRoot: null,
|
||||||
parentDeploymentId: null,
|
parentDeploymentId: null,
|
||||||
engineVersion: null,
|
engineVersion: null
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
@ -530,9 +402,9 @@ export default {
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map((item) => item.deploymentId);
|
this.ids = selection.map(item => item.deploymentId)
|
||||||
this.single = selection.length !== 1;
|
this.single = selection.length!==1
|
||||||
this.multiple = !selection.length;
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
|
@ -541,50 +413,47 @@ export default {
|
||||||
this.title = "添加流程定义";
|
this.title = "添加流程定义";
|
||||||
},
|
},
|
||||||
/** 跳转到流程设计页面 */
|
/** 跳转到流程设计页面 */
|
||||||
handleLoadXml(row) {
|
handleLoadXml(row){
|
||||||
// this.dialogVisible = true;
|
// this.dialogVisible = true;
|
||||||
// this.deployId = row.deploymentId;
|
// this.deployId = row.deploymentId;
|
||||||
this.$router.push({
|
this.$router.push({ path: '/flowable/definition/model',query: { deployId: row.deploymentId }})
|
||||||
path: "/flowable/definition/model",
|
|
||||||
query: { deployId: row.deploymentId },
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 流程图查看 */
|
/** 流程图查看 */
|
||||||
handleReadImage(deployId) {
|
handleReadImage(deployId){
|
||||||
this.readImage.title = "流程图";
|
this.readImage.title = "流程图";
|
||||||
this.readImage.open = true;
|
this.readImage.open = true;
|
||||||
// this.readImage.src = process.env.VUE_APP_BASE_API + "/flowable/definition/readImage/" + deploymentId;
|
// this.readImage.src = process.env.VUE_APP_BASE_API + "/flowable/definition/readImage/" + deploymentId;
|
||||||
flowXmlAndNode({ deployId: deployId }).then((res) => {
|
flowXmlAndNode({deployId:deployId}).then(res => {
|
||||||
this.flowData = res.data;
|
this.flowData = res.data;
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/** 表单查看 */
|
/** 表单查看 */
|
||||||
handleForm(formId) {
|
handleForm(formId){
|
||||||
getForm(formId).then((res) => {
|
getForm(formId).then(res =>{
|
||||||
this.formTitle = "表单详情";
|
this.formTitle = "表单详情";
|
||||||
this.formConfOpen = true;
|
this.formConfOpen = true;
|
||||||
this.formConf = JSON.parse(res.data.formContent);
|
this.formConf = JSON.parse(res.data.formContent)
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/** 启动流程 */
|
/** 启动流程 */
|
||||||
handleDefinitionStart(row) {
|
handleDefinitionStart(row){
|
||||||
definitionStart(row.id).then((res) => {
|
definitionStart(row.id).then(res =>{
|
||||||
this.$modal.msgSuccess(res.msg);
|
this.$modal.msgSuccess(res.msg);
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
/** 挂载表单弹框 */
|
/** 挂载表单弹框 */
|
||||||
handleAddForm(row) {
|
handleAddForm(row){
|
||||||
this.formDeployParam.deployId = row.deploymentId;
|
this.formDeployParam.deployId = row.deploymentId
|
||||||
this.ListFormDeploy();
|
this.ListFormDeploy()
|
||||||
},
|
},
|
||||||
/** 挂载表单列表 */
|
/** 挂载表单列表 */
|
||||||
ListFormDeploy() {
|
ListFormDeploy(){
|
||||||
listForm(this.formQueryParams).then((res) => {
|
listForm(this.formQueryParams).then(res =>{
|
||||||
this.formList = res.rows;
|
this.formList = res.rows;
|
||||||
this.formTotal = res.total;
|
this.formTotal = res.total;
|
||||||
this.formDeployOpen = true;
|
this.formDeployOpen = true;
|
||||||
this.formDeployTitle = "挂载表单";
|
this.formDeployTitle = "挂载表单";
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
// /** 更改挂载表单弹框 */
|
// /** 更改挂载表单弹框 */
|
||||||
// handleEditForm(row){
|
// handleEditForm(row){
|
||||||
|
@ -600,13 +469,13 @@ export default {
|
||||||
// })
|
// })
|
||||||
// },
|
// },
|
||||||
/** 挂载表单 */
|
/** 挂载表单 */
|
||||||
submitFormDeploy(row) {
|
submitFormDeploy(row){
|
||||||
this.formDeployParam.formId = row.formId;
|
this.formDeployParam.formId = row.formId;
|
||||||
addDeployForm(this.formDeployParam).then((res) => {
|
addDeployForm(this.formDeployParam).then(res =>{
|
||||||
this.$modal.msgSuccess(res.msg);
|
this.$modal.msgSuccess(res.msg);
|
||||||
this.formDeployOpen = false;
|
this.formDeployOpen = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
handleCurrentChange(data) {
|
handleCurrentChange(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
|
@ -614,16 +483,16 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 挂起/激活流程 */
|
/** 挂起/激活流程 */
|
||||||
handleUpdateSuspensionState(row) {
|
handleUpdateSuspensionState(row){
|
||||||
let state = 1;
|
let state = 1;
|
||||||
if (row.suspensionState === 1) {
|
if (row.suspensionState === 1) {
|
||||||
state = 2;
|
state = 2
|
||||||
}
|
}
|
||||||
const params = {
|
const params = {
|
||||||
deployId: row.deploymentId,
|
deployId: row.deploymentId,
|
||||||
state: state,
|
state: state
|
||||||
};
|
}
|
||||||
updateState(params).then((res) => {
|
updateState(params).then(res => {
|
||||||
this.$modal.msgSuccess(res.msg);
|
this.$modal.msgSuccess(res.msg);
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
|
@ -631,8 +500,8 @@ export default {
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const id = row.deploymentId || this.ids;
|
const id = row.deploymentId || this.ids
|
||||||
getDeployment(id).then((response) => {
|
getDeployment(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改流程定义";
|
this.title = "修改流程定义";
|
||||||
|
@ -640,16 +509,16 @@ export default {
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate((valid) => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateDeployment(this.form).then((response) => {
|
updateDeployment(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addDeployment(this.form).then((response) => {
|
addDeployment(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
@ -661,40 +530,32 @@ export default {
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const deploymentIds = row.deploymentId || this.ids;
|
const deploymentIds = row.deploymentId || this.ids;
|
||||||
this.$confirm(
|
this.$confirm('是否确认删除流程定义编号为"' + deploymentIds + '"的数据项?', "警告", {
|
||||||
'是否确认删除流程定义编号为"' + deploymentIds + '"的数据项?',
|
confirmButtonText: "确定",
|
||||||
"警告",
|
cancelButtonText: "取消",
|
||||||
{
|
type: "warning"
|
||||||
confirmButtonText: "确定",
|
}).then(function() {
|
||||||
cancelButtonText: "取消",
|
return delDeployment(deploymentIds);
|
||||||
type: "warning",
|
}).then(() => {
|
||||||
}
|
this.getList();
|
||||||
)
|
this.$modal.msgSuccess("删除成功");
|
||||||
.then(function () {
|
})
|
||||||
return delDeployment(deploymentIds);
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
this.$confirm("是否确认导出所有流程定义数据项?", "警告", {
|
this.$confirm('是否确认导出所有流程定义数据项?', "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning"
|
||||||
|
}).then(function() {
|
||||||
|
return exportDeployment(queryParams);
|
||||||
|
}).then(response => {
|
||||||
|
this.download(response.msg);
|
||||||
})
|
})
|
||||||
.then(function () {
|
|
||||||
return exportDeployment(queryParams);
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.download(response.msg);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 导入bpmn.xml文件 */
|
/** 导入bpmn.xml文件 */
|
||||||
handleImport() {
|
handleImport(){
|
||||||
this.upload.title = "bpmn20.xml文件导入";
|
this.upload.title = "bpmn20.xml文件导入";
|
||||||
this.upload.open = true;
|
this.upload.open = true;
|
||||||
},
|
},
|
||||||
|
@ -713,7 +574,7 @@ export default {
|
||||||
// 提交上传文件
|
// 提交上传文件
|
||||||
submitFileForm() {
|
submitFileForm() {
|
||||||
this.$refs.upload.submit();
|
this.$refs.upload.submit();
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,36 +1,25 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
:model="queryParams"
|
<el-form-item label="名称" prop="name">
|
||||||
ref="queryForm"
|
|
||||||
:inline="true"
|
|
||||||
v-show="showSearch"
|
|
||||||
label-width="68px"
|
|
||||||
>
|
|
||||||
<el-form-item label="流程名称" prop="name">
|
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.name"
|
v-model="queryParams.name"
|
||||||
placeholder="请输入流程名称"
|
placeholder="请输入名称"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="small"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="开始时间" prop="deployTime">
|
<el-form-item label="开始时间" prop="deployTime">
|
||||||
<el-date-picker
|
<el-date-picker clearable size="small"
|
||||||
clearable
|
v-model="queryParams.deployTime"
|
||||||
size="small"
|
type="date"
|
||||||
v-model="queryParams.deployTime"
|
value-format="yyyy-MM-dd"
|
||||||
type="date"
|
placeholder="选择时间">
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择时间"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
>搜索</el-button
|
|
||||||
>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -45,70 +34,45 @@
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['system:deployment:remove']"
|
v-hasPermi="['system:deployment:remove']"
|
||||||
>删除</el-button
|
>删除</el-button>
|
||||||
>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table
|
<el-table v-loading="loading" :data="finishedList" border @selection-change="handleSelectionChange">
|
||||||
v-loading="loading"
|
|
||||||
:data="finishedList"
|
|
||||||
border
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column
|
<el-table-column label="任务编号" align="center" prop="taskId" :show-overflow-tooltip="true"/>
|
||||||
label="任务编号"
|
<el-table-column label="流程名称" align="center" prop="procDefName" :show-overflow-tooltip="true"/>
|
||||||
align="center"
|
|
||||||
prop="taskId"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="流程名称"
|
|
||||||
align="center"
|
|
||||||
prop="procDefName"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column label="任务节点" align="center" prop="taskName" />
|
<el-table-column label="任务节点" align="center" prop="taskName" />
|
||||||
<el-table-column label="流程发起人" align="center">
|
<el-table-column label="流程发起人" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<label
|
<label>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label>
|
||||||
>{{ scope.row.startUserName }}
|
|
||||||
<el-tag type="info" size="mini">{{ scope.row.startDeptName }}</el-tag></label
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="接收时间" align="center" prop="createTime" width="180" />
|
<el-table-column label="接收时间" align="center" prop="createTime" width="180"/>
|
||||||
<el-table-column label="审批时间" align="center" prop="finishTime" width="180" />
|
<el-table-column label="审批时间" align="center" prop="finishTime" width="180"/>
|
||||||
<el-table-column label="耗时" align="center" prop="duration" width="180" />
|
<el-table-column label="耗时" align="center" prop="duration" width="180"/>
|
||||||
<el-table-column
|
<el-table-column label="操作" width="150" fixed="right" class-name="small-padding fixed-width">
|
||||||
label="操作"
|
|
||||||
width="150"
|
|
||||||
fixed="right"
|
|
||||||
class-name="small-padding fixed-width"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-tickets"
|
icon="el-icon-tickets"
|
||||||
@click="handleFlowRecord(scope.row)"
|
@click="handleFlowRecord(scope.row)"
|
||||||
>流转记录</el-button
|
>流转记录</el-button>
|
||||||
>
|
<el-button
|
||||||
<el-button
|
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-refresh-left"
|
icon="el-icon-refresh-left"
|
||||||
@click="handleRevoke(scope.row)"
|
@click="handleRevoke(scope.row)"
|
||||||
>撤回
|
>撤回
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total > 0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@ -118,19 +82,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { finishedList, getDeployment, delDeployment, addDeployment, updateDeployment, exportDeployment, revokeProcess } from "@/api/flowable/finished";
|
||||||
finishedList,
|
|
||||||
getDeployment,
|
|
||||||
delDeployment,
|
|
||||||
addDeployment,
|
|
||||||
updateDeployment,
|
|
||||||
exportDeployment,
|
|
||||||
revokeProcess,
|
|
||||||
} from "@/api/flowable/finished";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Deploy",
|
name: "Deploy",
|
||||||
components: {},
|
components: {
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
|
@ -164,12 +121,13 @@ export default {
|
||||||
derivedFrom: null,
|
derivedFrom: null,
|
||||||
derivedFromRoot: null,
|
derivedFromRoot: null,
|
||||||
parentDeploymentId: null,
|
parentDeploymentId: null,
|
||||||
engineVersion: null,
|
engineVersion: null
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {},
|
rules: {
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -179,7 +137,7 @@ export default {
|
||||||
/** 查询流程定义列表 */
|
/** 查询流程定义列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
finishedList(this.queryParams).then((response) => {
|
finishedList(this.queryParams).then(response => {
|
||||||
this.finishedList = response.data.records;
|
this.finishedList = response.data.records;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
@ -202,23 +160,25 @@ export default {
|
||||||
derivedFrom: null,
|
derivedFrom: null,
|
||||||
derivedFromRoot: null,
|
derivedFromRoot: null,
|
||||||
parentDeploymentId: null,
|
parentDeploymentId: null,
|
||||||
engineVersion: null,
|
engineVersion: null
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
setIcon(val) {
|
setIcon(val){
|
||||||
if (val) {
|
if (val){
|
||||||
return "el-icon-check";
|
return "el-icon-check";
|
||||||
} else {
|
}else {
|
||||||
return "el-icon-time";
|
return "el-icon-time";
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
setColor(val) {
|
setColor(val){
|
||||||
if (val) {
|
if (val){
|
||||||
return "#2bc418";
|
return "#2bc418";
|
||||||
} else {
|
}else {
|
||||||
return "#b3bdbb";
|
return "#b3bdbb";
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
|
@ -232,9 +192,9 @@ export default {
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map((item) => item.id);
|
this.ids = selection.map(item => item.id)
|
||||||
this.single = selection.length !== 1;
|
this.single = selection.length!==1
|
||||||
this.multiple = !selection.length;
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
|
@ -243,31 +203,29 @@ export default {
|
||||||
this.title = "添加流程定义";
|
this.title = "添加流程定义";
|
||||||
},
|
},
|
||||||
/** 流程流转记录 */
|
/** 流程流转记录 */
|
||||||
handleFlowRecord(row) {
|
handleFlowRecord(row){
|
||||||
this.$router.push({
|
this.$router.push({ path: '/flowable/task/finished/detail/index',
|
||||||
path: "/flowable/task/finished/detail/index",
|
|
||||||
query: {
|
query: {
|
||||||
procInsId: row.procInsId,
|
procInsId: row.procInsId,
|
||||||
deployId: row.deployId,
|
deployId: row.deployId,
|
||||||
taskId: row.taskId,
|
taskId: row.taskId,
|
||||||
},
|
}})
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 撤回任务 */
|
/** 撤回任务 */
|
||||||
handleRevoke(row) {
|
handleRevoke(row){
|
||||||
const params = {
|
const params = {
|
||||||
instanceId: row.procInsId,
|
instanceId: row.procInsId
|
||||||
};
|
}
|
||||||
revokeProcess(params).then((res) => {
|
revokeProcess(params).then( res => {
|
||||||
this.$modal.msgSuccess(res.msg);
|
this.$modal.msgSuccess(res.msg);
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const id = row.id || this.ids;
|
const id = row.id || this.ids
|
||||||
getDeployment(id).then((response) => {
|
getDeployment(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改流程定义";
|
this.title = "修改流程定义";
|
||||||
|
@ -275,16 +233,16 @@ export default {
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate((valid) => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateDeployment(this.form).then((response) => {
|
updateDeployment(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addDeployment(this.form).then((response) => {
|
addDeployment(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
@ -299,31 +257,28 @@ export default {
|
||||||
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning"
|
||||||
|
}).then(function() {
|
||||||
|
return delDeployment(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
})
|
})
|
||||||
.then(function () {
|
|
||||||
return delDeployment(ids);
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
this.$confirm("是否确认导出所有流程定义数据项?", "警告", {
|
this.$confirm('是否确认导出所有流程定义数据项?', "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning"
|
||||||
|
}).then(function() {
|
||||||
|
return exportDeployment(queryParams);
|
||||||
|
}).then(response => {
|
||||||
|
this.download(response.msg);
|
||||||
})
|
})
|
||||||
.then(function () {
|
}
|
||||||
return exportDeployment(queryParams);
|
}
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.download(response.msg);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,20 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
:model="queryParams"
|
<el-form-item label="流程名称" prop="procDefName">
|
||||||
ref="queryForm"
|
|
||||||
:inline="true"
|
|
||||||
v-show="showSearch"
|
|
||||||
label-width="68px"
|
|
||||||
>
|
|
||||||
<el-form-item label="流程名称" prop="name">
|
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.name"
|
v-model="queryParams.procDefName"
|
||||||
placeholder="请输入流程名称"
|
placeholder="请输入流程名称"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
size="small"
|
size="small"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="流程分类" prop="category">
|
<el-form-item label="流程类型" prop="category">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.category"
|
v-model="queryParams.category"
|
||||||
placeholder="请选择流程分类"
|
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
|
placeholder="请选择流程类型"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
|
@ -31,21 +25,19 @@
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="开始时间" prop="deployTime">
|
<el-form-item label="申请时间">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
clearable
|
v-model="daterangeCheckTime"
|
||||||
size="small"
|
style="width: 240px"
|
||||||
v-model="queryParams.deployTime"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
placeholder="选择时间"
|
type="daterange"
|
||||||
>
|
range-separator="-"
|
||||||
</el-date-picker>
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
>搜索</el-button
|
|
||||||
>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -59,10 +51,9 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['system:deployment:add']"
|
v-hasPermi="['system:deployment:add']"
|
||||||
>新增流程</el-button
|
>新增流程</el-button>
|
||||||
>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
plain
|
plain
|
||||||
|
@ -71,91 +62,68 @@
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['system:deployment:remove']"
|
v-hasPermi="['system:deployment:remove']"
|
||||||
>删除</el-button
|
>删除</el-button>
|
||||||
>
|
</el-col> -->
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||||
<el-table
|
<el-tab-pane :label="tabs.all" name="all"></el-tab-pane>
|
||||||
v-loading="loading"
|
<el-tab-pane :label="tabs.await" name="await"></el-tab-pane>
|
||||||
:data="myProcessList"
|
<el-tab-pane :label="tabs.finished" name="finished"></el-tab-pane>
|
||||||
border
|
</el-tabs>
|
||||||
@selection-change="handleSelectionChange"
|
<el-table v-loading="loading" :data="myProcessList" @selection-change="handleSelectionChange">
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column
|
<el-table-column label="项目名称" align="center" prop="businessKeyName" width="160" :show-overflow-tooltip="true"/>
|
||||||
label="项目名称"
|
<el-table-column label="流程编号" align="center" prop="procInsId" width="120" :show-overflow-tooltip="true"/>
|
||||||
align="left"
|
<el-table-column label="流程名称" align="center" prop="procDefName" width="120" :show-overflow-tooltip="true"/>
|
||||||
prop="projectName"
|
<el-table-column label="流程类别" align="center" prop="category" >
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="流程编号"
|
|
||||||
align="center"
|
|
||||||
prop="procInsId"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="流程名称"
|
|
||||||
align="center"
|
|
||||||
prop="procDefName"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column label="流程类别" align="center" prop="category" width="100px" />
|
|
||||||
<el-table-column label="流程版本" align="center" width="80px">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag size="medium">v{{ scope.row.procDefVersion }}</el-tag>
|
<dict-tag
|
||||||
|
:options="dict.type.sys_process_category"
|
||||||
|
:value="scope.row.category"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="提交时间" align="center" prop="createTime" width="180" />
|
<el-table-column label="流程版本" align="center" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag size="medium" >v{{ scope.row.procDefVersion }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="提交时间" align="center" prop="createTime" width="180"/>
|
||||||
<el-table-column label="流程状态" align="center" width="100">
|
<el-table-column label="流程状态" align="center" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.finishTime == null" size="mini">进行中</el-tag>
|
<el-tag v-if="scope.row.finishTime == null" size="mini">进行中</el-tag>
|
||||||
<el-tag type="success" v-if="scope.row.finishTime != null" size="mini"
|
<el-tag type="success" v-if="scope.row.finishTime != null && scope.row.assigneeId != null" size="mini">已完成</el-tag>
|
||||||
>已完成</el-tag
|
<el-tag type="danger" v-if="scope.row.finishTime != null && scope.row.assigneeId == null" size="mini">已撤销</el-tag>
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="当前节点" align="center" prop="taskName" />
|
<el-table-column label="当前节点" align="center" prop="taskName">
|
||||||
<el-table-column label="耗时" align="center" prop="duration" width="180" />
|
|
||||||
<el-table-column label="办理人" align="center">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<label v-if="scope.row.assigneeName"
|
<div v-if="scope.row.finishTime == null">{{ scope.row.taskName }}</div>
|
||||||
>{{ scope.row.assigneeName }}
|
<div v-if="scope.row.finishTime != null">结束</div>
|
||||||
<el-tag type="info" size="mini">{{
|
|
||||||
scope.row.assigneeDeptName
|
|
||||||
}}</el-tag></label
|
|
||||||
>
|
|
||||||
<!-- <label v-if="scope.row.candidate">{{scope.row.candidate}}</label>-->
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column label="耗时" align="center" prop="duration" width="150">
|
||||||
label="操作"
|
|
||||||
width="150"
|
|
||||||
fixed="right"
|
|
||||||
class-name="small-padding fixed-width"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button @click="handleFlowRecord(scope.row)" type="text" size="small"
|
{{getDurationDate(scope.row)}}
|
||||||
>详情</el-button
|
</template>
|
||||||
>
|
</el-table-column>
|
||||||
<el-button @click="handleStop(scope.row)" type="text" size="small"
|
<el-table-column label="办理人" align="center" width="200">
|
||||||
>取消申请</el-button
|
<template slot-scope="scope">
|
||||||
>
|
<label v-if="scope.row.assigneeName">{{scope.row.assigneeName}} <el-tag type="info" size="mini">{{scope.row.assigneeDeptName}}</el-tag></label>
|
||||||
<el-button
|
</template>
|
||||||
@click="handleDelete(scope.row)"
|
</el-table-column>
|
||||||
type="text"
|
<el-table-column label="操作" width="150" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||||
size="small"
|
<template slot-scope="scope">
|
||||||
v-hasPermi="['system:deployment:remove']"
|
<el-button @click="handleFlowRecord(scope.row)" type="text" size="small" icon="el-icon-finished">查看详情</el-button>
|
||||||
>删除</el-button
|
<el-button v-if="scope.row.finishTime == null" @click="handleStop(scope.row)" type="text" size="small" icon="el-icon-refresh-left">撤销</el-button>
|
||||||
>
|
<el-button v-if="scope.row.finishTime == null" @click="handleDelete(scope.row)" type="text" size="small" icon="el-icon-delete" v-hasPermi="['system:deployment:remove']">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total > 0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@ -164,13 +132,7 @@
|
||||||
|
|
||||||
<!-- 发起流程 -->
|
<!-- 发起流程 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
|
||||||
<el-form
|
<el-form :model="queryProcessParams" ref="queryProcessForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
:model="queryProcessParams"
|
|
||||||
ref="queryProcessForm"
|
|
||||||
:inline="true"
|
|
||||||
v-show="showSearch"
|
|
||||||
label-width="68px"
|
|
||||||
>
|
|
||||||
<el-form-item label="流程名称" prop="name">
|
<el-form-item label="流程名称" prop="name">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryProcessParams.name"
|
v-model="queryProcessParams.name"
|
||||||
|
@ -180,61 +142,54 @@
|
||||||
@keyup.enter.native="handleProcessQuery"
|
@keyup.enter.native="handleProcessQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="流程分类" prop="category">
|
<el-form-item label="流程类型" prop="category">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryProcessParams.category"
|
v-model="queryParams.category"
|
||||||
@keyup.enter.native="handleProcessQuery"
|
@keyup.enter.native="handleProcessQuery"
|
||||||
placeholder="请选择流程分类"
|
placeholder="请选择流程类型"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.sys_process_category"
|
v-for="dict in dict.type.sys_process_category"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleProcessQuery">搜索</el-button>
|
||||||
type="primary"
|
<el-button icon="el-icon-refresh" size="mini" @click="resetProcessQuery">重置</el-button>
|
||||||
icon="el-icon-search"
|
|
||||||
size="mini"
|
|
||||||
@click="handleProcessQuery"
|
|
||||||
>搜索</el-button
|
|
||||||
>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetProcessQuery"
|
|
||||||
>重置</el-button
|
|
||||||
>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-table v-loading="processLoading" fit :data="definitionList" border>
|
<el-table v-loading="processLoading" fit :data="definitionList" border >
|
||||||
<el-table-column label="流程名称" align="center" prop="name" width="280" />
|
<el-table-column label="流程名称" align="center" prop="name" width="400" :show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="流程版本" align="center">
|
<el-table-column label="流程版本" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag size="medium">v{{ scope.row.version }}</el-tag>
|
<el-tag size="medium" >v{{ scope.row.version }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="流程分类" align="center" prop="category" />
|
<el-table-column label="流程分类" align="center" prop="category">
|
||||||
<el-table-column
|
<template slot-scope="scope">
|
||||||
label="操作"
|
<dict-tag
|
||||||
align="center"
|
:options="dict.type.sys_process_category"
|
||||||
width="300"
|
:value="scope.row.category"
|
||||||
class-name="small-padding fixed-width"
|
/>
|
||||||
>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="300" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit-outline"
|
icon="el-icon-edit-outline"
|
||||||
@click="handleStartProcess(scope.row)"
|
@click="handleStartProcess(scope.row)"
|
||||||
>发起流程</el-button
|
>发起流程</el-button>
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<pagination
|
||||||
v-show="processTotal > 0"
|
v-show="processTotal>0"
|
||||||
:total="processTotal"
|
:total="processTotal"
|
||||||
:page.sync="queryProcessParams.pageNum"
|
:page.sync="queryProcessParams.pageNum"
|
||||||
:limit.sync="queryProcessParams.pageSize"
|
:limit.sync="queryProcessParams.pageSize"
|
||||||
|
@ -252,15 +207,18 @@ import {
|
||||||
addDeployment,
|
addDeployment,
|
||||||
updateDeployment,
|
updateDeployment,
|
||||||
exportDeployment,
|
exportDeployment,
|
||||||
flowRecord,
|
flowRecord
|
||||||
} from "@/api/flowable/finished";
|
} from "@/api/flowable/finished";
|
||||||
import { myProcessList, stopProcess } from "@/api/flowable/process";
|
import { myProcessList,stopProcess } from "@/api/flowable/process";
|
||||||
import { myDefinitionList } from "@/api/flowable/definition";
|
import {allList,queryCount} from "@/api/flowable/businessKey";
|
||||||
|
import {myDefinitionList} from "@/api/flowable/definition";
|
||||||
import initTaskDrawer from "./initTaskDrawer.vue";
|
import initTaskDrawer from "./initTaskDrawer.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "Deploy",
|
name: "Deploy",
|
||||||
|
components: {
|
||||||
|
initTaskDrawer
|
||||||
|
},
|
||||||
dicts: ["sys_process_category"],
|
dicts: ["sys_process_category"],
|
||||||
components: { initTaskDrawer },
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
|
@ -276,7 +234,7 @@ export default {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
processTotal: 0,
|
processTotal:0,
|
||||||
// 我发起的流程列表数据
|
// 我发起的流程列表数据
|
||||||
myProcessList: [],
|
myProcessList: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
|
@ -284,20 +242,15 @@ export default {
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
src: "",
|
src: "",
|
||||||
definitionList: [],
|
definitionList:[],
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
name: null,
|
procDefName: null,
|
||||||
category: null,
|
category: null,
|
||||||
key: null,
|
params: null,
|
||||||
tenantId: null,
|
activeName:null,
|
||||||
deployTime: null,
|
|
||||||
derivedFrom: null,
|
|
||||||
derivedFromRoot: null,
|
|
||||||
parentDeploymentId: null,
|
|
||||||
engineVersion: null,
|
|
||||||
},
|
},
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryProcessParams: {
|
queryProcessParams: {
|
||||||
|
@ -311,27 +264,50 @@ export default {
|
||||||
derivedFrom: null,
|
derivedFrom: null,
|
||||||
derivedFromRoot: null,
|
derivedFromRoot: null,
|
||||||
parentDeploymentId: null,
|
parentDeploymentId: null,
|
||||||
engineVersion: null,
|
engineVersion: null
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {},
|
rules: {
|
||||||
|
},
|
||||||
|
daterangeCheckTime:[],
|
||||||
|
tabs:{
|
||||||
|
all:"全部申请(0)",
|
||||||
|
await:"进行中(0)",
|
||||||
|
finished:"已完成(0)",
|
||||||
|
},
|
||||||
|
activeName:"await",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.queryParams.activeName = this.activeName;
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询流程定义列表 */
|
/** 查询流程定义列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
myProcessList(this.queryParams).then((response) => {
|
this.queryParams.params = {};
|
||||||
this.myProcessList = response.data.records;
|
if (null != this.daterangeCheckTime && "" != this.daterangeCheckTime) {
|
||||||
this.total = response.data.total;
|
this.queryParams.params["beginDate"] = this.daterangeCheckTime[0];
|
||||||
|
this.queryParams.params["endDate"] = this.daterangeCheckTime[1];
|
||||||
|
}
|
||||||
|
this.queryCount(this.queryParams);
|
||||||
|
allList(this.queryParams).then(response => {
|
||||||
|
this.myProcessList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
/** 统计 */
|
||||||
|
queryCount(params){
|
||||||
|
queryCount(this.queryParams).then(response => {
|
||||||
|
this.tabs.await = "进行中("+response.data.await+")";
|
||||||
|
this.tabs.finished = "已完成("+response.data.finished+")";
|
||||||
|
this.tabs.all = "全部申请("+(parseInt(response.data.await)+parseInt(response.data.finished))+")";
|
||||||
|
});
|
||||||
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
@ -349,7 +325,7 @@ export default {
|
||||||
derivedFrom: null,
|
derivedFrom: null,
|
||||||
derivedFromRoot: null,
|
derivedFromRoot: null,
|
||||||
parentDeploymentId: null,
|
parentDeploymentId: null,
|
||||||
engineVersion: null,
|
engineVersion: null
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
@ -361,6 +337,7 @@ export default {
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
|
this.daterangeCheckTime=[];
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
|
@ -375,9 +352,9 @@ export default {
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map((item) => item.procInsId);
|
this.ids = selection.map(item => item.procInsId)
|
||||||
this.single = selection.length !== 1;
|
this.single = selection.length!==1
|
||||||
this.multiple = !selection.length;
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
|
@ -385,51 +362,50 @@ export default {
|
||||||
this.title = "发起流程";
|
this.title = "发起流程";
|
||||||
this.myDefinitionList();
|
this.myDefinitionList();
|
||||||
},
|
},
|
||||||
myDefinitionList() {
|
myDefinitionList(){
|
||||||
myDefinitionList(this.queryProcessParams).then((response) => {
|
myDefinitionList(this.queryProcessParams).then(response => {
|
||||||
this.definitionList = response.data.records;
|
this.definitionList = response.data.records;
|
||||||
this.processTotal = response.data.total;
|
this.processTotal = response.data.total;
|
||||||
this.processLoading = false;
|
this.processLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 发起流程申请 */
|
/** 发起流程申请 */
|
||||||
handleStartProcess(row) {
|
handleStartProcess(row){
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.$refs.initTaskDrawer.show(row);
|
this.$refs.initTaskDrawer.show(row);
|
||||||
// this.$router.push({
|
// this.$router.push({ path: '/flowable/task/myProcess/send/index',
|
||||||
// path: "/flowable/task/myProcess/send/index",
|
|
||||||
// query: {
|
// query: {
|
||||||
// deployId: row.deploymentId,
|
// deployId: row.deploymentId,
|
||||||
// procDefId: row.id,
|
// procDefId: row.id
|
||||||
// },
|
// }
|
||||||
// });
|
// })
|
||||||
},
|
},
|
||||||
/** 取消流程申请 */
|
/** 取消流程申请 */
|
||||||
handleStop(row) {
|
handleStop(row){
|
||||||
const params = {
|
const params = {
|
||||||
instanceId: row.procInsId,
|
instanceId: row.procInsId
|
||||||
};
|
}
|
||||||
stopProcess(params).then((res) => {
|
this.loading = true;
|
||||||
this.$modal.msgSuccess(res.msg);
|
stopProcess(params).then( res => {
|
||||||
|
this.$modal.msgSuccess(res.msg);
|
||||||
|
this.loading=false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 流程流转记录 */
|
/** 流程流转记录 */
|
||||||
handleFlowRecord(row) {
|
handleFlowRecord(row){
|
||||||
this.$router.push({
|
this.$router.push({ path: '/flowable/task/myProcess/detail/index',
|
||||||
path: "/flowable/task/myProcess/detail/index",
|
|
||||||
query: {
|
query: {
|
||||||
procInsId: row.procInsId,
|
procInsId: row.procInsId,
|
||||||
deployId: row.deployId,
|
deployId: row.deployId,
|
||||||
taskId: row.taskId,
|
taskId: row.taskId
|
||||||
},
|
}})
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
const id = row.id || this.ids;
|
const id = row.id || this.ids
|
||||||
getDeployment(id).then((response) => {
|
getDeployment(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改流程定义";
|
this.title = "修改流程定义";
|
||||||
|
@ -437,17 +413,17 @@ export default {
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate((valid) => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateDeployment(this.form).then((response) => {
|
updateDeployment(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
addDeployment(this.form).then((response) => {
|
addDeployment(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
|
@ -457,35 +433,59 @@ export default {
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.procInsId || this.ids; // 暂不支持删除多个流程
|
const ids = row.procInsId || this.ids;// 暂不支持删除多个流程
|
||||||
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning"
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = true;
|
||||||
|
return delDeployment(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
})
|
})
|
||||||
.then(() => {
|
|
||||||
return delDeployment(ids);
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const queryParams = this.queryParams;
|
const queryParams = this.queryParams;
|
||||||
this.$confirm("是否确认导出所有流程定义数据项?", "警告", {
|
this.$confirm('是否确认导出所有流程定义数据项?', "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning"
|
||||||
|
}).then(() => {
|
||||||
|
return exportDeployment(queryParams);
|
||||||
|
}).then(response => {
|
||||||
|
this.download(response.msg);
|
||||||
})
|
})
|
||||||
.then(() => {
|
|
||||||
return exportDeployment(queryParams);
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.download(response.msg);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
// 页签点击
|
||||||
|
handleClick() {
|
||||||
|
this.queryParams.activeName = this.activeName;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
getDurationDate(row){
|
||||||
|
let day=0;
|
||||||
|
let hours=0;
|
||||||
|
let min = row.duration;
|
||||||
|
if(min>1440){
|
||||||
|
day = parseInt(min/1440);
|
||||||
|
min = min % 1440;
|
||||||
|
if(min>60){
|
||||||
|
hours = parseInt(min/60);
|
||||||
|
min = min % 60;
|
||||||
|
}
|
||||||
|
}else if(min>60){
|
||||||
|
hours = parseInt(min/60);
|
||||||
|
min = min % 60;
|
||||||
|
}
|
||||||
|
if(day<10) day="0"+day;
|
||||||
|
if(hours<10) hours="0"+hours;
|
||||||
|
if(min<10) min="0"+min;
|
||||||
|
return day+"天"+hours+"小时"+min+"分钟";
|
||||||
|
},
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -119,9 +119,10 @@ export default {
|
||||||
nickName: null,
|
nickName: null,
|
||||||
disPro: false,
|
disPro: false,
|
||||||
bpmnViewer: null,
|
bpmnViewer: null,
|
||||||
options: null,
|
options: {},
|
||||||
taskTitle: null,
|
taskTitle: null,
|
||||||
taskOpen: false,
|
taskOpen: false,
|
||||||
|
daterangeMarksTime: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
|
@ -159,7 +160,6 @@ export default {
|
||||||
this.onOpen = false;
|
this.onOpen = false;
|
||||||
},
|
},
|
||||||
show(options) {
|
show(options) {
|
||||||
console.log(options);
|
|
||||||
this.options = options;
|
this.options = options;
|
||||||
this.initMyProject();
|
this.initMyProject();
|
||||||
this.title = options.name;
|
this.title = options.name;
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
<el-button v-if="!formKeyExist" icon="el-icon-edit-outline" type="success" size="mini"
|
<el-button v-if="!formKeyExist" icon="el-icon-edit-outline" type="success" size="mini"
|
||||||
@click="handleComplete">审批
|
@click="handleComplete">审批
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">委派</el-button>-->
|
<el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">委派</el-button>
|
||||||
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleAssign">转办</el-button>-->
|
<el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleAssign">转办</el-button>
|
||||||
<!-- <el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">签收</el-button>-->
|
<el-button icon="el-icon-edit-outline" type="primary" size="mini" @click="handleDelegate">签收</el-button>
|
||||||
<!-- <el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleReturn">退回</el-button>-->
|
<el-button icon="el-icon-refresh-left" type="warning" size="mini" @click="handleReturn">退回</el-button>
|
||||||
<!-- <el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject">驳回</el-button>-->
|
<el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject">驳回</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
@ -238,10 +238,10 @@ export default {
|
||||||
this.taskForm.instanceId = this.$route.query.procInsId;
|
this.taskForm.instanceId = this.$route.query.procInsId;
|
||||||
// 流程任务获取变量信息
|
// 流程任务获取变量信息
|
||||||
if (this.taskForm.taskId) {
|
if (this.taskForm.taskId) {
|
||||||
this.processVariables(this.taskForm.taskId)
|
//this.processVariables(this.taskForm.taskId)
|
||||||
this.getFlowTaskForm(this.taskForm.taskId)
|
//this.getFlowTaskForm(this.taskForm.taskId)
|
||||||
}
|
}
|
||||||
this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
|
//this.getFlowRecordList(this.taskForm.procInsId, this.taskForm.deployId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -1,36 +1,25 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
:model="queryParams"
|
<el-form-item label="名称" prop="name">
|
||||||
ref="queryForm"
|
|
||||||
:inline="true"
|
|
||||||
v-show="showSearch"
|
|
||||||
label-width="68px"
|
|
||||||
>
|
|
||||||
<el-form-item label="流程名称" prop="name">
|
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.name"
|
v-model="queryParams.name"
|
||||||
placeholder="请输入流程名称"
|
placeholder="请输入名称"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="small"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="开始时间" prop="deployTime">
|
<el-form-item label="开始时间" prop="deployTime">
|
||||||
<el-date-picker
|
<el-date-picker clearable size="small"
|
||||||
clearable
|
v-model="queryParams.deployTime"
|
||||||
size="small"
|
type="date"
|
||||||
v-model="queryParams.deployTime"
|
value-format="yyyy-MM-dd"
|
||||||
type="date"
|
placeholder="选择时间">
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="选择时间"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
>搜索</el-button
|
|
||||||
>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -45,41 +34,28 @@
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['system:deployment:remove']"
|
v-hasPermi="['system:deployment:remove']"
|
||||||
>删除
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table
|
<el-table v-loading="loading" :data="todoList" border @selection-change="handleSelectionChange">
|
||||||
v-loading="loading"
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
:data="todoList"
|
<el-table-column label="任务编号" align="center" prop="taskId" :show-overflow-tooltip="true"/>
|
||||||
border
|
<el-table-column label="流程名称" align="center" prop="procDefName"/>
|
||||||
@selection-change="handleSelectionChange"
|
<el-table-column label="当前节点" align="center" prop="taskName"/>
|
||||||
>
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column
|
|
||||||
label="任务编号"
|
|
||||||
align="center"
|
|
||||||
prop="taskId"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column label="流程名称" align="center" prop="procDefName" />
|
|
||||||
<el-table-column label="当前节点" align="center" prop="taskName" />
|
|
||||||
<el-table-column label="流程版本" align="center">
|
<el-table-column label="流程版本" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag size="medium">v{{ scope.row.procDefVersion }}</el-tag>
|
<el-tag size="medium" >v{{scope.row.procDefVersion}}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="流程发起人" align="center">
|
<el-table-column label="流程发起人" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<label
|
<label>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label>
|
||||||
>{{ scope.row.startUserName }}
|
|
||||||
<el-tag type="info" size="mini">{{ scope.row.startDeptName }}</el-tag></label
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="接收时间" align="center" prop="createTime" width="180" />
|
<el-table-column label="接收时间" align="center" prop="createTime" width="180"/>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -87,14 +63,14 @@
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit-outline"
|
icon="el-icon-edit-outline"
|
||||||
@click="handleProcess(scope.row)"
|
@click="handleProcess(scope.row)"
|
||||||
>处理
|
>处理
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total > 0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@ -112,7 +88,7 @@ import {
|
||||||
rejectTask,
|
rejectTask,
|
||||||
getDeployment,
|
getDeployment,
|
||||||
delDeployment,
|
delDeployment,
|
||||||
exportDeployment,
|
exportDeployment
|
||||||
} from "@/api/flowable/todo";
|
} from "@/api/flowable/todo";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -143,12 +119,12 @@ export default {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
name: null,
|
name: null,
|
||||||
category: null,
|
category: null
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {},
|
rules: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -158,25 +134,23 @@ export default {
|
||||||
/** 查询流程定义列表 */
|
/** 查询流程定义列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
todoList(this.queryParams).then((response) => {
|
todoList(this.queryParams).then(response => {
|
||||||
this.todoList = response.data.records;
|
this.todoList = response.data.records;
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 跳转到处理页面
|
// 跳转到处理页面
|
||||||
handleProcess(row) {
|
handleProcess(row){
|
||||||
this.$router.push({
|
this.$router.push({ path: '/flowable/task/todo/detail/index',
|
||||||
path: "/flowable/task/todo/detail/index",
|
|
||||||
query: {
|
query: {
|
||||||
procInsId: row.procInsId,
|
procInsId: row.procInsId,
|
||||||
executionId: row.executionId,
|
executionId: row.executionId,
|
||||||
deployId: row.deployId,
|
deployId: row.deployId,
|
||||||
taskId: row.taskId,
|
taskId: row.taskId,
|
||||||
taskName: row.taskName,
|
taskName: row.taskName,
|
||||||
startUser: row.startUserName + "-" + row.startDeptName,
|
startUser: row.startUserName + '-' + row.startDeptName,
|
||||||
},
|
}})
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
|
@ -195,7 +169,7 @@ export default {
|
||||||
derivedFrom: null,
|
derivedFrom: null,
|
||||||
derivedFromRoot: null,
|
derivedFromRoot: null,
|
||||||
parentDeploymentId: null,
|
parentDeploymentId: null,
|
||||||
engineVersion: null,
|
engineVersion: null
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
@ -211,9 +185,9 @@ export default {
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map((item) => item.taskId);
|
this.ids = selection.map(item => item.taskId)
|
||||||
this.single = selection.length !== 1;
|
this.single = selection.length !== 1
|
||||||
this.multiple = !selection.length;
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
|
@ -221,16 +195,15 @@ export default {
|
||||||
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
this.$confirm('是否确认删除流程定义编号为"' + ids + '"的数据项?', "警告", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning"
|
||||||
|
}).then(function () {
|
||||||
|
return delDeployment(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
})
|
})
|
||||||
.then(function () {
|
|
||||||
return delDeployment(ids);
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
request:
|
request:
|
||||||
"http://111.21.209.230:7086/live/cameraid/{{videoDvrNumber}}${{passage}}/substream/2.m3u8",
|
"http://192.168.25.2:7086/live/cameraid/{{videoDvrNumber}}${{passage}}/substream/2.m3u8",
|
||||||
url0: "",
|
url0: "",
|
||||||
url1: "",
|
url1: "",
|
||||||
url2: "",
|
url2: "",
|
||||||
|
@ -86,24 +86,28 @@ export default {
|
||||||
onOpen() {},
|
onOpen() {},
|
||||||
onClose() {},
|
onClose() {},
|
||||||
handleOnError0(error) {
|
handleOnError0(error) {
|
||||||
this.showVideoView0 = false;
|
//this.showVideoView0 = false;
|
||||||
console.log("error: ", error);
|
console.log("error: ", error);
|
||||||
this.updatePassageState(this.videoPassageList[0].id);
|
this.url0 = this.request.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "0");
|
||||||
|
//this.updatePassageState(this.videoPassageList[0].id);
|
||||||
},
|
},
|
||||||
handleOnError1(error) {
|
handleOnError1(error) {
|
||||||
this.showVideoView1 = false;
|
//this.showVideoView1 = false;
|
||||||
console.log("error: ", error);
|
console.log("error: ", error);
|
||||||
this.updatePassageState(this.videoPassageList[1].id);
|
this.url1 = this.request.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "1");
|
||||||
|
//this.updatePassageState(this.videoPassageList[1].id);
|
||||||
},
|
},
|
||||||
handleOnError2(error) {
|
handleOnError2(error) {
|
||||||
this.showVideoView2 = false;
|
//this.showVideoView2 = false;
|
||||||
console.log("error: ", error);
|
console.log("error: ", error);
|
||||||
this.updatePassageState(this.videoPassageList[2].id);
|
this.url2 = this.request.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "2");
|
||||||
|
//this.updatePassageState(this.videoPassageList[2].id);
|
||||||
},
|
},
|
||||||
handleOnError3(error) {
|
handleOnError3(error) {
|
||||||
this.showVideoView3 = false;
|
//this.showVideoView3 = false;
|
||||||
console.log("error: ", error);
|
console.log("error: ", error);
|
||||||
this.updatePassageState(this.videoPassageList[3].id);
|
this.url3 = this.request.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "3");
|
||||||
|
//this.updatePassageState(this.videoPassageList[3].id);
|
||||||
},
|
},
|
||||||
//查询视频通道
|
//查询视频通道
|
||||||
initVideo() {
|
initVideo() {
|
||||||
|
@ -127,11 +131,11 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updatePassageState(id) {
|
updatePassageState(id) {
|
||||||
let param = {
|
// let param = {
|
||||||
id: id,
|
// id: id,
|
||||||
videoDvrNumber: this.formData.videoDvrNumber,
|
// videoDvrNumber: this.formData.videoDvrNumber,
|
||||||
passageState: "2",
|
// passageState: "2",
|
||||||
};
|
// };
|
||||||
//editPassageState(param);
|
//editPassageState(param);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -74,7 +74,8 @@ export default {
|
||||||
videoConfigList: [],
|
videoConfigList: [],
|
||||||
currentIndex: null,
|
currentIndex: null,
|
||||||
request:
|
request:
|
||||||
"http://111.21.209.230:7086/live/cameraid/{{videoDvrNumber}}${{passage}}/substream/2.m3u8",
|
"http://192.168.25.2:7086/live/cameraid/{{videoDvrNumber}}${{passage}}/substream/2.m3u8",
|
||||||
|
tempResUrl:"",
|
||||||
url0: "",
|
url0: "",
|
||||||
url1: "",
|
url1: "",
|
||||||
url2: "",
|
url2: "",
|
||||||
|
@ -110,9 +111,10 @@ export default {
|
||||||
this.showVideoView2 = true;
|
this.showVideoView2 = true;
|
||||||
this.showVideoView3 = true;
|
this.showVideoView3 = true;
|
||||||
this.videoDvrNumber = it.videoDvrNumber;
|
this.videoDvrNumber = it.videoDvrNumber;
|
||||||
|
this.tempResUrl = this.request.replace("{{videoDvrNumber}}", it.videoDvrNumber);
|
||||||
this.initVideo(
|
this.initVideo(
|
||||||
it.videoDvrNumber,
|
it.videoDvrNumber,
|
||||||
this.request.replace("{{videoDvrNumber}}", it.videoDvrNumber)
|
tempResUrl
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
//查询视频通道
|
//查询视频通道
|
||||||
|
@ -139,31 +141,35 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleOnError0(error) {
|
handleOnError0(error) {
|
||||||
this.showVideoView0 = false;
|
//this.showVideoView0 = false;
|
||||||
console.log("error: ", error);
|
console.log("error: ", error);
|
||||||
this.updatePassageState(this.videoPassageList[0].id);
|
this.url0 = this.tempResUrl.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "0");
|
||||||
|
//this.updatePassageState(this.videoPassageList[0].id);
|
||||||
},
|
},
|
||||||
handleOnError1(error) {
|
handleOnError1(error) {
|
||||||
this.showVideoView1 = false;
|
//this.showVideoView1 = false;
|
||||||
console.log("error: ", error);
|
console.log("error: ", error);
|
||||||
this.updatePassageState(this.videoPassageList[1].id);
|
this.url1 = this.tempResUrl.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "1");
|
||||||
|
//this.updatePassageState(this.videoPassageList[1].id);
|
||||||
},
|
},
|
||||||
handleOnError2(error) {
|
handleOnError2(error) {
|
||||||
this.showVideoView2 = false;
|
//this.showVideoView2 = false;
|
||||||
console.log("error: ", error);
|
console.log("error: ", error);
|
||||||
this.updatePassageState(this.videoPassageList[2].id);
|
this.url2 = this.tempResUrl.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "2");
|
||||||
|
//this.updatePassageState(this.videoPassageList[2].id);
|
||||||
},
|
},
|
||||||
handleOnError3(error) {
|
handleOnError3(error) {
|
||||||
this.showVideoView3 = false;
|
//this.showVideoView3 = false;
|
||||||
console.log("error: ", error);
|
console.log("error: ", error);
|
||||||
this.updatePassageState(this.videoPassageList[3].id);
|
this.url3 = this.tempResUrl.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "3");
|
||||||
|
//this.updatePassageState(this.videoPassageList[3].id);
|
||||||
},
|
},
|
||||||
updatePassageState(id) {
|
updatePassageState(id) {
|
||||||
let param = {
|
// let param = {
|
||||||
id: id,
|
// id: id,
|
||||||
videoDvrNumber: this.videoDvrNumber,
|
// videoDvrNumber: this.videoDvrNumber,
|
||||||
passageState: "2",
|
// passageState: "2",
|
||||||
};
|
// };
|
||||||
//editPassageState(param);
|
//editPassageState(param);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -77,12 +77,29 @@ PublicsController extends BaseController {
|
||||||
* 查询项目列表
|
* 查询项目列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/projectList")
|
@GetMapping("/projectList")
|
||||||
public TableDataInfo list(SurProject surProject)
|
public TableDataInfo projectList(SurProject surProject)
|
||||||
{
|
{
|
||||||
List<SurProject> list = surProjectService.selectSurProjectList(surProject);
|
List<SurProject> list = surProjectService.selectSurProjectList(surProject);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询我的项目列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/findMyProjectList")
|
||||||
|
public TableDataInfo findMyProjectList(SurProject surProject)
|
||||||
|
{
|
||||||
|
surProject.setNowRole(Convert.toStr(getUserFirstRole()));
|
||||||
|
if(SysRoleEnum.ZGS.getCode().equals(surProject.getNowRole())){
|
||||||
|
surProject.setNowDept(Convert.toStr(deptService.getZGSDeptId(getDeptId())));
|
||||||
|
}else{
|
||||||
|
surProject.setNowDept(Convert.toStr(getDeptId()));
|
||||||
|
}
|
||||||
|
surProject.setNowUser(Convert.toStr(getUserId()));
|
||||||
|
List<SurProject> list = surProjectService.selectSurProjectList(surProject);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户列表
|
* 获取用户列表
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue