| 123456789101112131415161718192021222324252627282930313233343536 |
- <template>
- <component
- :is="getModuleComponent(showStyle.position)"
- :style="style"
- :title="moduleName"
- :visible="visible"
- @update:visible="$emit('update:visible', $event)"
- >
- <slot></slot>
- </component>
- </template>
- <script lang="ts" setup>
- import ModuleLeft from './original/moduleLeft.vue';
- import ModuleBottom from './original/moduleBottom.vue';
- import { computed } from 'vue';
- import { ShowStyle } from '../../../deviceManager/configurationTable/types';
- const props = defineProps<{
- showStyle: ShowStyle;
- moduleName: string;
- visible: boolean;
- }>();
- defineEmits(['update:visible']);
- const style = computed(() => {
- return props.showStyle.size + props.showStyle.position;
- });
- // 根据配置里的定位判断应该使用哪个module组件
- function getModuleComponent(position) {
- if (position.includes('top:640px;left:460px')) {
- return ModuleBottom;
- }
- return ModuleLeft;
- }
- </script>
|