| 1234567891011121314151617181920212223242526272829303132 |
- <template>
- <component :is="getModuleComponent(showStyle.position)" :style="style" :title="moduleName" :visible="visible" @close="$emit('close')">
- <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(['close']);
- const style = computed(() => {
- const size = props.showStyle.size;
- const position = props.showStyle.position;
- return size + position;
- });
- // 根据配置里的定位判断应该使用哪个module组件
- function getModuleComponent(position) {
- if (position === '中下') {
- return ModuleBottom;
- }
- return ModuleLeft;
- }
- </script>
|