19
19
class =" !w-240px"
20
20
/>
21
21
</el-form-item >
22
-
22
+
23
23
<el-form-item >
24
24
<el-button @click =" handleQuery" ><Icon icon =" ep:search" class =" mr-5px" /> 搜索</el-button >
25
- <el-button @click =" resetQuery" ><Icon icon =" ep:refresh" class =" mr-5px" /> 重置</el-button >
26
- <el-button
27
- type =" primary"
28
- plain
29
- v-hasPermi =" ['bpm:process-instance:query']"
30
- @click =" handleCreate(undefined)"
31
- >
32
- <Icon icon =" ep:plus" class =" mr-5px" /> 发起流程
33
- </el-button >
34
25
</el-form-item >
35
26
27
+ <!-- TODO @ tuituji:style 可以使用 unocss -->
36
28
<el-form-item label =" " prop =" category" :style =" { position: 'absolute', right: '130px' }" >
37
- <el-select
38
- v-model =" queryParams.category"
39
- placeholder =" 请选择流程分类"
40
- clearable
41
- class =" !w-240px"
42
- >
43
- <el-option
44
- v-for =" category in categoryList"
45
- :key =" category.code"
46
- :label =" category.name"
47
- :value =" category.code"
48
- />
49
- </el-select >
29
+ <!-- TODO @tuituji:应该选择好分类,就触发搜索啦。 RE:done & to check-->
30
+ <el-select
31
+ v-model =" queryParams.category"
32
+ placeholder =" 请选择流程分类"
33
+ clearable
34
+ class =" !w-155px"
35
+ @change =" handleQuery"
36
+ >
37
+ <el-option
38
+ v-for =" category in categoryList"
39
+ :key =" category.code"
40
+ :label =" category.name"
41
+ :value =" category.code"
42
+ />
43
+ </el-select >
50
44
</el-form-item >
51
45
46
+ <!-- 高级筛选 -->
47
+ <!-- TODO @ tuituji:style 可以使用 unocss -->
52
48
<el-form-item :style =" { position: 'absolute', right: '0px' }" >
53
- <el-button v-popover =" popoverRef" v-click-outside =" onClickOutside" :icon =" List" >
54
- 高级筛选
55
- </el-button >
56
-
57
- <el-popover
58
- ref =" popoverRef"
59
- trigger =" click"
60
- virtual-triggering
61
- persistent
62
- :width =" 400"
63
- :show-arrow =" false"
64
- placement =" bottom-end"
65
- >
66
- <el-form-item label =" 流程发起人" class =" bold-label" label-position =" top" prop =" category" >
67
- <el-select
68
- v-model =" queryParams.category"
69
- placeholder =" 请选择流程发起人"
70
- clearable
71
- class =" !w-390px"
49
+ <el-popover
50
+ :visible =" showPopover"
51
+ persistent
52
+ :width =" 400"
53
+ :show-arrow =" false"
54
+ placement =" bottom-end"
55
+ >
56
+ <template #reference >
57
+ <el-button @click =" showPopover = !showPopover" >
58
+ <Icon icon =" ep:plus" class =" mr-5px" />高级筛选
59
+ </el-button >
60
+
61
+ </template >
62
+ <el-form-item label =" 流程发起人" class =" bold-label" label-position =" top" prop =" category" >
63
+ <el-select
64
+ v-model =" queryParams.category"
65
+ placeholder =" 请选择流程发起人"
66
+ clearable
67
+ class =" !w-390px"
68
+ >
69
+ <el-option
70
+ v-for =" category in categoryList"
71
+ :key =" category.code"
72
+ :label =" category.name"
73
+ :value =" category.code"
74
+ />
75
+ </el-select >
76
+ </el-form-item >
77
+ <el-form-item
78
+ label =" 所属流程"
79
+ class =" bold-label"
80
+ label-position =" top"
81
+ prop =" processDefinitionKey"
72
82
>
73
- <el-option
74
- v-for =" category in categoryList"
75
- :key =" category.code"
76
- :label =" category.name"
77
- :value =" category.code"
83
+ <el-input
84
+ v-model =" queryParams.processDefinitionKey"
85
+ placeholder =" 请输入流程定义的标识"
86
+ clearable
87
+ @keyup.enter =" handleQuery"
88
+ class =" !w-390px"
78
89
/>
79
- </el-select >
80
- </el-form-item >
81
- <el-form-item label =" 所属流程" class =" bold-label" label-position =" top" prop =" processDefinitionKey" >
82
- <el-input
83
- v-model =" queryParams.processDefinitionKey"
84
- placeholder =" 请输入流程定义的标识"
85
- clearable
86
- @keyup.enter =" handleQuery"
87
- class =" !w-390px"
88
- />
89
- </el-form-item >
90
-
91
- <el-form-item label =" 流程状态" class =" bold-label" label-position =" top" prop =" status" >
92
- <el-select
93
- v-model =" queryParams.status"
94
- placeholder =" 请选择流程状态"
95
- clearable
96
- class =" !w-390px"
97
- >
98
- <el-option
99
- v-for =" dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
100
- :key =" dict.value"
101
- :label =" dict.label"
102
- :value =" dict.value"
90
+ </el-form-item >
91
+ <el-form-item label =" 流程状态" class =" bold-label" label-position =" top" prop =" status" >
92
+ <el-select
93
+ v-model =" queryParams.status"
94
+ placeholder =" 请选择流程状态"
95
+ clearable
96
+ class =" !w-390px"
97
+ >
98
+ <el-option
99
+ v-for =" dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
100
+ :key =" dict.value"
101
+ :label =" dict.label"
102
+ :value =" dict.value"
103
+ />
104
+ </el-select >
105
+ </el-form-item >
106
+ <el-form-item label =" 发起时间" class =" bold-label" label-position =" top" prop =" createTime" >
107
+ <el-date-picker
108
+ v-model =" queryParams.createTime"
109
+ value-format =" YYYY-MM-DD HH:mm:ss"
110
+ type =" daterange"
111
+ start-placeholder =" 开始日期"
112
+ end-placeholder =" 结束日期"
113
+ :default-time =" [new Date('1 00:00:00'), new Date('1 23:59:59')]"
114
+ class =" !w-240px"
103
115
/>
104
- </el-select >
116
+ </el-form-item >
117
+ <el-form-item class =" bold-label" label-position =" top" >
118
+ <el-button @click =" handleQuery" > 确认</el-button >
119
+ <el-button @click =" showPopover = false" > 取消</el-button >
120
+ <el-button @click =" resetQuery" > 清空</el-button >
105
121
</el-form-item >
106
- <el-form-item label =" 发起时间" class =" bold-label" label-position =" top" prop =" createTime" >
107
- <el-date-picker
108
- v-model =" queryParams.createTime"
109
- value-format =" YYYY-MM-DD HH:mm:ss"
110
- type =" daterange"
111
- start-placeholder =" 开始日期"
112
- end-placeholder =" 结束日期"
113
- :default-time =" [new Date('1 00:00:00'), new Date('1 23:59:59')]"
114
- class =" !w-240px"
115
- />
116
- </el-form-item >
117
- </el-popover >
122
+ </el-popover >
123
+ <!-- TODO @tuituji:这里应该有确认,和取消、清空搜索条件,三个按钮。 RE:done & to check-->
118
124
</el-form-item >
119
-
120
125
</el-form >
121
126
</ContentWrap >
122
127
131
136
min-width =" 100"
132
137
fixed =" left"
133
138
/>
139
+ <!-- TODO @芋艿:摘要 -->
140
+ <!-- TODO @tuituji:流程状态。可见需求文档里 Re:没看懂-->
134
141
<el-table-column label =" 流程状态" prop =" status" width =" 120" >
135
142
<template #default =" scope " >
136
143
<dict-tag :type =" DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value =" scope.row.status" />
162
169
</el-button>
163
170
</template>
164
171
</el-table-column>
165
- <el-table-column label="流程编号" align="center" prop="id" min-width="320px" /> -->
172
+ -->
166
173
<el-table-column label =" 操作" align =" center" fixed =" right" width =" 180" >
167
174
<template #default =" scope " >
168
175
<el-button
198
205
</ContentWrap >
199
206
</template >
200
207
<script lang="ts" setup>
201
- import { Delete , Edit , Search , Share , Upload , List } from ' @element-plus/icons-vue '
208
+ // TODO @tuituji:List 改成 <Icon icon="ep:plus" class="mr-5px" /> 类似这种组件哈。 RE:done & to check
202
209
import { DICT_TYPE , getIntDictOptions } from ' @/utils/dict'
203
- import { dateFormatter , formatPast2 } from ' @/utils/formatTime'
210
+ import { dateFormatter } from ' @/utils/formatTime'
204
211
import { ElMessageBox } from ' element-plus'
205
212
import * as ProcessInstanceApi from ' @/api/bpm/processInstance'
206
- import { CategoryApi } from ' @/api/bpm/category'
213
+ import { CategoryApi , CategoryVO } from ' @/api/bpm/category'
207
214
import { ProcessInstanceVO } from ' @/api/bpm/processInstance'
208
215
import * as DefinitionApi from ' @/api/bpm/definition'
209
216
@@ -226,7 +233,7 @@ const queryParams = reactive({
226
233
createTime: []
227
234
})
228
235
const queryFormRef = ref () // 搜索的表单
229
- const categoryList = ref ([]) // 流程分类列表
236
+ const categoryList = ref < CategoryVO []> ([]) // 流程分类列表
230
237
231
238
/** 查询列表 */
232
239
const getList = async () => {
@@ -240,6 +247,8 @@ const getList = async () => {
240
247
}
241
248
}
242
249
250
+ const showPopover = ref (false )
251
+
243
252
/** 搜索按钮操作 */
244
253
const handleQuery = () => {
245
254
queryParams .pageNo = 1
@@ -297,6 +306,15 @@ const handleCancel = async (row) => {
297
306
await getList ()
298
307
}
299
308
309
+ // TODO @tuituji:这个 import 是不是没用哈?
310
+ // import { ClickOutside as vClickOutside } from 'element-plus'
311
+
312
+ // TODO @tuituji:onClickAdvancedSearch。方法名叫这个,会更好一些哇?打开高级搜索。
313
+ const popoverRef = ref ()
314
+ const onClickOutside = () => {
315
+ unref (popoverRef ).popperRef ?.delayHide ?.()
316
+ }
317
+
300
318
/** 激活时 **/
301
319
onActivated (() => {
302
320
getList ()
@@ -307,17 +325,9 @@ onMounted(async () => {
307
325
await getList ()
308
326
categoryList .value = await CategoryApi .getCategorySimpleList ()
309
327
})
310
-
311
- import { ref , unref } from ' vue'
312
- import { ClickOutside as vClickOutside } from ' element-plus'
313
-
314
- const popoverRef = ref ()
315
- const onClickOutside = () => {
316
- unref (popoverRef ).popperRef ?.delayHide ?.()
317
- }
318
328
</script >
319
329
<style >
320
330
.bold-label .el-form-item__label {
321
331
font-weight : bold ; /* 将字体加粗 */
322
332
}
323
- </style >
333
+ </style >
0 commit comments