Skip to content

Commit 2de6266

Browse files
committed
Merge branch 'feature/bpm' of https://gitee.com/tuituji111/yudao-ui-admin-vue3 into feature/bpm
# Conflicts: # src/views/bpm/processInstance/index.vue
2 parents e591aa8 + 455c192 commit 2de6266

File tree

3 files changed

+212
-62
lines changed

3 files changed

+212
-62
lines changed

src/views/bpm/processInstance/index.vue

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
</el-form-item>
2626

2727
<!-- TODO @ tuituji:style 可以使用 unocss -->
28-
<el-form-item label="" prop="category" :style="{ position: 'absolute', right: '130px' }">
28+
<el-form-item label="" prop="category" :style="{ position: 'absolute', right: '300px' }">
29+
<!-- TODO @tuituji:应该选择好分类,就触发搜索啦。 RE:done & to check-->
2930
<el-select
3031
v-model="queryParams.category"
3132
placeholder="请选择流程分类"
@@ -42,6 +43,25 @@
4243
</el-select>
4344
</el-form-item>
4445

46+
<el-form-item label="" prop="status" :style="{ position: 'absolute', right: '130px' }">
47+
<el-select
48+
v-model="queryParams.status"
49+
placeholder="请选择流程状态"
50+
clearable
51+
class="!w-155px"
52+
@change="handleQuery"
53+
>
54+
<el-option
55+
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
56+
:key="dict.value"
57+
:label="dict.label"
58+
:value="dict.value"
59+
/>
60+
</el-select>
61+
</el-form-item>
62+
63+
<!-- 高级筛选 -->
64+
<!-- TODO @ tuituji:style 可以使用 unocss -->
4565
<el-form-item :style="{ position: 'absolute', right: '0px' }">
4666
<el-popover
4767
:visible="showPopover"
@@ -51,9 +71,10 @@
5171
placement="bottom-end"
5272
>
5373
<template #reference>
54-
<el-button @click="showPopover = !showPopover">
55-
<Icon icon="ep:plus" class="mr-5px" />高级筛选
74+
<el-button @click="showPopover = !showPopover" >
75+
<Icon icon="ep:plus" class="mr-5px" />高级筛选
5676
</el-button>
77+
5778
</template>
5879
<el-form-item label="流程发起人" class="bold-label" label-position="top" prop="category">
5980
<el-select
@@ -84,21 +105,6 @@
84105
class="!w-390px"
85106
/>
86107
</el-form-item>
87-
<el-form-item label="流程状态" class="bold-label" label-position="top" prop="status">
88-
<el-select
89-
v-model="queryParams.status"
90-
placeholder="请选择流程状态"
91-
clearable
92-
class="!w-390px"
93-
>
94-
<el-option
95-
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
96-
:key="dict.value"
97-
:label="dict.label"
98-
:value="dict.value"
99-
/>
100-
</el-select>
101-
</el-form-item>
102108
<el-form-item label="发起时间" class="bold-label" label-position="top" prop="createTime">
103109
<el-date-picker
104110
v-model="queryParams.createTime"
@@ -111,11 +117,12 @@
111117
/>
112118
</el-form-item>
113119
<el-form-item class="bold-label" label-position="top">
114-
<el-button @click="resetQuery"> 清空</el-button>
120+
<el-button @click="handleQuery"> 确认</el-button>
115121
<el-button @click="showPopover = false"> 取消</el-button>
116-
<el-button @click="handleQuery" type="primary"> 确认</el-button>
117-
</el-form-item>
118-
</el-popover>
122+
<el-button @click="resetQuery"> 清空</el-button>
123+
</el-form-item>
124+
</el-popover>
125+
<!-- TODO @tuituji:这里应该有确认,和取消、清空搜索条件,三个按钮。 RE:done & to check-->
119126
</el-form-item>
120127
</el-form>
121128
</ContentWrap>
@@ -132,7 +139,7 @@
132139
fixed="left"
133140
/>
134141
<!-- TODO @芋艿:摘要 -->
135-
<!-- TODO @tuituji:流程状态。可见需求文档里 Re:没看懂;回复:1)就是审批中的时候,展示审批人;2)审批结束的时候,就展示状态 -->
142+
<!-- TODO @tuituji:流程状态。可见需求文档里 Re:没看懂-->
136143
<el-table-column label="流程状态" prop="status" width="120">
137144
<template #default="scope">
138145
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" />
@@ -200,6 +207,7 @@
200207
</ContentWrap>
201208
</template>
202209
<script lang="ts" setup>
210+
// TODO @tuituji:List 改成 <Icon icon="ep:plus" class="mr-5px" /> 类似这种组件哈。 RE:done & to check
203211
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
204212
import { dateFormatter } from '@/utils/formatTime'
205213
import { ElMessageBox } from 'element-plus'
@@ -275,7 +283,7 @@ const handleCreate = async (row?: ProcessInstanceVO) => {
275283
}
276284
277285
/** 查看详情 */
278-
const handleDetail = (row: any) => {
286+
const handleDetail = (row) => {
279287
router.push({
280288
name: 'BpmProcessInstanceDetail',
281289
query: {
@@ -285,7 +293,7 @@ const handleDetail = (row: any) => {
285293
}
286294
287295
/** 取消按钮操作 */
288-
const handleCancel = async (row: any) => {
296+
const handleCancel = async (row) => {
289297
// 二次确认
290298
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
291299
confirmButtonText: t('common.ok'),
@@ -300,6 +308,15 @@ const handleCancel = async (row: any) => {
300308
await getList()
301309
}
302310
311+
// TODO @tuituji:这个 import 是不是没用哈?
312+
// import { ClickOutside as vClickOutside } from 'element-plus'
313+
314+
// TODO @tuituji:onClickAdvancedSearch。方法名叫这个,会更好一些哇?打开高级搜索。
315+
const popoverRef = ref()
316+
const onClickOutside = () => {
317+
unref(popoverRef).popperRef?.delayHide?.()
318+
}
319+
303320
/** 激活时 **/
304321
onActivated(() => {
305322
getList()

src/views/bpm/task/done/index.vue

Lines changed: 94 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class="-mb-15px"
1717
label-width="68px"
1818
>
19-
<el-form-item label="任务名称" prop="name">
19+
<el-form-item label="" prop="name">
2020
<el-input
2121
v-model="queryParams.name"
2222
class="!w-240px"
@@ -25,27 +25,96 @@
2525
@keyup.enter="handleQuery"
2626
/>
2727
</el-form-item>
28-
<el-form-item label="创建时间" prop="createTime">
29-
<el-date-picker
30-
v-model="queryParams.createTime"
31-
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
32-
class="!w-240px"
33-
end-placeholder="结束日期"
34-
start-placeholder="开始日期"
35-
type="daterange"
36-
value-format="YYYY-MM-DD HH:mm:ss"
37-
/>
38-
</el-form-item>
3928
<el-form-item>
4029
<el-button @click="handleQuery">
4130
<Icon class="mr-5px" icon="ep:search" />
4231
搜索
4332
</el-button>
44-
<el-button @click="resetQuery">
45-
<Icon class="mr-5px" icon="ep:refresh" />
46-
重置
47-
</el-button>
4833
</el-form-item>
34+
35+
<el-form-item label="" prop="category" :style="{ position: 'absolute', right: '300px' }">
36+
<el-select
37+
v-model="queryParams.category"
38+
placeholder="请选择流程分类"
39+
clearable
40+
class="!w-155px"
41+
@change="handleQuery"
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>
50+
</el-form-item>
51+
52+
<el-form-item label="" prop="status" :style="{ position: 'absolute', right: '130px' }">
53+
<el-select
54+
v-model="queryParams.status"
55+
placeholder="请选择流程状态"
56+
clearable
57+
class="!w-155px"
58+
@change="handleQuery"
59+
>
60+
<el-option
61+
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
62+
:key="dict.value"
63+
:label="dict.label"
64+
:value="dict.value"
65+
/>
66+
</el-select>
67+
</el-form-item>
68+
69+
<!-- 高级筛选 -->
70+
<el-form-item :style="{ position: 'absolute', right: '0px' }">
71+
<el-popover
72+
:visible="showPopover"
73+
persistent
74+
:width="400"
75+
:show-arrow="false"
76+
placement="bottom-end"
77+
>
78+
<template #reference>
79+
<el-button @click="showPopover = !showPopover" >
80+
<Icon icon="ep:plus" class="mr-5px" />高级筛选
81+
</el-button>
82+
83+
</template>
84+
<el-form-item label="流程发起人" class="bold-label" label-position="top" prop="category">
85+
<el-select
86+
v-model="queryParams.category"
87+
placeholder="请选择流程发起人"
88+
clearable
89+
class="!w-390px"
90+
>
91+
<el-option
92+
v-for="category in categoryList"
93+
:key="category.code"
94+
:label="category.name"
95+
:value="category.code"
96+
/>
97+
</el-select>
98+
</el-form-item>
99+
<el-form-item label="发起时间" class="bold-label" label-position="top" prop="createTime">
100+
<el-date-picker
101+
v-model="queryParams.createTime"
102+
value-format="YYYY-MM-DD HH:mm:ss"
103+
type="daterange"
104+
start-placeholder="开始日期"
105+
end-placeholder="结束日期"
106+
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
107+
class="!w-240px"
108+
/>
109+
</el-form-item>
110+
<el-form-item class="bold-label" label-position="top">
111+
<el-button @click="handleQuery"> 确认</el-button>
112+
<el-button @click="showPopover = false"> 取消</el-button>
113+
<el-button @click="resetQuery"> 清空</el-button>
114+
</el-form-item>
115+
</el-popover>
116+
</el-form-item>
117+
49118
</el-form>
50119
</ContentWrap>
51120

@@ -110,9 +179,10 @@
110179
</ContentWrap>
111180
</template>
112181
<script lang="ts" setup>
113-
import { DICT_TYPE } from '@/utils/dict'
182+
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
114183
import { dateFormatter, formatPast2 } from '@/utils/formatTime'
115184
import * as TaskApi from '@/api/bpm/task'
185+
import { CategoryApi, CategoryVO } from '@/api/bpm/category'
116186
117187
defineOptions({ name: 'BpmTodoTask' })
118188
@@ -125,9 +195,13 @@ const queryParams = reactive({
125195
pageNo: 1,
126196
pageSize: 10,
127197
name: '',
198+
category: undefined,
199+
status: undefined,
128200
createTime: []
129201
})
130202
const queryFormRef = ref() // 搜索的表单
203+
const categoryList = ref<CategoryVO[]>([]) // 流程分类列表
204+
const showPopover = ref(false)
131205
132206
/** 查询任务列表 */
133207
const getList = async () => {
@@ -165,7 +239,8 @@ const handleAudit = (row: any) => {
165239
}
166240
167241
/** 初始化 **/
168-
onMounted(() => {
169-
getList()
242+
onMounted(async () => {
243+
await getList()
244+
categoryList.value = await CategoryApi.getCategorySimpleList()
170245
})
171246
</script>

0 commit comments

Comments
 (0)