Compare commits

..

No commits in common. "4cc7bb0b4f2110844406dc1c5f7a5c5985203838" and "c8c4bd334a753f587cc80f0af3c1f80ce3094b7a" have entirely different histories.

23 changed files with 783 additions and 1193 deletions

View File

@ -1,75 +0,0 @@
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));
}
}

View File

@ -60,20 +60,11 @@ 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 category, @ApiParam(value = "流程名称", required = false) @RequestParam(required = false) String name,
@ApiParam(value = "流程名称", required = false) @RequestParam(required = false) String name) { @ApiParam(value = "流程类型", required = false) @RequestParam(required = false) String category) {
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")

View File

@ -1,6 +1,7 @@
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;
@ -8,6 +9,8 @@ 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>
@ -20,9 +23,6 @@ import java.util.Date;
@ApiModel("工作流任务相关-返回参数") @ApiModel("工作流任务相关-返回参数")
public class FlowTaskDto implements Serializable { public class FlowTaskDto implements Serializable {
@ApiModelProperty("业务名称")
private String businessKeyName;
@ApiModelProperty("任务编号") @ApiModelProperty("任务编号")
private String taskId; private String taskId;

View File

@ -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("开始时间")

View File

@ -1,27 +0,0 @@
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);
}

View File

@ -16,28 +16,15 @@ public interface IFlowDefinitionService {
boolean exist(String processDefinitionKey); boolean exist(String processDefinitionKey);
/**
*
*
* @param category
* @param name
* @param pageNum
* @param pageSize
* @return
*/
Page<FlowProcDefDto> list(String category,String name,Integer pageNum, Integer pageSize);
/** /**
* *
* *
* @param username
* @param category
* @param name
* @param pageNum * @param pageNum
* @param pageSize * @param pageSize
* @return * @return
*/ */
Page<FlowProcDefDto> myList(String username, String category,String name,Integer pageNum, Integer pageSize); Page<FlowProcDefDto> list(String category, String name,Integer pageNum, Integer pageSize);
/** /**
* *

View File

@ -1,51 +0,0 @@
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;
}
}

View File

@ -3,7 +3,6 @@ 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;
@ -30,7 +29,6 @@ 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;
@ -77,8 +75,6 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
/** /**
* *
* *
* @param category
* @param name
* @param pageNum * @param pageNum
* @param pageSize * @param pageSize
* @return * @return
@ -86,47 +82,48 @@ 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;
}
/** /**
* *
@ -194,7 +191,6 @@ 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)
@ -206,19 +202,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());
ProcessInstance processInstance; runtimeService.startProcessInstanceById(procDefId, variables);
if(variables.get("businessKey")!=null){ // 流程发起时 跳过发起人节点
processInstance = runtimeService.startProcessInstanceById(procDefId, Convert.toStr(variables.get("businessKey")),variables); // SysUser sysUser = SecurityUtils.getLoginUser().getUser();
}else{ // identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
processInstance = runtimeService.startProcessInstanceById(procDefId, variables); // variables.put(ProcessConstants.PROCESS_INITIATOR, "");
} // 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(), Convert.toStr(sysUser.getUserId())); //// taskService.setAssignee(task.getId(), sysUser.getUserId().toString());
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();

View File

@ -7,7 +7,6 @@ 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;
@ -29,7 +28,6 @@ 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;
@ -88,8 +86,6 @@ 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;
/** /**
* *
@ -525,45 +521,46 @@ 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<>();
if(CollectionUtils.isNotEmpty(historicProcessInstances)){ for (HistoricProcessInstance hisIns : historicProcessInstances) {
for (HistoricProcessInstance hisIns : historicProcessInstances) { FlowTaskDto flowTask = new FlowTaskDto();
FlowTaskDto flowTask = new FlowTaskDto(); flowTask.setCreateTime(hisIns.getStartTime());
flowTask.setCreateTime(hisIns.getStartTime()); flowTask.setFinishTime(hisIns.getEndTime());
flowTask.setFinishTime(hisIns.getEndTime()); flowTask.setProcInsId(hisIns.getId());
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() ProcessDefinition pd = repositoryService.createProcessDefinitionQuery()
.processDefinitionId(hisIns.getProcessDefinitionId()) .processDefinitionId(hisIns.getProcessDefinitionId())
.singleResult(); .singleResult();
flowTask.setDeployId(pd.getDeploymentId()); flowTask.setDeployId(pd.getDeploymentId());
flowTask.setProcDefName(pd.getName()); flowTask.setProcDefName(pd.getName());
flowTask.setProcDefVersion(pd.getVersion()); flowTask.setProcDefVersion(pd.getVersion());
flowTask.setCategory(pd.getCategory()); flowTask.setCategory(pd.getCategory());
flowTask.setProcDefVersion(pd.getVersion()); flowTask.setProcDefVersion(pd.getVersion());
// 当前所处流程 // 当前所处流程
List<Task> taskList = taskService.createTaskQuery().processInstanceId(hisIns.getId()).list(); List<Task> taskList = taskService.createTaskQuery().processInstanceId(hisIns.getId()).list();
if (CollectionUtils.isNotEmpty(taskList)) { if (CollectionUtils.isNotEmpty(taskList)) {
flowTask.setTaskId(taskList.get(0).getId()); flowTask.setTaskId(taskList.get(0).getId());
flowTask.setTaskName(taskList.get(0).getName()); flowTask.setTaskName(taskList.get(0).getName());
if (StringUtils.isNotBlank(taskList.get(0).getAssignee())) { if (StringUtils.isNotBlank(taskList.get(0).getAssignee())) {
// 当前任务节点办理人信息 // 当前任务节点办理人信息
SysUser sysUser = sysUserService.selectUserById(Long.parseLong(taskList.get(0).getAssignee())); SysUser sysUser = sysUserService.selectUserById(Long.parseLong(taskList.get(0).getAssignee()));
if (Objects.nonNull(sysUser)) { if (Objects.nonNull(sysUser)) {
flowTask.setAssigneeId(sysUser.getUserId()); flowTask.setAssigneeId(sysUser.getUserId());
flowTask.setAssigneeName(sysUser.getNickName()); flowTask.setAssigneeName(sysUser.getNickName());
flowTask.setAssigneeDeptName(Objects.nonNull(sysUser.getDept()) ? sysUser.getDept().getDeptName() : ""); flowTask.setAssigneeDeptName(Objects.nonNull(sysUser.getDept()) ? sysUser.getDept().getDeptName() : "");
}
} }
} else { }
List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list(); } else {
List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
if(CollectionUtils.isNotEmpty(historicTaskInstance)){
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())) {
@ -576,8 +573,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);

View File

@ -1,308 +0,0 @@
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;
}
}

View File

@ -1,18 +0,0 @@
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);
}

View File

@ -16,18 +16,8 @@ public interface FlowDeployMapper {
/** /**
* *
* @param category * @param name
* @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);
} }

View File

@ -1,50 +0,0 @@
<?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>

View File

@ -3,8 +3,10 @@
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,
@ -16,7 +18,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}, '%')
@ -28,33 +30,5 @@ 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>

View File

@ -1,25 +1,51 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form
<el-form-item label="名称" prop="name"> :model="queryParams"
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="category">
<el-date-picker clearable size="small" <el-select
v-model="queryParams.deployTime" v-model="queryParams.category"
type="date" @keyup.enter.native="handleQuery"
value-format="yyyy-MM-dd" placeholder="请选择流程分类"
placeholder="选择时间"> clearable
>
<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> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
>搜索</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>
@ -41,7 +67,8 @@
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
@ -52,25 +79,53 @@
: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>1XML文件中的流程定义id属性用作流程定义的key参数</div> <div>1XML文件中的流程定义id属性用作流程定义的key参数</div>
<div>2XML文件中的流程定义name属性用作流程定义的name参数如果未给定name属性会使用id作为name</div> <div>
<div>3当每个唯一key的流程第一次部署时指定版本为1对其后所有使用相同key的流程定义部署时版本会在该key当前已部署的最高版本号基础上加1key参数用于区分流程定义</div> 2XML文件中的流程定义name属性用作流程定义的name参数如果未给定name属性会使用id作为name
<div>4id参数设置为{processDefinitionKey}:{processDefinitionVersion}:{generated-id}其中generated-id是一个唯一数字用以保证在集群环境下流程定义缓存中流程id的唯一性</div> </div>
<div>
3当每个唯一key的流程第一次部署时指定版本为1对其后所有使用相同key的流程定义部署时版本会在该key当前已部署的最高版本号基础上加1key参数用于区分流程定义
</div>
<div>
4id参数设置为{processDefinitionKey}:{processDefinitionVersion}:{generated-id}其中generated-id是一个唯一数字用以保证在集群环境下流程定义缓存中流程id的唯一性
</div>
</template> </template>
</el-alert> </el-alert>
<el-table v-loading="loading" fit :data="definitionList" border @selection-change="handleSelectionChange"> <el-table
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 label="流程编号" align="center" prop="deploymentId" :show-overflow-tooltip="true"/> <el-table-column
<el-table-column label="流程标识" align="center" prop="flowKey" :show-overflow-tooltip="true" /> label="流程编号"
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 label="流程名称" align="center" width="120" :show-overflow-tooltip="true"> <el-table-column
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>
@ -79,7 +134,11 @@
</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 v-if="scope.row.formId" type="text" @click="handleForm(scope.row.formId)"> <el-button
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>
@ -87,7 +146,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">
@ -96,20 +155,64 @@
<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 label="部署时间" align="center" prop="deploymentTime" width="180"/> <el-table-column
<el-table-column label="操作" width="250" fixed="right"class-name="small-padding fixed-width"> label="部署时间"
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 @click="handleLoadXml(scope.row)" icon="el-icon-edit-outline" type="text" size="small">设计</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> @click="handleLoadXml(scope.row)"
<el-button @click="handleUpdateSuspensionState(scope.row)" icon="el-icon-video-pause" type="text" size="small" v-if="scope.row.suspensionState === 1"></el-button> icon="el-icon-edit-outline"
<el-button @click="handleUpdateSuspensionState(scope.row)" icon="el-icon-video-play" type="text" size="small" v-if="scope.row.suspensionState === 2"></el-button> type="text"
<el-button @click="handleDelete(scope.row)" icon="el-icon-delete" type="text" size="small" v-hasPermi="['system:deployment:remove']"></el-button> size="small"
>设计</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"
@ -130,13 +233,18 @@
</el-dialog> </el-dialog>
<!-- bpmn20.xml导入对话框 --> <!-- bpmn20.xml导入对话框 -->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body> <el-dialog
: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"
@ -149,7 +257,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"/>-->
@ -163,7 +271,9 @@
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="el-upload__tip" style="color:red" slot="tip">提示仅允许导入bpmn20.xml格式文件</div> <div class="el-upload__tip" style="color: red" slot="tip">
提示仅允许导入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>
@ -172,20 +282,30 @@
</el-dialog> </el-dialog>
<!-- 流程图 --> <!-- 流程图 -->
<el-dialog :title="readImage.title" :visible.sync="readImage.open" width="70%" append-to-body> <el-dialog
: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 :title="formDeployTitle" :visible.sync="formDeployOpen" width="60%" append-to-body> <el-dialog
: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
@ -194,12 +314,19 @@
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 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 size="mini" type="text" @click="submitFormDeploy(scope.row)"></el-button> <el-button size="mini" type="text" @click="submitFormDeploy(scope.row)"
>确定</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -207,7 +334,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"
@ -244,21 +371,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 {
@ -286,9 +413,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: "",
}, },
@ -305,7 +432,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: {
@ -319,26 +446,25 @@ 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() {
@ -354,20 +480,22 @@ 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(() => { })
done(); .then(() => {
}).catch(() => {}); done();
})
.catch(() => {});
}, },
// //
cancel() { cancel() {
@ -386,7 +514,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");
}, },
@ -402,9 +530,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() {
@ -413,47 +541,50 @@ 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({ path: '/flowable/definition/model',query: { deployId: row.deploymentId }}) this.$router.push({
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){
@ -469,13 +600,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) {
@ -483,16 +614,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();
}); });
@ -500,8 +631,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 = "修改流程定义";
@ -509,16 +640,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();
@ -530,32 +661,40 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const deploymentIds = row.deploymentId || this.ids; const deploymentIds = row.deploymentId || this.ids;
this.$confirm('是否确认删除流程定义编号为"' + deploymentIds + '"的数据项?', "警告", { this.$confirm(
confirmButtonText: "确定", '是否确认删除流程定义编号为"' + deploymentIds + '"的数据项?',
cancelButtonText: "取消", "警告",
type: "warning" {
}).then(function() { confirmButtonText: "确定",
return delDeployment(deploymentIds); cancelButtonText: "取消",
}).then(() => { type: "warning",
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;
}, },
@ -574,7 +713,7 @@ export default {
// //
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
} },
} },
}; };
</script> </script>

View File

@ -1,25 +1,36 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form
<el-form-item label="名称" prop="name"> :model="queryParams"
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 clearable size="small" <el-date-picker
v-model="queryParams.deployTime" clearable
type="date" size="small"
value-format="yyyy-MM-dd" v-model="queryParams.deployTime"
placeholder="选择时间"> 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> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
>搜索</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>
@ -34,45 +45,70 @@
: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 v-loading="loading" :data="finishedList" border @selection-change="handleSelectionChange"> <el-table
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 label="任务编号" align="center" prop="taskId" :show-overflow-tooltip="true"/> <el-table-column
<el-table-column label="流程名称" align="center" prop="procDefName" :show-overflow-tooltip="true"/> label="任务编号"
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>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label> <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 label="操作" width="150" fixed="right" class-name="small-padding fixed-width"> <el-table-column
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"
@ -82,12 +118,19 @@
</template> </template>
<script> <script>
import { finishedList, getDeployment, delDeployment, addDeployment, updateDeployment, exportDeployment, revokeProcess } from "@/api/flowable/finished"; import {
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 {
// //
@ -121,13 +164,12 @@ export default {
derivedFrom: null, derivedFrom: null,
derivedFromRoot: null, derivedFromRoot: null,
parentDeploymentId: null, parentDeploymentId: null,
engineVersion: null engineVersion: null,
}, },
// //
form: {}, form: {},
// //
rules: { rules: {},
}
}; };
}, },
created() { created() {
@ -137,7 +179,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;
@ -160,25 +202,23 @@ 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() {
@ -192,9 +232,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() {
@ -203,29 +243,31 @@ export default {
this.title = "添加流程定义"; this.title = "添加流程定义";
}, },
/** 流程流转记录 */ /** 流程流转记录 */
handleFlowRecord(row){ handleFlowRecord(row) {
this.$router.push({ path: '/flowable/task/finished/detail/index', this.$router.push({
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 = "修改流程定义";
@ -233,16 +275,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();
@ -257,28 +299,31 @@ 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>

View File

@ -1,20 +1,26 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form
<el-form-item label="流程名称" prop="procDefName"> :model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="流程名称" prop="name">
<el-input <el-input
v-model="queryParams.procDefName" v-model="queryParams.name"
placeholder="请输入流程名称" placeholder="请输入流程名称"
clearable clearable
size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
size="small"
/> />
</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
@ -25,19 +31,21 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="申请时间"> <el-form-item label="开始时间" prop="deployTime">
<el-date-picker <el-date-picker
v-model="daterangeCheckTime" clearable
style="width: 240px" size="small"
v-model="queryParams.deployTime"
type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="daterange" placeholder="选择时间"
range-separator="-" >
start-placeholder="开始日期" </el-date-picker>
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> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
>搜索</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>
@ -51,9 +59,10 @@
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
@ -62,68 +71,91 @@
: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-tab-pane :label="tabs.all" name="all"></el-tab-pane> <el-table
<el-tab-pane :label="tabs.await" name="await"></el-tab-pane> v-loading="loading"
<el-tab-pane :label="tabs.finished" name="finished"></el-tab-pane> :data="myProcessList"
</el-tabs> border
<el-table v-loading="loading" :data="myProcessList" @selection-change="handleSelectionChange"> @selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目名称" align="center" prop="businessKeyName" width="160" :show-overflow-tooltip="true"/> <el-table-column
<el-table-column label="流程编号" align="center" prop="procInsId" width="120" :show-overflow-tooltip="true"/> label="项目名称"
<el-table-column label="流程名称" align="center" prop="procDefName" width="120" :show-overflow-tooltip="true"/> align="left"
<el-table-column label="流程类别" align="center" prop="category" > prop="projectName"
: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">
<dict-tag <el-tag size="medium">v{{ scope.row.procDefVersion }}</el-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" width="80"> <el-table-column label="提交时间" align="center" prop="createTime" width="180" />
<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 && scope.row.assigneeId != null" size="mini"></el-tag> <el-tag type="success" v-if="scope.row.finishTime != null" size="mini"
<el-tag type="danger" v-if="scope.row.finishTime != null && scope.row.assigneeId == null" size="mini"></el-tag> >已完成</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">
<div v-if="scope.row.finishTime == null">{{ scope.row.taskName }}</div> <label v-if="scope.row.assigneeName"
<div v-if="scope.row.finishTime != null"></div> >{{ scope.row.assigneeName }}
<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 label="耗时" align="center" prop="duration" width="150"> <el-table-column
label="操作"
width="150"
fixed="right"
class-name="small-padding fixed-width"
>
<template slot-scope="scope"> <template slot-scope="scope">
{{getDurationDate(scope.row)}} <el-button @click="handleFlowRecord(scope.row)" type="text" size="small"
</template> >详情</el-button
</el-table-column> >
<el-table-column label="办理人" align="center" width="200"> <el-button @click="handleStop(scope.row)" type="text" size="small"
<template slot-scope="scope"> >取消申请</el-button
<label v-if="scope.row.assigneeName">{{scope.row.assigneeName}} <el-tag type="info" size="mini">{{scope.row.assigneeDeptName}}</el-tag></label> >
</template> <el-button
</el-table-column> @click="handleDelete(scope.row)"
<el-table-column label="操作" width="150" align="center" fixed="right" class-name="small-padding fixed-width"> type="text"
<template slot-scope="scope"> size="small"
<el-button @click="handleFlowRecord(scope.row)" type="text" size="small" icon="el-icon-finished">查看详情</el-button> v-hasPermi="['system:deployment:remove']"
<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
<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"
@ -132,7 +164,13 @@
<!-- 发起流程 --> <!-- 发起流程 -->
<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 :model="queryProcessParams" ref="queryProcessForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form
: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"
@ -142,54 +180,61 @@
@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="queryParams.category" v-model="queryProcessParams.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 type="primary" icon="el-icon-search" size="mini" @click="handleProcessQuery"></el-button> <el-button
<el-button icon="el-icon-refresh" size="mini" @click="resetProcessQuery"></el-button> type="primary"
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="400" :show-overflow-tooltip="true"/> <el-table-column label="流程名称" align="center" prop="name" width="280" />
<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" />
<template slot-scope="scope"> <el-table-column
<dict-tag label="操作"
:options="dict.type.sys_process_category" align="center"
:value="scope.row.category" width="300"
/> 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"
@ -207,18 +252,15 @@ 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 {allList,queryCount} from "@/api/flowable/businessKey"; import { myDefinitionList } from "@/api/flowable/definition";
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 {
// //
@ -234,7 +276,7 @@ export default {
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
processTotal:0, processTotal: 0,
// //
myProcessList: [], myProcessList: [],
// //
@ -242,15 +284,20 @@ export default {
// //
open: false, open: false,
src: "", src: "",
definitionList:[], definitionList: [],
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
procDefName: null, name: null,
category: null, category: null,
params: null, key: null,
activeName:null, tenantId: null,
deployTime: null,
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null,
}, },
// //
queryProcessParams: { queryProcessParams: {
@ -264,50 +311,27 @@ 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;
this.queryParams.params = {}; myProcessList(this.queryParams).then((response) => {
if (null != this.daterangeCheckTime && "" != this.daterangeCheckTime) { this.myProcessList = response.data.records;
this.queryParams.params["beginDate"] = this.daterangeCheckTime[0]; this.total = response.data.total;
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;
@ -325,7 +349,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");
}, },
@ -337,7 +361,6 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.daterangeCheckTime=[];
this.handleQuery(); this.handleQuery();
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@ -352,9 +375,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() {
@ -362,50 +385,51 @@ 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({ path: '/flowable/task/myProcess/send/index', // this.$router.push({
// 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,
} };
this.loading = true; stopProcess(params).then((res) => {
stopProcess(params).then( res => { this.$modal.msgSuccess(res.msg);
this.$modal.msgSuccess(res.msg);
this.loading=false;
this.getList(); this.getList();
}); });
}, },
/** 流程流转记录 */ /** 流程流转记录 */
handleFlowRecord(row){ handleFlowRecord(row) {
this.$router.push({ path: '/flowable/task/myProcess/detail/index', this.$router.push({
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 = "修改流程定义";
@ -413,17 +437,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();
}); });
@ -433,59 +457,35 @@ 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>

View File

@ -119,10 +119,9 @@ export default {
nickName: null, nickName: null,
disPro: false, disPro: false,
bpmnViewer: null, bpmnViewer: null,
options: {}, options: null,
taskTitle: null, taskTitle: null,
taskOpen: false, taskOpen: false,
daterangeMarksTime: [],
}; };
}, },
computed: {}, computed: {},
@ -160,6 +159,7 @@ 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;

View File

@ -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: {

View File

@ -1,25 +1,36 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form
<el-form-item label="名称" prop="name"> :model="queryParams"
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 clearable size="small" <el-date-picker
v-model="queryParams.deployTime" clearable
type="date" size="small"
value-format="yyyy-MM-dd" v-model="queryParams.deployTime"
placeholder="选择时间"> 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> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
>搜索</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>
@ -34,28 +45,41 @@
: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 v-loading="loading" :data="todoList" border @selection-change="handleSelectionChange"> <el-table
<el-table-column type="selection" width="55" align="center"/> v-loading="loading"
<el-table-column label="任务编号" align="center" prop="taskId" :show-overflow-tooltip="true"/> :data="todoList"
<el-table-column label="流程名称" align="center" prop="procDefName"/> border
<el-table-column label="当前节点" align="center" prop="taskName"/> @selection-change="handleSelectionChange"
>
<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>{{scope.row.startUserName}} <el-tag type="info" size="mini">{{scope.row.startDeptName}}</el-tag></label> <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
@ -63,14 +87,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"
@ -88,7 +112,7 @@ import {
rejectTask, rejectTask,
getDeployment, getDeployment,
delDeployment, delDeployment,
exportDeployment exportDeployment,
} from "@/api/flowable/todo"; } from "@/api/flowable/todo";
export default { export default {
@ -119,12 +143,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() {
@ -134,23 +158,25 @@ 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({ path: '/flowable/task/todo/detail/index', this.$router.push({
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() {
@ -169,7 +195,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");
}, },
@ -185,9 +211,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) {
@ -195,15 +221,16 @@ 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>

View File

@ -53,7 +53,7 @@ export default {
data() { data() {
return { return {
request: request:
"http://192.168.25.2:7086/live/cameraid/{{videoDvrNumber}}${{passage}}/substream/2.m3u8", "http://111.21.209.230:7086/live/cameraid/{{videoDvrNumber}}${{passage}}/substream/2.m3u8",
url0: "", url0: "",
url1: "", url1: "",
url2: "", url2: "",
@ -86,28 +86,24 @@ 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.url0 = this.request.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "0"); this.updatePassageState(this.videoPassageList[0].id);
//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.url1 = this.request.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "1"); this.updatePassageState(this.videoPassageList[1].id);
//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.url2 = this.request.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "2"); this.updatePassageState(this.videoPassageList[2].id);
//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.url3 = this.request.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "3"); this.updatePassageState(this.videoPassageList[3].id);
//this.updatePassageState(this.videoPassageList[3].id);
}, },
// //
initVideo() { initVideo() {
@ -131,11 +127,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);
}, },
}, },

View File

@ -74,8 +74,7 @@ export default {
videoConfigList: [], videoConfigList: [],
currentIndex: null, currentIndex: null,
request: request:
"http://192.168.25.2:7086/live/cameraid/{{videoDvrNumber}}${{passage}}/substream/2.m3u8", "http://111.21.209.230:7086/live/cameraid/{{videoDvrNumber}}${{passage}}/substream/2.m3u8",
tempResUrl:"",
url0: "", url0: "",
url1: "", url1: "",
url2: "", url2: "",
@ -111,10 +110,9 @@ 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,
tempResUrl this.request.replace("{{videoDvrNumber}}", it.videoDvrNumber)
); );
}, },
// //
@ -141,35 +139,31 @@ export default {
}); });
}, },
handleOnError0(error) { handleOnError0(error) {
//this.showVideoView0 = false; this.showVideoView0 = false;
console.log("error: ", error); console.log("error: ", error);
this.url0 = this.tempResUrl.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "0"); this.updatePassageState(this.videoPassageList[0].id);
//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.url1 = this.tempResUrl.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "1"); this.updatePassageState(this.videoPassageList[1].id);
//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.url2 = this.tempResUrl.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "2"); this.updatePassageState(this.videoPassageList[2].id);
//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.url3 = this.tempResUrl.replace("192.168.25.2","111.21.209.230").replace("{{passage}}", "3"); this.updatePassageState(this.videoPassageList[3].id);
//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);
}, },
}, },

View File

@ -77,29 +77,12 @@ PublicsController extends BaseController {
* *
*/ */
@GetMapping("/projectList") @GetMapping("/projectList")
public TableDataInfo projectList(SurProject surProject) public TableDataInfo list(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);
}
/** /**
* *
*/ */