2026-08-07 14:38:16 +08:00
|
|
|
|
<!--
|
|
|
|
|
|
* 文件说明:动态节点包装器,挂载具体节点并同步内容变化。
|
|
|
|
|
|
* 作用范围:仅服务于流程设计器模块。
|
|
|
|
|
|
-->
|
2026-07-28 16:26:07 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="node__box">
|
|
|
|
|
|
<component :is="componentId" :model="props.model" :properties="props.properties" ref="nodeRef" @contentChange="contentChange"></component>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
|
import { onMounted, ref } from 'vue'
|
|
|
|
|
|
// import ArmNode from '../nodes/mechanical/arm.vue';
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
model: Object,
|
|
|
|
|
|
properties: Object,
|
|
|
|
|
|
component: Object,
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const emits = defineEmits(['contentChange', 'bindRef'])
|
|
|
|
|
|
|
|
|
|
|
|
const componentId = ref(props.component)
|
|
|
|
|
|
|
2026-08-07 14:38:16 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 处理 contentChange 对应的数据或交互;作用范围仅限当前组件或模块。
|
|
|
|
|
|
*/
|
2026-07-28 16:26:07 +08:00
|
|
|
|
const contentChange = () => {
|
|
|
|
|
|
emits('contentChange')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const nodeRef = ref()
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
emits('bindRef', nodeRef.value)
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.node__box {
|
|
|
|
|
|
width: 320px;
|
|
|
|
|
|
height: auto;
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
padding: 12px;
|
|
|
|
|
|
cursor: default;
|
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
|
border: 2px solid white;
|
|
|
|
|
|
box-shadow: 0 5px 15px 0#00000008;
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
}
|
2026-08-07 14:38:16 +08:00
|
|
|
|
</style>
|