mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-02 03:34:59 +08:00
fix: 边界事件切换类别时需监听businessObject
This commit is contained in:
parent
d017ab55db
commit
be33226178
@ -56,7 +56,7 @@
|
|||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
<el-collapse-item name="customConfig" key="customConfig">
|
<el-collapse-item name="customConfig" key="customConfig">
|
||||||
<template #title><Icon icon="ep:tools" />自定义配置</template>
|
<template #title><Icon icon="ep:tools" />自定义配置</template>
|
||||||
<element-custom-config :id="elementId" :type="elementType" />
|
<element-custom-config :id="elementId" :type="elementType" :business-object="elementBusinessObject" />
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,27 +11,25 @@ defineOptions({ name: 'ElementCustomConfig' })
|
|||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
id: String,
|
id: String,
|
||||||
type: String
|
type: String,
|
||||||
|
businessObject: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const bpmnInstances = () => (window as any)?.bpmnInstances
|
const bpmnInstances = () => (window as any)?.bpmnInstances
|
||||||
const customConfigComponent = ref<any>(null)
|
const customConfigComponent = ref<any>(null)
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.type,
|
() => props.businessObject,
|
||||||
() => {
|
() => {
|
||||||
if (props.type) {
|
if (props.type && props.businessObject) {
|
||||||
const element = bpmnInstances().bpmnElement.businessObject
|
let val = props.type
|
||||||
let elementType = props.type
|
if (props.businessObject.eventDefinitions) {
|
||||||
if (element.eventDefinitions) {
|
val += props.businessObject.eventDefinitions[0]?.$type.split(':')[1] || ''
|
||||||
// 处理类似共用BoundaryEvent类型的TimerEvent
|
|
||||||
elementType += element.eventDefinitions[0].$type.split(':')[1]
|
|
||||||
}
|
|
||||||
const config = CustomConfigMap[elementType]
|
|
||||||
if (config) {
|
|
||||||
customConfigComponent.value = config.componet
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
customConfigComponent.value = CustomConfigMap[val]?.componet
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
|
Loading…
Reference in New Issue
Block a user