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