Skip to content

Commit 8f32dce

Browse files
committed
Merge branch 'feature/bpm' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into feature/bpm
2 parents 81d2a38 + 4ba5dad commit 8f32dce

File tree

1 file changed

+104
-52
lines changed

1 file changed

+104
-52
lines changed

src/views/bpm/processInstance/index.vue

Lines changed: 104 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
:inline="true"
1111
label-width="68px"
1212
>
13-
<el-form-item label="流程名称" prop="name">
13+
<el-form-item label="" prop="name">
1414
<el-input
1515
v-model="queryParams.name"
1616
placeholder="请输入流程名称"
@@ -19,21 +19,19 @@
1919
class="!w-240px"
2020
/>
2121
</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>
3025
</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:应该选择好分类,就触发搜索啦。 -->
3230
<el-select
3331
v-model="queryParams.category"
3432
placeholder="请选择流程分类"
3533
clearable
36-
class="!w-240px"
34+
class="!w-155px"
3735
>
3836
<el-option
3937
v-for="category in categoryList"
@@ -43,43 +41,79 @@
4341
/>
4442
</el-select>
4543
</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+
高级筛选
8250
</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:这里应该有确认,和取消、清空搜索条件,三个按钮。 -->
83117
</el-form-item>
84118
</el-form>
85119
</ContentWrap>
@@ -95,6 +129,8 @@
95129
min-width="100"
96130
fixed="left"
97131
/>
132+
<!-- TODO @芋艿:摘要 -->
133+
<!-- TODO @tuituji:流程状态。可见需求文档里 -->
98134
<el-table-column label="流程状态" prop="status" width="120">
99135
<template #default="scope">
100136
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" />
@@ -114,7 +150,7 @@
114150
width="180"
115151
:formatter="dateFormatter"
116152
/>
117-
<el-table-column align="center" label="耗时" prop="durationInMillis" width="160">
153+
<!--<el-table-column align="center" label="耗时" prop="durationInMillis" width="160">
118154
<template #default="scope">
119155
{{ scope.row.durationInMillis > 0 ? formatPast2(scope.row.durationInMillis) : '-' }}
120156
</template>
@@ -126,7 +162,7 @@
126162
</el-button>
127163
</template>
128164
</el-table-column>
129-
<el-table-column label="流程编号" align="center" prop="id" min-width="320px" />
165+
-->
130166
<el-table-column label="操作" align="center" fixed="right" width="180">
131167
<template #default="scope">
132168
<el-button
@@ -162,11 +198,13 @@
162198
</ContentWrap>
163199
</template>
164200
<script lang="ts" setup>
201+
// TODO @tuituji:List 改成 <Icon icon="ep:plus" class="mr-5px" /> 类似这种组件哈。
202+
import { List } from '@element-plus/icons-vue'
165203
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
166-
import { dateFormatter, formatPast2 } from '@/utils/formatTime'
204+
import { dateFormatter } from '@/utils/formatTime'
167205
import { ElMessageBox } from 'element-plus'
168206
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
169-
import { CategoryApi } from '@/api/bpm/category'
207+
import { CategoryApi, CategoryVO } from '@/api/bpm/category'
170208
import { ProcessInstanceVO } from '@/api/bpm/processInstance'
171209
import * as DefinitionApi from '@/api/bpm/definition'
172210
@@ -189,7 +227,7 @@ const queryParams = reactive({
189227
createTime: []
190228
})
191229
const queryFormRef = ref() // 搜索的表单
192-
const categoryList = ref([]) // 流程分类列表
230+
const categoryList = ref<CategoryVO[]>([]) // 流程分类列表
193231
194232
/** 查询列表 */
195233
const getList = async () => {
@@ -260,6 +298,15 @@ const handleCancel = async (row) => {
260298
await getList()
261299
}
262300
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+
263310
/** 激活时 **/
264311
onActivated(() => {
265312
getList()
@@ -271,3 +318,8 @@ onMounted(async () => {
271318
categoryList.value = await CategoryApi.getCategorySimpleList()
272319
})
273320
</script>
321+
<style>
322+
.bold-label .el-form-item__label {
323+
font-weight: bold; /* 将字体加粗 */
324+
}
325+
</style>

0 commit comments

Comments
 (0)