提交 | 用户 | 时间
|
3e359e
|
1 |
<template> |
H |
2 |
<div class="panel-tab__content"> |
9259c2
|
3 |
<component :is="customConfigComponent" v-bind="$props" /> |
3e359e
|
4 |
</div> |
H |
5 |
</template> |
|
6 |
|
|
7 |
<script lang="ts" setup> |
9259c2
|
8 |
import { CustomConfigMap } from './data' |
3e359e
|
9 |
|
H |
10 |
defineOptions({ name: 'ElementCustomConfig' }) |
9259c2
|
11 |
|
3e359e
|
12 |
const props = defineProps({ |
H |
13 |
id: String, |
9259c2
|
14 |
type: String, |
H |
15 |
businessObject: { |
|
16 |
type: Object, |
|
17 |
default: () => {} |
|
18 |
} |
3e359e
|
19 |
}) |
H |
20 |
|
|
21 |
const bpmnInstances = () => (window as any)?.bpmnInstances |
9259c2
|
22 |
const customConfigComponent = ref<any>(null) |
3e359e
|
23 |
|
H |
24 |
watch( |
9259c2
|
25 |
() => props.businessObject, |
H |
26 |
() => { |
|
27 |
if (props.type && props.businessObject) { |
|
28 |
let val = props.type |
|
29 |
if (props.businessObject.eventDefinitions) { |
|
30 |
val += props.businessObject.eventDefinitions[0]?.$type.split(':')[1] || '' |
|
31 |
} |
|
32 |
customConfigComponent.value = CustomConfigMap[val]?.componet |
|
33 |
} |
3e359e
|
34 |
}, |
H |
35 |
{ immediate: true } |
|
36 |
) |
|
37 |
</script> |
9259c2
|
38 |
|
H |
39 |
<style lang="scss" scoped></style> |