Commit be332261 by Lesan

fix: 边界事件切换类别时需监听businessObject

parent d017ab55
......@@ -56,7 +56,7 @@
</el-collapse-item>
<el-collapse-item name="customConfig" key="customConfig">
<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>
</div>
......
......@@ -11,27 +11,25 @@ defineOptions({ name: 'ElementCustomConfig' })
const props = defineProps({
id: String,
type: String
type: String,
businessObject: {
type: Object,
default: () => {}
}
})
const bpmnInstances = () => (window as any)?.bpmnInstances
const customConfigComponent = ref<any>(null)
watch(
() => props.type,
() => props.businessObject,
() => {
if (props.type) {
const element = bpmnInstances().bpmnElement.businessObject
let elementType = props.type
if (element.eventDefinitions) {
// 处理类似共用BoundaryEvent类型的TimerEvent
elementType += element.eventDefinitions[0].$type.split(':')[1]
}
const config = CustomConfigMap[elementType]
if (config) {
customConfigComponent.value = config.componet
return
if (props.type && props.businessObject) {
let val = props.type
if (props.businessObject.eventDefinitions) {
val += props.businessObject.eventDefinitions[0]?.$type.split(':')[1] || ''
}
customConfigComponent.value = CustomConfigMap[val]?.componet
}
},
{ immediate: true }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment