ElementCustomConfig.vue 886 B

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