<template>
  <div ref="mod">
    <a-modal
      :get-container="() => $refs.mod"
      :open="props.open"
      :title="props.title ? props.title + ' 设备实时信息' : ''"
      @cancel="cancel"
      :footer="null"
    >
      <slot></slot>
    </a-modal>
  </div>
</template>

<script setup lang="ts">
defineOptions({
  name: 'FullViewModal',
})

type Props = {
  open: boolean
  title?: string
}
const emit = defineEmits<{
  (e: 'update:open', value: boolean): void
}>()

const props = withDefaults(defineProps<Props>(), {
  open: false,
  title: '',
})

// 关闭弹窗
const cancel = () => {
  emit('update:open', false)
}
</script>

<style scoped lang="less">
:deep(.ant-modal) {
  max-width: 100%;
  top: 0;
  padding-bottom: 0;
  margin: 0;
  .ant-modal-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh);
    width: calc(100vw);
    border-radius: 0;
  }
  .ant-modal-body {
    flex: 1;
    gap: 50px;
  }
}
</style>
