<template>
  <div class="full-screen-container" v-loading="loading">
    <iframe :src="url" frameborder="0" class="full-screen-iframe" allowfullscreen></iframe>
  </div>
</template>

<script lang="ts" setup>
import { onMounted, ref } from 'vue'
import { IotStatApi } from '@/api/pms/stat'

let url = ref('')
const loading = ref(true) // 加载中

onMounted(async () => {
  const res = await IotStatApi.getSsoToken()

  url.value =
    'https://report.deepoil.cc/webroot/decision/v10/entry/access/a12df128-c84f-44be-a55d-bababbf4a132?preview=true&page_number=1&ssoToken=' +
    res

  loading.value = false
})
</script>

<style scoped>
.full-screen-container {
  width: calc(100% - 0px); /* 减去侧边栏宽度 */
  height: calc(100vh - 90px); /* 减去顶部导航高度 */
  overflow: hidden;
  position: absolute;
  top: 0px; /* 顶部导航的高度 */
  left: 0px; /* 侧边栏的宽度 */
  right: 0;
  bottom: 0;
  z-index: 1;
}

.full-screen-iframe {
  width: 100%;
  height: 100%;
  border: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  display: block;
}
</style>
