24
24
<el-button @click =" handleQuery" ><Icon icon =" ep:search" class =" mr-5px" /> 搜索</el-button >
25
25
</el-form-item >
26
26
27
- <!-- TODO @ tuituji:style 可以使用 unocss -->
28
- <el-form-item label =" " prop =" category" :style =" { position: 'absolute', right: '300px' }" >
29
- <!-- TODO @tuituji:应该选择好分类,就触发搜索啦。 RE:done & to check-->
27
+ <el-form-item label =" " prop =" category" class =" absolute right-[300px]" >
30
28
<el-select
31
29
v-model =" queryParams.category"
32
30
placeholder =" 请选择流程分类"
43
41
</el-select >
44
42
</el-form-item >
45
43
46
- <el-form-item label =" " prop =" status" :style = " { position: ' absolute', right: ' 130px' } " >
44
+ <el-form-item label =" " prop =" status" class = " absolute right-[ 130px] " >
47
45
<el-select
48
46
v-model =" queryParams.status"
49
47
placeholder =" 请选择流程状态"
61
59
</el-form-item >
62
60
63
61
<!-- 高级筛选 -->
64
- <!-- TODO @ tuituji:style 可以使用 unocss -->
65
- <el-form-item :style =" { position: 'absolute', right: '0px' }" >
62
+ <el-form-item class =" absolute right-0" >
66
63
<el-popover
67
64
:visible =" showPopover"
68
65
persistent
75
72
<Icon icon =" ep:plus" class =" mr-5px" />高级筛选
76
73
</el-button >
77
74
</template >
78
- <!-- <el-form-item label="流程发起人" class="bold-label" label-position="top" prop="category">
79
- <el-select
80
- v-model="queryParams.category"
81
- placeholder="请选择流程发起人"
82
- clearable
83
- class="!w-390px"
84
- >
85
- <el-option
86
- v-for="category in categoryList"
87
- :key="category.code"
88
- :label="category.name"
89
- :value="category.code"
90
- />
91
- </el-select>
92
- </el-form-item> -->
93
75
<el-form-item
94
76
label =" 所属流程"
95
- class =" bold-label "
77
+ class =" font-bold "
96
78
label-position =" top"
97
79
prop =" processDefinitionKey"
98
80
>
104
86
class =" !w-390px"
105
87
/>
106
88
</el-form-item >
107
- <el-form-item label =" 发起时间" class =" bold-label " label-position =" top" prop =" createTime" >
89
+ <el-form-item label =" 发起时间" class =" font-bold " label-position =" top" prop =" createTime" >
108
90
<el-date-picker
109
91
v-model =" queryParams.createTime"
110
92
value-format =" YYYY-MM-DD HH:mm:ss"
115
97
class =" !w-240px"
116
98
/>
117
99
</el-form-item >
118
- <!-- TODO tuituiji:参考钉钉,1)按照清空、取消、确认排序。2)右对齐。3)确认增加 primary -->
119
- <el-form-item class =" bold-label" label-position =" top" >
120
- <el-button @click =" handleQuery" > 确认</el-button >
121
- <el-button @click =" showPopover = false" > 取消</el-button >
122
- <el-button @click =" resetQuery" > 清空</el-button >
100
+ <el-form-item class =" font-bold" label-position =" top" >
101
+ <div class =" flex justify-end w-full" >
102
+ <el-button @click =" resetQuery" >清空</el-button >
103
+ <el-button @click =" showPopover = false" >取消</el-button >
104
+ <el-button type =" primary" @click =" handleQuery" >确认</el-button >
105
+ </div >
123
106
</el-form-item >
124
107
</el-popover >
125
108
</el-form-item >
146
129
min-width =" 100"
147
130
fixed =" left"
148
131
/>
149
- <!-- TODO @芋艿:摘要 -->
150
- <!-- TODO tuituiji:参考钉钉;1)审批中时,展示审批任务;2)非审批中,展示状态 -->
151
- <el-table-column label =" 流程状态" prop =" status" width =" 120" >
132
+ <el-table-column label =" 流程状态" prop =" status" min-width =" 200" >
152
133
<template #default =" scope " >
153
- <dict-tag :type =" DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value =" scope.row.status" />
134
+ <!-- 审批中状态 -->
135
+ <template
136
+ v-if ="
137
+ scope .row .status === BpmProcessInstanceStatus .RUNNING && scope .row .tasks ?.length > 0
138
+ "
139
+ >
140
+ <!-- 单人审批 -->
141
+ <template v-if =" scope .row .tasks .length === 1 " >
142
+ <span >
143
+ <el-button link type =" primary" @click =" handleDetail(scope.row)" >
144
+ {{ scope.row.tasks[0].assigneeUser?.nickname }}
145
+ </el-button >
146
+ ({{ scope.row.tasks[0].name }}) 审批中
147
+ </span >
148
+ </template >
149
+ <!-- 多人审批 -->
150
+ <template v-else >
151
+ <span >
152
+ <el-button link type =" primary" @click =" handleDetail(scope.row)" >
153
+ {{ scope.row.tasks[0].assigneeUser?.nickname }}
154
+ </el-button >
155
+ 等 {{ scope.row.tasks.length }} 人 ({{ scope.row.tasks[0].name }})审批中
156
+ </span >
157
+ </template >
158
+ </template >
159
+ <!-- 非审批中状态 -->
160
+ <template v-else >
161
+ <dict-tag :type =" DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value =" scope.row.status" />
162
+ </template >
154
163
</template >
155
164
</el-table-column >
156
165
<el-table-column
167
176
width =" 180"
168
177
:formatter =" dateFormatter"
169
178
/>
170
- <!-- <el-table-column align="center" label="耗时" prop="durationInMillis" width="160">
171
- <template #default="scope">
172
- {{ scope.row.durationInMillis > 0 ? formatPast2(scope.row.durationInMillis) : '-' }}
173
- </template>
174
- </el-table-column>
175
- <el-table-column label="当前审批任务" align="center" prop="tasks" min-width="120px">
176
- <template #default="scope">
177
- <el-button type="primary" v-for="task in scope.row.tasks" :key="task.id" link>
178
- <span>{{ task.name }}</span>
179
- </el-button>
180
- </template>
181
- </el-table-column>
182
- -->
183
179
<el-table-column label =" 操作" align =" center" fixed =" right" width =" 180" >
184
180
<template #default =" scope " >
185
181
<el-button
215
211
</ContentWrap >
216
212
</template >
217
213
<script lang="ts" setup>
218
- // TODO @tuituji:List 改成 <Icon icon="ep:plus" class="mr-5px" /> 类似这种组件哈。 RE:done & to check
219
214
import { DICT_TYPE , getIntDictOptions } from ' @/utils/dict'
220
215
import { dateFormatter } from ' @/utils/formatTime'
221
216
import { ElMessageBox } from ' element-plus'
222
217
import * as ProcessInstanceApi from ' @/api/bpm/processInstance'
223
218
import { CategoryApi , CategoryVO } from ' @/api/bpm/category'
224
219
import { ProcessInstanceVO } from ' @/api/bpm/processInstance'
225
220
import * as DefinitionApi from ' @/api/bpm/definition'
221
+ import { BpmProcessInstanceStatus } from ' @/utils/constants'
226
222
227
223
defineOptions ({ name: ' BpmProcessInstanceMy' })
228
224
@@ -244,6 +240,7 @@ const queryParams = reactive({
244
240
})
245
241
const queryFormRef = ref () // 搜索的表单
246
242
const categoryList = ref <CategoryVO []>([]) // 流程分类列表
243
+ const showPopover = ref (false ) // 高级筛选是否展示
247
244
248
245
/** 查询列表 */
249
246
const getList = async () => {
@@ -257,8 +254,6 @@ const getList = async () => {
257
254
}
258
255
}
259
256
260
- const showPopover = ref (false )
261
-
262
257
/** 搜索按钮操作 */
263
258
const handleQuery = () => {
264
259
queryParams .pageNo = 1
@@ -327,8 +322,3 @@ onMounted(async () => {
327
322
categoryList .value = await CategoryApi .getCategorySimpleList ()
328
323
})
329
324
</script >
330
- <style >
331
- .bold-label .el-form-item__label {
332
- font-weight : bold ; /* 将字体加粗 */
333
- }
334
- </style >
0 commit comments