<template>
  <div v-loading="loading" :style="{height: realHeight}">
    <iframe
        :src="src"
        frameborder="0"
        scrolling="no"
        id="bi_iframe"
        @load="adjustIframe"
        style="width:100%;position: absolute; top: 0px; left: 0px"
    ></iframe>
  </div>
</template>

<script setup>
import {useRoute} from "vue-router"

const firstLoad = ref(true)
const {proxy} = getCurrentInstance();
const route = useRoute();
const src = ref("");

function init() {
  proxy.getConfigKey("pp.web.url").then(response => {
    const query = route.query;
    if (query.suffix) {
      src.value = response.msg + query.suffix;
    } else {
      src.value = response.msg
    }
    console.error(query)
  })
}

init();


function adjustIframe() {
  const ifm = document.getElementById("bi_iframe");
  ifm.height = document.documentElement.clientHeight - 75;
}
</script>
