127
127
</el-card >
128
128
129
129
<!-- 高亮流程图 -->
130
- <el-card class =" box-card" v-loading =" processInstanceLoading" >
131
- <template #header >
132
- <span class =" el-icon-picture-outline" >流程图</span >
133
- </template >
134
- <my-process-viewer
135
- key =" designer"
136
- v-model =" bpmnXML"
137
- :value =" bpmnXML"
138
- v-bind =" bpmnControlForm"
139
- :prefix =" bpmnControlForm.prefix"
140
- :activityData =" activityList"
141
- :processInstanceData =" processInstance"
142
- :taskData =" tasks"
143
- />
144
- </el-card >
130
+ <ProcessInstanceBpmnViewer
131
+ :id =" id"
132
+ :process-instance =" processInstance"
133
+ :loading =" processInstanceLoading"
134
+ :tasks =" tasks"
135
+ :bpmn-xml =" bpmnXML"
136
+ />
145
137
146
138
<!-- 弹窗:转派审批人 -->
147
139
<TaskUpdateAssigneeForm ref =" taskUpdateAssigneeFormRef" @success =" getDetail" />
148
140
</ContentWrap >
149
141
</template >
150
142
<script setup lang="ts">
151
143
import { parseTime } from ' @/utils/formatTime'
152
- import * as UserApi from ' @/api/system/user'
153
144
import * as ProcessInstanceApi from ' @/api/bpm/processInstance'
154
- import * as DefinitionApi from ' @/api/bpm/definition'
155
145
import * as TaskApi from ' @/api/bpm/task'
156
- import * as ActivityApi from ' @/api/bpm/activity'
157
146
import { formatPast2 } from ' @/utils/formatTime'
158
147
import { setConfAndFields2 } from ' @/utils/formCreate'
159
148
import type { ApiAttrs } from ' @form-create/element-ui/types/config'
160
149
import { useUserStore } from ' @/store/modules/user'
161
150
import TaskUpdateAssigneeForm from ' ./TaskUpdateAssigneeForm.vue'
151
+ import ProcessInstanceBpmnViewer from ' ./ProcessInstanceBpmnViewer.vue'
152
+ import * as DefinitionApi from ' @/api/bpm/definition'
162
153
163
154
const { query } = useRoute () // 查询参数
164
155
const message = useMessage () // 消息弹窗
@@ -249,6 +240,7 @@ const getTimelineItemType = (item) => {
249
240
}
250
241
251
242
// ========== 审批记录 ==========
243
+ const bpmnXML = ref (' ' )
252
244
253
245
/** 转派审批人 */
254
246
const taskUpdateAssigneeFormRef = ref ()
@@ -265,32 +257,12 @@ const handleDelegate = async (task) => {
265
257
/** 处理审批退回的操作 */
266
258
const handleBack = async (task ) => {
267
259
message .error (' 暂不支持【退回】功能!' )
268
- // 可参考 http://blog.wya1.com/article/636697030/details/7296
269
- // const data = {
270
- // id: task.id,
271
- // assigneeUserId: 1
272
- // }
273
- // backTask(data).then(response => {
274
- // this.$modal.msgSuccess("回退成功!");
275
- // this.getDetail(); // 获得最新详情
276
- // });
277
260
console .log (task )
278
261
}
279
262
280
- // ========== 高亮流程图 ==========
281
- const bpmnXML = ref (null )
282
- const bpmnControlForm = ref ({
283
- prefix: ' flowable'
284
- })
285
- const activityList = ref ([])
286
-
287
263
// ========== 初始化 ==========
288
264
onMounted (() => {
289
265
getDetail ()
290
- // 加载用户的列表
291
- UserApi .getSimpleUserList ().then ((data ) => {
292
- userOptions .value .push (... data )
293
- })
294
266
})
295
267
296
268
const getDetail = () => {
@@ -324,13 +296,6 @@ const getDetail = () => {
324
296
DefinitionApi .getProcessDefinitionBpmnXML (processDefinition .id ).then ((data ) => {
325
297
bpmnXML .value = data
326
298
})
327
-
328
- // 加载活动列表
329
- ActivityApi .getActivityList ({
330
- processInstanceId: data .id
331
- }).then ((data ) => {
332
- activityList .value = data
333
- })
334
299
})
335
300
.finally (() => {
336
301
processInstanceLoading .value = false
@@ -387,12 +352,7 @@ const getDetail = () => {
387
352
})
388
353
}
389
354
</script >
390
-
391
355
<style lang="scss">
392
- .my-process-designer {
393
- height : calc (100vh - 200px );
394
- }
395
-
396
356
.box-card {
397
357
width : 100% ;
398
358
margin-bottom : 20px ;
0 commit comments