Commit 749cb5d762075f7a3ba739d8f14a4bafeec0153c
1 parent
2630ad8e
1. 新增流程定义的列表 API
2. 新增流程创建的界面,暂未实现完全
Showing
14 changed files
with
250 additions
and
104 deletions
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmProcessDefinitionController.http
0 → 100644
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/BpmProcessDefinitionController.java
| 1 | 1 | package cn.iocoder.yudao.adminserver.modules.bpm.controller.definition; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionListReqVO; | |
| 3 | 4 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageItemRespVO; |
| 4 | 5 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageReqVO; |
| 6 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionRespVO; | |
| 5 | 7 | import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.BpmProcessDefinitionService; |
| 6 | 8 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 7 | 9 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| ... | ... | @@ -17,6 +19,8 @@ import org.springframework.web.bind.annotation.RestController; |
| 17 | 19 | |
| 18 | 20 | import javax.annotation.Resource; |
| 19 | 21 | |
| 22 | +import java.util.List; | |
| 23 | + | |
| 20 | 24 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | 25 | |
| 22 | 26 | @Api(tags = "流程定义") |
| ... | ... | @@ -36,6 +40,13 @@ public class BpmProcessDefinitionController { |
| 36 | 40 | return success(bpmDefinitionService.getProcessDefinitionPage(pageReqVO)); |
| 37 | 41 | } |
| 38 | 42 | |
| 43 | + @GetMapping ("/list") | |
| 44 | + @ApiOperation(value = "获得流程定义列表") | |
| 45 | + public CommonResult<List<BpmProcessDefinitionRespVO>> getProcessDefinitionList( | |
| 46 | + BpmProcessDefinitionListReqVO listReqVO) { | |
| 47 | + return success(bpmDefinitionService.getProcessDefinitionList(listReqVO)); | |
| 48 | + } | |
| 49 | + | |
| 39 | 50 | @GetMapping ("/get-bpmn-xml") |
| 40 | 51 | @ApiOperation(value = "获得流程定义的 BPMN XML") |
| 41 | 52 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = String.class) | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/vo/BpmProcessDefinitionListReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.annotations.ApiModel; | |
| 5 | +import io.swagger.annotations.ApiModelProperty; | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.EqualsAndHashCode; | |
| 8 | +import lombok.ToString; | |
| 9 | + | |
| 10 | +@Data | |
| 11 | +@ToString(callSuper = true) | |
| 12 | +@EqualsAndHashCode(callSuper = true) | |
| 13 | +@ApiModel("流程定义列表 Request VO") | |
| 14 | +public class BpmProcessDefinitionListReqVO extends PageParam { | |
| 15 | + | |
| 16 | + @ApiModelProperty(value = "中断状态", example = "1", notes = "参见 SuspensionState 枚举") | |
| 17 | + private Integer suspensionState; | |
| 18 | + | |
| 19 | +} | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/definition/vo/BpmProcessDefinitionPageItemRespVO.java
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/definition/BpmDefinitionConvert.java
| 1 | 1 | package cn.iocoder.yudao.adminserver.modules.bpm.convert.definition; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageItemRespVO; |
| 4 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionRespVO; | |
| 4 | 5 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO; |
| 5 | 6 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO; |
| 6 | 7 | import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmDefinitionCreateReqDTO; |
| ... | ... | @@ -9,6 +10,9 @@ import org.activiti.engine.impl.persistence.entity.SuspensionState; |
| 9 | 10 | import org.activiti.engine.repository.Deployment; |
| 10 | 11 | import org.activiti.engine.repository.ProcessDefinition; |
| 11 | 12 | import org.mapstruct.Mapper; |
| 13 | +import org.mapstruct.Mapping; | |
| 14 | +import org.mapstruct.Mappings; | |
| 15 | +import org.mapstruct.Named; | |
| 12 | 16 | import org.mapstruct.factory.Mappers; |
| 13 | 17 | |
| 14 | 18 | import java.util.List; |
| ... | ... | @@ -55,4 +59,17 @@ public interface BpmDefinitionConvert { |
| 55 | 59 | |
| 56 | 60 | BpmProcessDefinitionExtDO convert2(BpmDefinitionCreateReqDTO bean); |
| 57 | 61 | |
| 62 | + @Named("convertList3") | |
| 63 | + List<BpmProcessDefinitionRespVO> convertList3(List<ProcessDefinition> list); | |
| 64 | + | |
| 65 | + @Named("convert3") | |
| 66 | + @Mapping(source = "suspended", target = "suspensionState", qualifiedByName = "convertSuspendedToSuspensionState") | |
| 67 | + BpmProcessDefinitionRespVO convert3(ProcessDefinition bean); | |
| 68 | + | |
| 69 | + @Named("convertSuspendedToSuspensionState") | |
| 70 | + default Integer convertSuspendedToSuspensionState(boolean suspended) { | |
| 71 | + return suspended ? SuspensionState.SUSPENDED.getStateCode() : | |
| 72 | + SuspensionState.ACTIVE.getStateCode(); | |
| 73 | + } | |
| 74 | + | |
| 58 | 75 | } | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/BpmProcessDefinitionService.java
| 1 | 1 | package cn.iocoder.yudao.adminserver.modules.bpm.service.definition; |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionListReqVO; | |
| 3 | 4 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageItemRespVO; |
| 4 | 5 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageReqVO; |
| 6 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionRespVO; | |
| 5 | 7 | import cn.iocoder.yudao.adminserver.modules.bpm.service.definition.dto.BpmDefinitionCreateReqDTO; |
| 6 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | 9 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| ... | ... | @@ -31,6 +33,14 @@ public interface BpmProcessDefinitionService { |
| 31 | 33 | PageResult<BpmProcessDefinitionPageItemRespVO> getProcessDefinitionPage(BpmProcessDefinitionPageReqVO pageReqVO); |
| 32 | 34 | |
| 33 | 35 | /** |
| 36 | + * 获得流程定义列表 | |
| 37 | + * | |
| 38 | + * @param listReqVO 列表入参 | |
| 39 | + * @return 流程定义列表 | |
| 40 | + */ | |
| 41 | + List<BpmProcessDefinitionRespVO> getProcessDefinitionList(BpmProcessDefinitionListReqVO listReqVO); | |
| 42 | + | |
| 43 | + /** | |
| 34 | 44 | * 获得流程定义对应的 BPMN XML |
| 35 | 45 | * |
| 36 | 46 | * @param id 流程定义编号 | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmProcessDefinitionServiceImpl.java
| ... | ... | @@ -2,8 +2,10 @@ package cn.iocoder.yudao.adminserver.modules.bpm.service.definition.impl; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | 4 | import cn.hutool.core.util.StrUtil; |
| 5 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionListReqVO; | |
| 5 | 6 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageItemRespVO; |
| 6 | 7 | import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionPageReqVO; |
| 8 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.definition.vo.BpmProcessDefinitionRespVO; | |
| 7 | 9 | import cn.iocoder.yudao.adminserver.modules.bpm.convert.definition.BpmDefinitionConvert; |
| 8 | 10 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO; |
| 9 | 11 | import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmFormDO; |
| ... | ... | @@ -94,6 +96,19 @@ public class BpmProcessDefinitionServiceImpl implements BpmProcessDefinitionServ |
| 94 | 96 | } |
| 95 | 97 | |
| 96 | 98 | @Override |
| 99 | + public List<BpmProcessDefinitionRespVO> getProcessDefinitionList(BpmProcessDefinitionListReqVO listReqVO) { | |
| 100 | + // 拼接查询条件 | |
| 101 | + ProcessDefinitionQuery definitionQuery = repositoryService.createProcessDefinitionQuery(); | |
| 102 | + if (Objects.equals(SuspensionState.SUSPENDED.getStateCode(), listReqVO.getSuspensionState())) { | |
| 103 | + definitionQuery.suspended(); | |
| 104 | + } else if (Objects.equals(SuspensionState.ACTIVE.getStateCode(), listReqVO.getSuspensionState())) { | |
| 105 | + definitionQuery.active(); | |
| 106 | + } | |
| 107 | + // 执行查询,并返回 | |
| 108 | + return BpmDefinitionConvert.INSTANCE.convertList3(definitionQuery.list()); | |
| 109 | + } | |
| 110 | + | |
| 111 | + @Override | |
| 97 | 112 | public String getProcessDefinitionBpmnXML(String id) { |
| 98 | 113 | BpmnModel bpmnModel = repositoryService.getBpmnModel(id); |
| 99 | 114 | if (bpmnModel == null) { | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/BpmTaskService.java
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmProcessInstanceServiceImpl.java
| ... | ... | @@ -135,6 +135,7 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService |
| 135 | 135 | if (instance == null) { |
| 136 | 136 | throw exception(PROCESS_INSTANCE_CANCEL_FAIL_NOT_EXISTS); |
| 137 | 137 | } |
| 138 | + // TODO 芋艿:只能自己取消流程 | |
| 138 | 139 | |
| 139 | 140 | // 通过删除流程实例,实现流程实例的取消 |
| 140 | 141 | runtimeService.deleteProcessInstance(cancelReqVO.getId(), cancelReqVO.getReason()); | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/task/impl/BpmTaskServiceImpl.java
| ... | ... | @@ -45,6 +45,12 @@ import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstan |
| 45 | 45 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 46 | 46 | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; |
| 47 | 47 | |
| 48 | +/** | |
| 49 | + * 流程任务 Service 实现类 | |
| 50 | + * | |
| 51 | + * @author jason | |
| 52 | + * @author 芋道源码 | |
| 53 | + */ | |
| 48 | 54 | @Slf4j |
| 49 | 55 | @Service |
| 50 | 56 | public class BpmTaskServiceImpl implements BpmTaskService { | ... | ... |
yudao-admin-ui/src/router/index.js
| ... | ... | @@ -188,6 +188,18 @@ export const constantRoutes = [ |
| 188 | 188 | meta: { title: '流程定义' } |
| 189 | 189 | } |
| 190 | 190 | ] |
| 191 | + }, { | |
| 192 | + path: '/bpm', | |
| 193 | + component: Layout, | |
| 194 | + hidden: true, | |
| 195 | + children: [ | |
| 196 | + { | |
| 197 | + path: 'process-instance/create', | |
| 198 | + component: (resolve) => require(['@/views/bpm/processInstance/create'], resolve), | |
| 199 | + name: '发起流程', | |
| 200 | + meta: { title: '发起流程' } | |
| 201 | + } | |
| 202 | + ] | |
| 191 | 203 | }, |
| 192 | 204 | ] |
| 193 | 205 | ... | ... |
yudao-admin-ui/src/views/bpm/processInstance/create.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <!-- 列表 --> | |
| 4 | + <el-table v-loading="loading" :data="list"> | |
| 5 | + <el-table-column label="定义编号" align="center" prop="id" width="400" /> | |
| 6 | + <el-table-column label="定义名称" align="center" prop="name" width="100"> | |
| 7 | + <template slot-scope="scope"> | |
| 8 | + <el-button type="text" @click="handleBpmnDetail(scope.row)"> | |
| 9 | + <span>{{ scope.row.name }}</span> | |
| 10 | + </el-button> | |
| 11 | + </template> | |
| 12 | + </el-table-column> | |
| 13 | + <el-table-column label="定义分类" align="center" prop="category" width="100"> | |
| 14 | + <template slot-scope="scope"> | |
| 15 | + <span>{{ getDictDataLabel(DICT_TYPE.BPM_MODEL_CATEGORY, scope.row.category) }}</span> | |
| 16 | + </template> | |
| 17 | + </el-table-column> | |
| 18 | + <el-table-column label="表单信息" align="center" prop="formId"> | |
| 19 | + <template slot-scope="scope"> | |
| 20 | + <el-button v-if="scope.row.formId" type="text" @click="handleFormDetail(scope.row)"> | |
| 21 | + <span>{{ scope.row.formName }}</span> | |
| 22 | + </el-button> | |
| 23 | + <label v-else>暂无表单</label> | |
| 24 | + </template> | |
| 25 | + </el-table-column> | |
| 26 | + <el-table-column label="流程版本" align="center" prop="processDefinition.version" width="80"> | |
| 27 | + <template slot-scope="scope"> | |
| 28 | + <el-tag size="medium" v-if="scope.row">v{{ scope.row.version }}</el-tag> | |
| 29 | + <el-tag size="medium" type="warning" v-else>未部署</el-tag> | |
| 30 | + </template> | |
| 31 | + </el-table-column> | |
| 32 | + <el-table-column label="状态" align="center" prop="version" width="80"> | |
| 33 | + <template slot-scope="scope"> | |
| 34 | + <el-tag type="success" v-if="scope.row.suspensionState === 1">激活</el-tag> | |
| 35 | + <el-tag type="warning" v-if="scope.row.suspensionState === 2">挂起</el-tag> | |
| 36 | + </template> | |
| 37 | + </el-table-column> | |
| 38 | + <el-table-column label="部署时间" align="center" prop="deploymentTime" width="180"> | |
| 39 | + <template slot-scope="scope"> | |
| 40 | + <span>{{ parseTime(scope.row.deploymentTime) }}</span> | |
| 41 | + </template> | |
| 42 | + </el-table-column> | |
| 43 | + <el-table-column label="定义描述" align="center" prop="description" width="300" show-overflow-tooltip /> | |
| 44 | + </el-table> | |
| 45 | + | |
| 46 | + <!-- 流程表单配置详情 --> | |
| 47 | + <el-dialog title="表单详情" :visible.sync="detailOpen" width="50%" append-to-body> | |
| 48 | + <parser :key="new Date().getTime()" :form-conf="detailForm" /> | |
| 49 | + </el-dialog> | |
| 50 | + | |
| 51 | + <!-- 流程模型图的预览 --> | |
| 52 | + <el-dialog title="流程图" :visible.sync="showBpmnOpen" width="80%" append-to-body> | |
| 53 | + <my-process-viewer key="designer" v-model="bpmnXML" v-bind="bpmnControlForm" /> | |
| 54 | + </el-dialog> | |
| 55 | + | |
| 56 | + <!-- 分页组件 --> | |
| 57 | + <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | |
| 58 | + @pagination="getList"/> | |
| 59 | + </div> | |
| 60 | +</template> | |
| 61 | + | |
| 62 | +<script> | |
| 63 | +import {getProcessDefinitionBpmnXML, getProcessDefinitionPage} from "@/api/bpm/definition"; | |
| 64 | +import {DICT_TYPE, getDictDatas} from "@/utils/dict"; | |
| 65 | +import {getForm} from "@/api/bpm/form"; | |
| 66 | +import {decodeFields} from "@/utils/formGenerator"; | |
| 67 | +import Parser from '@/components/parser/Parser' | |
| 68 | + | |
| 69 | +export default { | |
| 70 | + name: "processDefinition", | |
| 71 | + components: { | |
| 72 | + Parser | |
| 73 | + }, | |
| 74 | + data() { | |
| 75 | + return { | |
| 76 | + // 遮罩层 | |
| 77 | + loading: true, | |
| 78 | + // 总条数 | |
| 79 | + total: 0, | |
| 80 | + // 表格数据 | |
| 81 | + list: [], | |
| 82 | + // 查询参数 | |
| 83 | + queryParams: { | |
| 84 | + pageNo: 1, | |
| 85 | + pageSize: 10 | |
| 86 | + }, | |
| 87 | + | |
| 88 | + // 流程表单详情 | |
| 89 | + detailOpen: false, | |
| 90 | + detailForm: { | |
| 91 | + fields: [] | |
| 92 | + }, | |
| 93 | + | |
| 94 | + // BPMN 数据 | |
| 95 | + showBpmnOpen: false, | |
| 96 | + bpmnXML: null, | |
| 97 | + bpmnControlForm: { | |
| 98 | + prefix: "activiti" | |
| 99 | + }, | |
| 100 | + | |
| 101 | + // 数据字典 | |
| 102 | + categoryDictDatas: getDictDatas(DICT_TYPE.BPM_MODEL_CATEGORY), | |
| 103 | + }; | |
| 104 | + }, | |
| 105 | + created() { | |
| 106 | + const key = this.$route.query && this.$route.query.key | |
| 107 | + if (key) { | |
| 108 | + this.queryParams['key'] = key | |
| 109 | + } | |
| 110 | + this.getList(); | |
| 111 | + }, | |
| 112 | + methods: { | |
| 113 | + /** 查询流程定义列表 */ | |
| 114 | + getList() { | |
| 115 | + this.loading = true; | |
| 116 | + getProcessDefinitionPage(this.queryParams).then(response => { | |
| 117 | + this.list = response.data.list; | |
| 118 | + this.total = response.data.total; | |
| 119 | + this.loading = false; | |
| 120 | + } | |
| 121 | + ); | |
| 122 | + }, | |
| 123 | + /** 流程表单的详情按钮操作 */ | |
| 124 | + handleFormDetail(row) { | |
| 125 | + getForm(row.formId).then(response => { | |
| 126 | + // 设置值 | |
| 127 | + const data = response.data | |
| 128 | + this.detailForm = { | |
| 129 | + ...JSON.parse(data.conf), | |
| 130 | + fields: decodeFields(data.fields) | |
| 131 | + } | |
| 132 | + // 弹窗打开 | |
| 133 | + this.detailOpen = true | |
| 134 | + }) | |
| 135 | + }, | |
| 136 | + /** 流程图的详情按钮操作 */ | |
| 137 | + handleBpmnDetail(row) { | |
| 138 | + getProcessDefinitionBpmnXML(row.id).then(response => { | |
| 139 | + this.bpmnXML = response.data | |
| 140 | + // 弹窗打开 | |
| 141 | + this.showBpmnOpen = true | |
| 142 | + }) | |
| 143 | + }, | |
| 144 | + } | |
| 145 | +}; | |
| 146 | +</script> | |
| 147 | + | |
| 148 | +<style lang="scss"> | |
| 149 | +.my-process-designer { | |
| 150 | + height: calc(100vh - 200px); | |
| 151 | +} | |
| 152 | +</style> | ... | ... |
yudao-admin-ui/src/views/bpm/processInstance/index.vue
| ... | ... | @@ -113,45 +113,6 @@ |
| 113 | 113 | <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" |
| 114 | 114 | @pagination="getList"/> |
| 115 | 115 | |
| 116 | - <!-- 对话框(添加 / 修改) --> | |
| 117 | - <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> | |
| 118 | - <el-form ref="form" :model="form" :rules="rules" label-width="80px"> | |
| 119 | - <el-form-item label="发起流程的用户编号" prop="userId"> | |
| 120 | - <el-input v-model="form.userId" placeholder="请输入发起流程的用户编号" /> | |
| 121 | - </el-form-item> | |
| 122 | - <el-form-item label="流程实例的名字" prop="name"> | |
| 123 | - <el-input v-model="form.name" placeholder="请输入流程实例的名字" /> | |
| 124 | - </el-form-item> | |
| 125 | - <el-form-item label="流程实例的编号" prop="processInstanceId"> | |
| 126 | - <el-input v-model="form.processInstanceId" placeholder="请输入流程实例的编号" /> | |
| 127 | - </el-form-item> | |
| 128 | - <el-form-item label="流程定义的编号" prop="processDefinitionId"> | |
| 129 | - <el-input v-model="form.processDefinitionId" placeholder="请输入流程定义的编号" /> | |
| 130 | - </el-form-item> | |
| 131 | - <el-form-item label="流程分类" prop="category"> | |
| 132 | - <el-select v-model="form.category" placeholder="请选择流程分类"> | |
| 133 | - <el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_MODEL_CATEGORY)" | |
| 134 | - :key="dict.value" :label="dict.label" :value="dict.value" /> | |
| 135 | - </el-select> | |
| 136 | - </el-form-item> | |
| 137 | - <el-form-item label="流程实例的名字" prop="status"> | |
| 138 | - <el-select v-model="form.status" placeholder="请选择流程实例的名字"> | |
| 139 | - <el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)" | |
| 140 | - :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" /> | |
| 141 | - </el-select> | |
| 142 | - </el-form-item> | |
| 143 | - <el-form-item label="流程实例的结果" prop="result"> | |
| 144 | - <el-select v-model="form.result" placeholder="请选择流程实例的结果"> | |
| 145 | - <el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)" | |
| 146 | - :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" /> | |
| 147 | - </el-select> | |
| 148 | - </el-form-item> | |
| 149 | - </el-form> | |
| 150 | - <div slot="footer" class="dialog-footer"> | |
| 151 | - <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 152 | - <el-button @click="cancel">取 消</el-button> | |
| 153 | - </div> | |
| 154 | - </el-dialog> | |
| 155 | 116 | </div> |
| 156 | 117 | </template> |
| 157 | 118 | |
| ... | ... | @@ -181,10 +142,7 @@ export default { |
| 181 | 142 | total: 0, |
| 182 | 143 | // 工作流的流程实例的拓展列表 |
| 183 | 144 | list: [], |
| 184 | - // 弹出层标题 | |
| 185 | - title: "", | |
| 186 | 145 | // 是否显示弹出层 |
| 187 | - open: false, | |
| 188 | 146 | dateRangeCreateTime: [], |
| 189 | 147 | // 查询参数 |
| 190 | 148 | queryParams: { |
| ... | ... | @@ -195,18 +153,6 @@ export default { |
| 195 | 153 | category: null, |
| 196 | 154 | status: null, |
| 197 | 155 | result: null, |
| 198 | - }, | |
| 199 | - // 表单参数 | |
| 200 | - form: {}, | |
| 201 | - // 表单校验 | |
| 202 | - rules: { | |
| 203 | - userId: [{ required: true, message: "发起流程的用户编号不能为空", trigger: "blur" }], | |
| 204 | - name: [{ required: true, message: "流程实例的名字不能为空", trigger: "blur" }], | |
| 205 | - processInstanceId: [{ required: true, message: "流程实例的编号不能为空", trigger: "blur" }], | |
| 206 | - processDefinitionId: [{ required: true, message: "流程定义的编号不能为空", trigger: "blur" }], | |
| 207 | - category: [{ required: true, message: "流程分类不能为空", trigger: "change" }], | |
| 208 | - status: [{ required: true, message: "流程实例的名字不能为空", trigger: "change" }], | |
| 209 | - result: [{ required: true, message: "流程实例的结果不能为空", trigger: "change" }], | |
| 210 | 156 | } |
| 211 | 157 | }; |
| 212 | 158 | }, |
| ... | ... | @@ -227,25 +173,6 @@ export default { |
| 227 | 173 | this.loading = false; |
| 228 | 174 | }); |
| 229 | 175 | }, |
| 230 | - /** 取消按钮 */ | |
| 231 | - cancel() { | |
| 232 | - this.open = false; | |
| 233 | - this.reset(); | |
| 234 | - }, | |
| 235 | - /** 表单重置 */ | |
| 236 | - reset() { | |
| 237 | - this.form = { | |
| 238 | - id: undefined, | |
| 239 | - userId: undefined, | |
| 240 | - name: undefined, | |
| 241 | - processInstanceId: undefined, | |
| 242 | - processDefinitionId: undefined, | |
| 243 | - category: undefined, | |
| 244 | - status: undefined, | |
| 245 | - result: undefined, | |
| 246 | - }; | |
| 247 | - this.resetForm("form"); | |
| 248 | - }, | |
| 249 | 176 | /** 搜索按钮操作 */ |
| 250 | 177 | handleQuery() { |
| 251 | 178 | this.queryParams.pageNo = 1; |
| ... | ... | @@ -257,34 +184,9 @@ export default { |
| 257 | 184 | this.resetForm("queryForm"); |
| 258 | 185 | this.handleQuery(); |
| 259 | 186 | }, |
| 260 | - /** 新增按钮操作 */ | |
| 187 | + /** 新增按钮操作 **/ | |
| 261 | 188 | handleAdd() { |
| 262 | - this.reset(); | |
| 263 | - this.open = true; | |
| 264 | - this.title = "添加工作流的流程实例的拓展"; | |
| 265 | - }, | |
| 266 | - /** 提交按钮 */ | |
| 267 | - submitForm() { | |
| 268 | - this.$refs["form"].validate(valid => { | |
| 269 | - if (!valid) { | |
| 270 | - return; | |
| 271 | - } | |
| 272 | - // 修改的提交 | |
| 273 | - if (this.form.id != null) { | |
| 274 | - updateProcessInstanceExt(this.form).then(response => { | |
| 275 | - this.msgSuccess("修改成功"); | |
| 276 | - this.open = false; | |
| 277 | - this.getList(); | |
| 278 | - }); | |
| 279 | - return; | |
| 280 | - } | |
| 281 | - // 添加的提交 | |
| 282 | - createProcessInstanceExt(this.form).then(response => { | |
| 283 | - this.msgSuccess("新增成功"); | |
| 284 | - this.open = false; | |
| 285 | - this.getList(); | |
| 286 | - }); | |
| 287 | - }); | |
| 189 | + this.$router.push({ path: "/bpm/process-instance/create"}) | |
| 288 | 190 | }, |
| 289 | 191 | /** 取消按钮操作 */ |
| 290 | 192 | handleCancel(row) { | ... | ... |