提交 | 用户 | 时间
|
820397
|
1 |
<template> |
H |
2 |
<el-card v-loading="loading" class="box-card"> |
|
3 |
<template #header> |
|
4 |
<span class="el-icon-picture-outline">流程图</span> |
|
5 |
</template> |
|
6 |
<MyProcessViewer |
|
7 |
key="designer" |
|
8 |
:activityData="activityList" |
|
9 |
:prefix="bpmnControlForm.prefix" |
|
10 |
:processInstanceData="processInstance" |
|
11 |
:taskData="tasks" |
|
12 |
:value="bpmnXml" |
|
13 |
v-bind="bpmnControlForm" |
|
14 |
/> |
|
15 |
</el-card> |
|
16 |
</template> |
|
17 |
<script lang="ts" setup> |
|
18 |
import { propTypes } from '@/utils/propTypes' |
|
19 |
import { MyProcessViewer } from '@/components/bpmnProcessDesigner/package' |
|
20 |
import * as ActivityApi from '@/api/bpm/activity' |
|
21 |
|
|
22 |
defineOptions({ name: 'BpmProcessInstanceBpmnViewer' }) |
|
23 |
|
|
24 |
const props = defineProps({ |
|
25 |
loading: propTypes.bool, // 是否加载中 |
|
26 |
id: propTypes.string, // 流程实例的编号 |
|
27 |
processInstance: propTypes.any, // 流程实例的信息 |
|
28 |
tasks: propTypes.array, // 流程任务的数组 |
|
29 |
bpmnXml: propTypes.string // BPMN XML |
|
30 |
}) |
|
31 |
|
|
32 |
const bpmnControlForm = ref({ |
|
33 |
prefix: 'flowable' |
|
34 |
}) |
|
35 |
const activityList = ref([]) // 任务列表 |
|
36 |
|
|
37 |
/** 只有 loading 完成时,才去加载流程列表 */ |
|
38 |
watch( |
|
39 |
() => props.loading, |
|
40 |
async (value) => { |
|
41 |
if (value && props.id) { |
|
42 |
activityList.value = await ActivityApi.getActivityList({ |
|
43 |
processInstanceId: props.id |
|
44 |
}) |
|
45 |
} |
|
46 |
} |
|
47 |
) |
|
48 |
</script> |
|
49 |
<style> |
|
50 |
.box-card { |
|
51 |
width: 100%; |
|
52 |
margin-bottom: 20px; |
|
53 |
} |
|
54 |
</style> |