Skip to content

Commit 48f6624

Browse files
committed
BPM:新增【流程任务】菜单,用于全部流程任务的查询
1 parent 5286ad1 commit 48f6624

File tree

6 files changed

+178
-8
lines changed

6 files changed

+178
-8
lines changed

src/api/bpm/task/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ export type TaskVO = {
44
id: number
55
}
66

7-
export const getTodoTaskPage = async (params: any) => {
7+
export const getTaskTodoPage = async (params: any) => {
88
return await request.get({ url: '/bpm/task/todo-page', params })
99
}
1010

11-
export const getDoneTaskPage = async (params: any) => {
11+
export const getTaskDonePage = async (params: any) => {
1212
return await request.get({ url: '/bpm/task/done-page', params })
1313
}
1414

15+
export const getTaskManagerPage = async (params: any) => {
16+
return await request.get({ url: '/bpm/task/manager-page', params })
17+
}
18+
1519
export const approveTask = async (data: any) => {
1620
return await request.put({ url: '/bpm/task/approve', data })
1721
}

src/views/bpm/processInstance/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
width="180"
115115
:formatter="dateFormatter"
116116
/>
117-
<el-table-column align="center" label="耗时" prop="durationInMillis" width="120">
117+
<el-table-column align="center" label="耗时" prop="durationInMillis" width="160">
118118
<template #default="scope">
119119
{{ scope.row.durationInMillis > 0 ? formatPast2(scope.row.durationInMillis) : '-' }}
120120
</template>

src/views/bpm/processInstance/manager/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
width="180"
115115
:formatter="dateFormatter"
116116
/>
117-
<el-table-column align="center" label="耗时" prop="durationInMillis" width="120">
117+
<el-table-column align="center" label="耗时" prop="durationInMillis" width="169">
118118
<template #default="scope">
119119
{{ scope.row.durationInMillis > 0 ? formatPast2(scope.row.durationInMillis) : '-' }}
120120
</template>
@@ -167,7 +167,7 @@ import { CategoryApi } from '@/api/bpm/category'
167167
import * as UserApi from '@/api/system/user'
168168
import { cancelProcessInstanceByAdmin } from '@/api/bpm/processInstance'
169169
170-
// 它是【我的流程】的差异是,该菜单可以看全部的流程实例
170+
// 它和【我的流程】的差异是,该菜单可以看全部的流程实例
171171
defineOptions({ name: 'BpmProcessInstanceManager' })
172172
173173
const router = useRouter() // 路由

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
</template>
8282
</el-table-column>
8383
<el-table-column align="center" label="审批建议" prop="reason" min-width="180" />
84-
<el-table-column align="center" label="耗时" prop="durationInMillis" width="120">
84+
<el-table-column align="center" label="耗时" prop="durationInMillis" width="160">
8585
<template #default="scope">
8686
{{ formatPast2(scope.row.durationInMillis) }}
8787
</template>
@@ -127,7 +127,7 @@ const queryFormRef = ref() // 搜索的表单
127127
const getList = async () => {
128128
loading.value = true
129129
try {
130-
const data = await TaskApi.getDoneTaskPage(queryParams)
130+
const data = await TaskApi.getTaskDonePage(queryParams)
131131
list.value = data.list
132132
total.value = data.total
133133
} finally {

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

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
<template>
2+
<doc-alert title="工作流手册" url="https://doc.iocoder.cn/bpm/" />
3+
4+
<ContentWrap>
5+
<!-- 搜索工作栏 -->
6+
<el-form
7+
ref="queryFormRef"
8+
:inline="true"
9+
:model="queryParams"
10+
class="-mb-15px"
11+
label-width="68px"
12+
>
13+
<el-form-item label="任务名称" prop="name">
14+
<el-input
15+
v-model="queryParams.name"
16+
class="!w-240px"
17+
clearable
18+
placeholder="请输入任务名称"
19+
@keyup.enter="handleQuery"
20+
/>
21+
</el-form-item>
22+
<el-form-item label="创建时间" prop="createTime">
23+
<el-date-picker
24+
v-model="queryParams.createTime"
25+
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
26+
class="!w-240px"
27+
end-placeholder="结束日期"
28+
start-placeholder="开始日期"
29+
type="daterange"
30+
value-format="YYYY-MM-DD HH:mm:ss"
31+
/>
32+
</el-form-item>
33+
<el-form-item>
34+
<el-button @click="handleQuery">
35+
<Icon class="mr-5px" icon="ep:search" />
36+
搜索
37+
</el-button>
38+
<el-button @click="resetQuery">
39+
<Icon class="mr-5px" icon="ep:refresh" />
40+
重置
41+
</el-button>
42+
</el-form-item>
43+
</el-form>
44+
</ContentWrap>
45+
46+
<!-- 列表 -->
47+
<ContentWrap>
48+
<el-table v-loading="loading" :data="list">
49+
<el-table-column align="center" label="流程" prop="processInstance.name" width="180" />
50+
<el-table-column
51+
align="center"
52+
label="发起人"
53+
prop="processInstance.startUser.nickname"
54+
width="100"
55+
/>
56+
<el-table-column
57+
:formatter="dateFormatter"
58+
align="center"
59+
label="发起时间"
60+
prop="createTime"
61+
width="180"
62+
/>
63+
<el-table-column align="center" label="当前任务" prop="name" width="180" />
64+
<el-table-column
65+
:formatter="dateFormatter"
66+
align="center"
67+
label="任务开始时间"
68+
prop="createTime"
69+
width="180"
70+
/>
71+
<el-table-column
72+
:formatter="dateFormatter"
73+
align="center"
74+
label="任务结束时间"
75+
prop="endTime"
76+
width="180"
77+
/>
78+
<el-table-column align="center" label="审批人" prop="assigneeUser.nickname" width="100" />
79+
<el-table-column align="center" label="审批状态" prop="status" width="120">
80+
<template #default="scope">
81+
<dict-tag :type="DICT_TYPE.BPM_TASK_STATUS" :value="scope.row.status" />
82+
</template>
83+
</el-table-column>
84+
<el-table-column align="center" label="审批建议" prop="reason" min-width="180" />
85+
<el-table-column align="center" label="耗时" prop="durationInMillis" width="160">
86+
<template #default="scope">
87+
{{ formatPast2(scope.row.durationInMillis) }}
88+
</template>
89+
</el-table-column>
90+
<el-table-column align="center" label="流程编号" prop="id" :show-overflow-tooltip="true" />
91+
<el-table-column align="center" label="任务编号" prop="id" :show-overflow-tooltip="true" />
92+
<el-table-column align="center" label="操作" fixed="right" width="80">
93+
<template #default="scope">
94+
<el-button link type="primary" @click="handleAudit(scope.row)">历史</el-button>
95+
</template>
96+
</el-table-column>
97+
</el-table>
98+
<!-- 分页 -->
99+
<Pagination
100+
v-model:limit="queryParams.pageSize"
101+
v-model:page="queryParams.pageNo"
102+
:total="total"
103+
@pagination="getList"
104+
/>
105+
</ContentWrap>
106+
</template>
107+
<script lang="ts" setup>
108+
import { DICT_TYPE } from '@/utils/dict'
109+
import { dateFormatter, formatPast2 } from '@/utils/formatTime'
110+
import * as TaskApi from '@/api/bpm/task'
111+
112+
// 它和【待办任务】【已办任务】的差异是,该菜单可以看全部的流程任务
113+
defineOptions({ name: 'BpmManagerTask' })
114+
115+
const { push } = useRouter() // 路由
116+
117+
const loading = ref(true) // 列表的加载中
118+
const total = ref(0) // 列表的总页数
119+
const list = ref([]) // 列表的数据
120+
const queryParams = reactive({
121+
pageNo: 1,
122+
pageSize: 10,
123+
name: '',
124+
createTime: []
125+
})
126+
const queryFormRef = ref() // 搜索的表单
127+
128+
/** 查询任务列表 */
129+
const getList = async () => {
130+
loading.value = true
131+
try {
132+
const data = await TaskApi.getTaskManagerPage(queryParams)
133+
list.value = data.list
134+
total.value = data.total
135+
} finally {
136+
loading.value = false
137+
}
138+
}
139+
140+
/** 搜索按钮操作 */
141+
const handleQuery = () => {
142+
queryParams.pageNo = 1
143+
getList()
144+
}
145+
146+
/** 重置按钮操作 */
147+
const resetQuery = () => {
148+
queryFormRef.value.resetFields()
149+
handleQuery()
150+
}
151+
152+
/** 处理审批按钮 */
153+
const handleAudit = (row: any) => {
154+
push({
155+
name: 'BpmProcessInstanceDetail',
156+
query: {
157+
id: row.processInstance.id
158+
}
159+
})
160+
}
161+
162+
/** 初始化 **/
163+
onMounted(() => {
164+
getList()
165+
})
166+
</script>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const queryFormRef = ref() // 搜索的表单
109109
const getList = async () => {
110110
loading.value = true
111111
try {
112-
const data = await TaskApi.getTodoTaskPage(queryParams)
112+
const data = await TaskApi.getTaskTodoPage(queryParams)
113113
list.value = data.list
114114
total.value = data.total
115115
} finally {

0 commit comments

Comments
 (0)