<template>
  <div :style="style">
    <Header :deviceType="deviceType" :moduleData="moduleData" :data="data" @select="selectedData = $event" />
    <Content :style="{ height: header.show ? 'calc(100% - 30px)' : '100%' }" :moduleData="moduleData" :data="selectedData" />
  </div>
</template>
<script lang="ts" setup>
  import Header from './header.vue';
  import Content from './content.vue';
  // import ModuleLeft from './original/moduleLeft.vue';
  // import ModuleBottom from './original/moduleBottom.vue';
  import { computed, ref } from 'vue';
  // import { ModuleProps } from '../types';

  const props = defineProps<{
    /** 配置的详细模块信息 */
    moduleData: any;
    /** 配置的详细样式信息 */
    showStyle: any;
    /** 该模块配置中的设备标识符 */
    deviceType: string;
    /** api返回的数据 */
    data: any;
    moduleName: string;
    visible: boolean;
  }>();
  defineEmits(['close', 'click']);

  const { header } = props.moduleData;
  const selectedData = ref();

  const style = computed(() => {
    const size = props.showStyle.size;
    const position = props.showStyle.position;
    return size + position + 'pointer-events: auto;';
  });
</script>
<style lang="less" scoped>
  @import '/@/design/theme.less';
</style>
