Commit 430f1369be207d9988d8d44c56d9c8ed7f423dba

Authored by YunaiV
1 parent d8bbc715

完善 BPM Model 的搜索功能

yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/model/vo/ModelPageReqVO.java
... ... @@ -14,7 +14,13 @@ import lombok.ToString;
14 14 @ToString(callSuper = true)
15 15 public class ModelPageReqVO extends PageParam {
16 16  
17   - @ApiModelProperty(value = "名字", example = "芋道")
  17 + @ApiModelProperty(value = "标识", example = "process1641042089407", notes = "精准匹配")
  18 + private String key;
  19 +
  20 + @ApiModelProperty(value = "名字", example = "芋道", notes = "模糊匹配")
18 21 private String name;
19 22  
  23 + @ApiModelProperty(value = "流程分类", notes = "参见 bpm_model_category 数据字典", example = "1")
  24 + private String category;
  25 +
20 26 }
... ...
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/model/impl/BpmModelServiceImpl.java
... ... @@ -55,9 +55,15 @@ public class BpmModelServiceImpl implements BpmModelService {
55 55 @Override
56 56 public PageResult<BpmModelPageItemRespVO> getModelPage(ModelPageReqVO pageVO) {
57 57 ModelQuery modelQuery = repositoryService.createModelQuery();
  58 + if (StrUtil.isNotBlank(pageVO.getKey())) {
  59 + modelQuery.modelKey(pageVO.getKey());
  60 + }
58 61 if (StrUtil.isNotBlank(pageVO.getName())) {
59 62 modelQuery.modelNameLike("%" + pageVO.getName() + "%"); // 模糊匹配
60 63 }
  64 + if (StrUtil.isNotBlank(pageVO.getCategory())) {
  65 + modelQuery.modelCategory(pageVO.getCategory());
  66 + }
61 67 // 执行查询
62 68 List<Model> models = modelQuery.orderByCreateTime().desc()
63 69 .listPage(PageUtils.getStart(pageVO), pageVO.getPageSize());
... ...
yudao-admin-ui/src/utils/dict.js
... ... @@ -8,6 +8,7 @@ import store from &#39;@/store&#39;
8 8 export const DICT_TYPE = {
9 9 USER_TYPE: 'user_type',
10 10  
  11 + // system
11 12 SYS_COMMON_STATUS: 'sys_common_status',
12 13 SYS_MENU_TYPE: 'sys_menu_type',
13 14 SYS_ROLE_TYPE: 'sys_role_type',
... ... @@ -24,13 +25,17 @@ export const DICT_TYPE = {
24 25 SYS_SMS_RECEIVE_STATUS: 'sys_sms_receive_status',
25 26 SYS_ERROR_CODE_TYPE: 'sys_error_code_type',
26 27  
  28 + // infra
27 29 INF_REDIS_TIMEOUT_TYPE: 'inf_redis_timeout_type',
28 30 INF_JOB_STATUS: 'inf_job_status',
29 31 INF_JOB_LOG_STATUS: 'inf_job_log_status',
30 32 INF_API_ERROR_LOG_PROCESS_STATUS: 'inf_api_error_log_process_status',
31 33  
  34 + // tool
32 35 TOOL_CODEGEN_TEMPLATE_TYPE: 'tool_codegen_template_type',
33 36  
  37 + // bpm
  38 + BPM_MODEL_CATEGORY: 'bpm_model_category',
34 39 OA_LEAVE_STATUS: 'flow_status',
35 40 OA_LEAVE_TYPE: 'oa_leave_type'
36 41 }
... ...
yudao-admin-ui/src/views/bpm/model/index.vue
... ... @@ -3,10 +3,19 @@
3 3  
4 4 <!-- 搜索工作栏 -->
5 5 <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
6   - <el-form-item label="模型名字" prop="name">
7   - <el-input v-model="queryParams.name" placeholder="请输入模型名字" clearable style="width: 240px;" size="small"
  6 + <el-form-item label="流程标识" prop="key">
  7 + <el-input v-model="queryParams.key" placeholder="请输入流程标识" clearable style="width: 240px;" size="small"
8 8 @keyup.enter.native="handleQuery"/>
9 9 </el-form-item>
  10 + <el-form-item label="流程名称" prop="name">
  11 + <el-input v-model="queryParams.name" placeholder="请输入流程名称" clearable style="width: 240px;" size="small"
  12 + @keyup.enter.native="handleQuery"/>
  13 + </el-form-item>
  14 + <el-form-item label="流程分类" prop="category">
  15 + <el-select v-model="queryParams.category" placeholder="流程分类" clearable size="small" style="width: 240px">
  16 + <el-option v-for="dict in categoryDictDatas" :key="parseInt(dict.value)" :label="dict.label" :value="parseInt(dict.value)"/>
  17 + </el-select>
  18 + </el-form-item>
10 19 <el-form-item>
11 20 <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
12 21 <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
... ... @@ -24,10 +33,13 @@
24 33  
25 34 <!-- 列表 -->
26 35 <el-table v-loading="loading" :data="list">
27   - <el-table-column label="流程编号" align="center" prop="id" :show-overflow-tooltip="true" />
28 36 <el-table-column label="流程标识" align="center" prop="key" />
29 37 <el-table-column label="流程名称" align="center" prop="name" />
30   - <el-table-column label="流程分类" align="center" prop="category" /> <!-- TODO 芋艿:数据字典的格式化 -->
  38 + <el-table-column label="流程分类" align="center" prop="category">
  39 + <template slot-scope="scope">
  40 + <span>{{ getDictDataLabel(DICT_TYPE.BPM_MODEL_CATEGORY, scope.row.category) }}</span>
  41 + </template>
  42 + </el-table-column>
31 43 <el-table-column label="表单信息" align="center" prop="formId" /> <!-- TODO 芋艿:需要支持表单的点击 -->
32 44 <el-table-column label="流程版本" align="center" prop="processDefinition.version" />
33 45 <el-table-column label="创建时间" align="center" prop="createTime" width="180">
... ... @@ -59,6 +71,7 @@
59 71 <script>
60 72 import {deleteModel, deployModel, createModel, updateModel, getModelPage, getModel} from "@/api/bpm/model";
61 73 import VueBpmn from "@/components/bpmn/VueBpmn";
  74 +import {DICT_TYPE, getDictDatas} from "@/utils/dict";
62 75  
63 76 export default {
64 77 name: "model",
... ... @@ -77,10 +90,14 @@ export default {
77 90 pageNo: 1,
78 91 pageSize: 10
79 92 },
  93 +
80 94 // BPMN 数据
81 95 showBpmnOpen: false,
82 96 bpmnXML: null,
83 97 bpmnData: {},
  98 +
  99 + // 数据字典
  100 + categoryDictDatas: getDictDatas(DICT_TYPE.BPM_MODEL_CATEGORY),
84 101 };
85 102 },
86 103 components: {VueBpmn},
... ...