提交 | 用户 | 时间
|
3e359e
|
1 |
<template> |
H |
2 |
<SimpleProcessModel :flow-node="simpleModel" :readonly="true" /> |
|
3 |
</template> |
|
4 |
|
|
5 |
<script setup lang="ts"> |
|
6 |
import { useWatchNode } from './node' |
|
7 |
import { SimpleFlowNode } from './consts' |
|
8 |
|
|
9 |
defineOptions({ |
|
10 |
name: 'SimpleProcessViewer' |
|
11 |
}) |
|
12 |
|
|
13 |
const props = defineProps({ |
|
14 |
flowNode: { |
|
15 |
type: Object as () => SimpleFlowNode, |
|
16 |
required: true |
|
17 |
}, |
|
18 |
// 流程任务 |
|
19 |
tasks: { |
|
20 |
type: Array, |
|
21 |
default: () => [] as any[] |
|
22 |
}, |
|
23 |
// 流程实例 |
|
24 |
processInstance: { |
|
25 |
type: Object, |
|
26 |
default: () => undefined |
|
27 |
} |
|
28 |
}) |
|
29 |
const approveTasks = ref<any[]>(props.tasks) |
|
30 |
const currentProcessInstance = ref(props.processInstance) |
|
31 |
const simpleModel = useWatchNode(props) |
|
32 |
watch( |
|
33 |
() => props.tasks, |
|
34 |
(newValue) => { |
|
35 |
approveTasks.value = newValue |
|
36 |
} |
|
37 |
) |
|
38 |
watch( |
|
39 |
() => props.processInstance, |
|
40 |
(newValue) => { |
|
41 |
currentProcessInstance.value = newValue |
|
42 |
} |
|
43 |
) |
|
44 |
|
|
45 |
provide('tasks', approveTasks) |
|
46 |
provide('processInstance', currentProcessInstance) |
|
47 |
</script> |
|
48 |
p |