Skip to content

Commit f125df7

Browse files
committed
【优化】BPM 界面优化:工作流程/审批中心/我的流程 +2
1 parent 7d29c63 commit f125df7

File tree

1 file changed

+109
-99
lines changed

1 file changed

+109
-99
lines changed

src/views/bpm/processInstance/index.vue

Lines changed: 109 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -19,104 +19,109 @@
1919
class="!w-240px"
2020
/>
2121
</el-form-item>
22-
22+
2323
<el-form-item>
2424
<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>
3425
</el-form-item>
3526

27+
<!-- TODO @ tuituji:style 可以使用 unocss -->
3628
<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>
5044
</el-form-item>
5145

46+
<!-- 高级筛选 -->
47+
<!-- TODO @ tuituji:style 可以使用 unocss -->
5248
<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"
7282
>
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"
7889
/>
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"
103115
/>
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>
105121
</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-->
118124
</el-form-item>
119-
120125
</el-form>
121126
</ContentWrap>
122127

@@ -131,6 +136,8 @@
131136
min-width="100"
132137
fixed="left"
133138
/>
139+
<!-- TODO @芋艿:摘要 -->
140+
<!-- TODO @tuituji:流程状态。可见需求文档里 Re:没看懂-->
134141
<el-table-column label="流程状态" prop="status" width="120">
135142
<template #default="scope">
136143
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" />
@@ -162,7 +169,7 @@
162169
</el-button>
163170
</template>
164171
</el-table-column>
165-
<el-table-column label="流程编号" align="center" prop="id" min-width="320px" />-->
172+
-->
166173
<el-table-column label="操作" align="center" fixed="right" width="180">
167174
<template #default="scope">
168175
<el-button
@@ -198,12 +205,12 @@
198205
</ContentWrap>
199206
</template>
200207
<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
202209
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
203-
import { dateFormatter, formatPast2 } from '@/utils/formatTime'
210+
import { dateFormatter } from '@/utils/formatTime'
204211
import { ElMessageBox } from 'element-plus'
205212
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
206-
import { CategoryApi } from '@/api/bpm/category'
213+
import { CategoryApi, CategoryVO } from '@/api/bpm/category'
207214
import { ProcessInstanceVO } from '@/api/bpm/processInstance'
208215
import * as DefinitionApi from '@/api/bpm/definition'
209216
@@ -226,7 +233,7 @@ const queryParams = reactive({
226233
createTime: []
227234
})
228235
const queryFormRef = ref() // 搜索的表单
229-
const categoryList = ref([]) // 流程分类列表
236+
const categoryList = ref<CategoryVO[]>([]) // 流程分类列表
230237
231238
/** 查询列表 */
232239
const getList = async () => {
@@ -240,6 +247,8 @@ const getList = async () => {
240247
}
241248
}
242249
250+
const showPopover = ref(false)
251+
243252
/** 搜索按钮操作 */
244253
const handleQuery = () => {
245254
queryParams.pageNo = 1
@@ -297,6 +306,15 @@ const handleCancel = async (row) => {
297306
await getList()
298307
}
299308
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+
300318
/** 激活时 **/
301319
onActivated(() => {
302320
getList()
@@ -307,17 +325,9 @@ onMounted(async () => {
307325
await getList()
308326
categoryList.value = await CategoryApi.getCategorySimpleList()
309327
})
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-
}
318328
</script>
319329
<style>
320330
.bold-label .el-form-item__label {
321331
font-weight: bold; /* 将字体加粗 */
322332
}
323-
</style>
333+
</style>

0 commit comments

Comments
 (0)