10
10
:inline =" true"
11
11
label-width =" 68px"
12
12
>
13
- <el-form-item label =" 流程名称 " prop =" name" >
13
+ <el-form-item label =" " prop =" name" >
14
14
<el-input
15
15
v-model =" queryParams.name"
16
16
placeholder =" 请输入流程名称"
19
19
class =" !w-240px"
20
20
/>
21
21
</el-form-item >
22
- <el-form-item label =" 所属流程" prop =" processDefinitionKey" >
23
- <el-input
24
- v-model =" queryParams.processDefinitionKey"
25
- placeholder =" 请输入流程定义的标识"
26
- clearable
27
- @keyup.enter =" handleQuery"
28
- class =" !w-240px"
29
- />
22
+
23
+ <el-form-item >
24
+ <el-button @click =" handleQuery" ><Icon icon =" ep:search" class =" mr-5px" /> 搜索</el-button >
30
25
</el-form-item >
31
- <el-form-item label =" 流程分类" prop =" category" >
26
+
27
+ <!-- TODO @ tuituji:style 可以使用 unocss -->
28
+ <el-form-item label =" " prop =" category" :style =" { position: 'absolute', right: '130px' }" >
29
+ <!-- TODO @tuituji:应该选择好分类,就触发搜索啦。 -->
32
30
<el-select
33
31
v-model =" queryParams.category"
34
32
placeholder =" 请选择流程分类"
35
33
clearable
36
- class =" !w-240px "
34
+ class =" !w-155px "
37
35
>
38
36
<el-option
39
37
v-for =" category in categoryList"
43
41
/>
44
42
</el-select >
45
43
</el-form-item >
46
- <el-form-item label =" 流程状态" prop =" status" >
47
- <el-select
48
- v-model =" queryParams.status"
49
- placeholder =" 请选择流程状态"
50
- clearable
51
- class =" !w-240px"
52
- >
53
- <el-option
54
- v-for =" dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
55
- :key =" dict.value"
56
- :label =" dict.label"
57
- :value =" dict.value"
58
- />
59
- </el-select >
60
- </el-form-item >
61
- <el-form-item label =" 发起时间" prop =" createTime" >
62
- <el-date-picker
63
- v-model =" queryParams.createTime"
64
- value-format =" YYYY-MM-DD HH:mm:ss"
65
- type =" daterange"
66
- start-placeholder =" 开始日期"
67
- end-placeholder =" 结束日期"
68
- :default-time =" [new Date('1 00:00:00'), new Date('1 23:59:59')]"
69
- class =" !w-240px"
70
- />
71
- </el-form-item >
72
- <el-form-item >
73
- <el-button @click =" handleQuery" ><Icon icon =" ep:search" class =" mr-5px" /> 搜索</el-button >
74
- <el-button @click =" resetQuery" ><Icon icon =" ep:refresh" class =" mr-5px" /> 重置</el-button >
75
- <el-button
76
- type =" primary"
77
- plain
78
- v-hasPermi =" ['bpm:process-instance:query']"
79
- @click =" handleCreate(undefined)"
80
- >
81
- <Icon icon =" ep:plus" class =" mr-5px" /> 发起流程
44
+
45
+ <!-- 高级筛选 -->
46
+ <!-- TODO @ tuituji:style 可以使用 unocss -->
47
+ <el-form-item :style =" { position: 'absolute', right: '0px' }" >
48
+ <el-button v-popover =" popoverRef" v-click-outside =" onClickOutside" :icon =" List" >
49
+ 高级筛选
82
50
</el-button >
51
+ <el-popover
52
+ ref =" popoverRef"
53
+ trigger =" click"
54
+ virtual-triggering
55
+ persistent
56
+ :width =" 400"
57
+ :show-arrow =" false"
58
+ placement =" bottom-end"
59
+ >
60
+ <el-form-item label =" 流程发起人" class =" bold-label" label-position =" top" prop =" category" >
61
+ <el-select
62
+ v-model =" queryParams.category"
63
+ placeholder =" 请选择流程发起人"
64
+ clearable
65
+ class =" !w-390px"
66
+ >
67
+ <el-option
68
+ v-for =" category in categoryList"
69
+ :key =" category.code"
70
+ :label =" category.name"
71
+ :value =" category.code"
72
+ />
73
+ </el-select >
74
+ </el-form-item >
75
+ <el-form-item
76
+ label =" 所属流程"
77
+ class =" bold-label"
78
+ label-position =" top"
79
+ prop =" processDefinitionKey"
80
+ >
81
+ <el-input
82
+ v-model =" queryParams.processDefinitionKey"
83
+ placeholder =" 请输入流程定义的标识"
84
+ clearable
85
+ @keyup.enter =" handleQuery"
86
+ class =" !w-390px"
87
+ />
88
+ </el-form-item >
89
+ <el-form-item label =" 流程状态" class =" bold-label" label-position =" top" prop =" status" >
90
+ <el-select
91
+ v-model =" queryParams.status"
92
+ placeholder =" 请选择流程状态"
93
+ clearable
94
+ class =" !w-390px"
95
+ >
96
+ <el-option
97
+ v-for =" dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
98
+ :key =" dict.value"
99
+ :label =" dict.label"
100
+ :value =" dict.value"
101
+ />
102
+ </el-select >
103
+ </el-form-item >
104
+ <el-form-item label =" 发起时间" class =" bold-label" label-position =" top" prop =" createTime" >
105
+ <el-date-picker
106
+ v-model =" queryParams.createTime"
107
+ value-format =" YYYY-MM-DD HH:mm:ss"
108
+ type =" daterange"
109
+ start-placeholder =" 开始日期"
110
+ end-placeholder =" 结束日期"
111
+ :default-time =" [new Date('1 00:00:00'), new Date('1 23:59:59')]"
112
+ class =" !w-240px"
113
+ />
114
+ </el-form-item >
115
+ </el-popover >
116
+ <!-- TODO @tuituji:这里应该有确认,和取消、清空搜索条件,三个按钮。 -->
83
117
</el-form-item >
84
118
</el-form >
85
119
</ContentWrap >
95
129
min-width =" 100"
96
130
fixed =" left"
97
131
/>
132
+ <!-- TODO @芋艿:摘要 -->
133
+ <!-- TODO @tuituji:流程状态。可见需求文档里 -->
98
134
<el-table-column label =" 流程状态" prop =" status" width =" 120" >
99
135
<template #default =" scope " >
100
136
<dict-tag :type =" DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value =" scope.row.status" />
114
150
width =" 180"
115
151
:formatter =" dateFormatter"
116
152
/>
117
- <el-table-column align =" center" label =" 耗时" prop =" durationInMillis" width =" 160" >
153
+ <!-- < el-table-column align="center" label="耗时" prop="durationInMillis" width="160">
118
154
<template #default="scope">
119
155
{{ scope.row.durationInMillis > 0 ? formatPast2(scope.row.durationInMillis) : '-' }}
120
156
</template>
126
162
</el-button>
127
163
</template>
128
164
</el-table-column>
129
- < el-table-column label = " 流程编号 " align = " center " prop = " id " min-width = " 320px " / >
165
+ -- >
130
166
<el-table-column label =" 操作" align =" center" fixed =" right" width =" 180" >
131
167
<template #default =" scope " >
132
168
<el-button
162
198
</ContentWrap >
163
199
</template >
164
200
<script lang="ts" setup>
201
+ // TODO @tuituji:List 改成 <Icon icon="ep:plus" class="mr-5px" /> 类似这种组件哈。
202
+ import { List } from ' @element-plus/icons-vue'
165
203
import { DICT_TYPE , getIntDictOptions } from ' @/utils/dict'
166
- import { dateFormatter , formatPast2 } from ' @/utils/formatTime'
204
+ import { dateFormatter } from ' @/utils/formatTime'
167
205
import { ElMessageBox } from ' element-plus'
168
206
import * as ProcessInstanceApi from ' @/api/bpm/processInstance'
169
- import { CategoryApi } from ' @/api/bpm/category'
207
+ import { CategoryApi , CategoryVO } from ' @/api/bpm/category'
170
208
import { ProcessInstanceVO } from ' @/api/bpm/processInstance'
171
209
import * as DefinitionApi from ' @/api/bpm/definition'
172
210
@@ -189,7 +227,7 @@ const queryParams = reactive({
189
227
createTime: []
190
228
})
191
229
const queryFormRef = ref () // 搜索的表单
192
- const categoryList = ref ([]) // 流程分类列表
230
+ const categoryList = ref < CategoryVO []> ([]) // 流程分类列表
193
231
194
232
/** 查询列表 */
195
233
const getList = async () => {
@@ -260,6 +298,15 @@ const handleCancel = async (row) => {
260
298
await getList ()
261
299
}
262
300
301
+ // TODO @tuituji:这个 import 是不是没用哈?
302
+ import { ClickOutside as vClickOutside } from ' element-plus'
303
+
304
+ // TODO @tuituji:onClickAdvancedSearch。方法名叫这个,会更好一些哇?打开高级搜索。
305
+ const popoverRef = ref ()
306
+ const onClickOutside = () => {
307
+ unref (popoverRef ).popperRef ?.delayHide ?.()
308
+ }
309
+
263
310
/** 激活时 **/
264
311
onActivated (() => {
265
312
getList ()
@@ -271,3 +318,8 @@ onMounted(async () => {
271
318
categoryList .value = await CategoryApi .getCategorySimpleList ()
272
319
})
273
320
</script >
321
+ <style >
322
+ .bold-label .el-form-item__label {
323
+ font-weight : bold ; /* 将字体加粗 */
324
+ }
325
+ </style >
0 commit comments