<template>
    <div class="default-main" :style="height" v-loading="loading">
        <iframe
            :key="num"
            :src="iframeSrc"
            id="frame1"
            ref="iframeRef"
            frameborder="0"
            style="width: 100%; height: 100%; border: 0px solid"
        />
    </div>
</template>
<script setup lang="ts">
import { onMounted, ref, nextTick } from 'vue'
import { mainHeight } from '@/utils/layout'
defineOptions({
    name: 'harmonic-boot/detailedAnalysis/responsibility'
})
const height = mainHeight(20)

const num = ref(0)
const loading = ref(true)
const iframeRef: any = ref(null)
// const iframeSrc = 'http://www.jibei1.com:8088/#/harmonic-boot/detailedAnalysis/responsibilityqr'
const iframeSrc = window.location.origin + '/jbv2/#/harmonic-boot/detailedAnalysis/responsibilityqr'

onMounted(() => {
    iframeRef.value.onload = () => {
        iframeRef.value.contentWindow.postMessage({ info: window.localStorage.getItem('adminInfo') }, '*')
        setTimeout(() => {
            if (loading.value) {
            }
            ++num.value
            loading.value = false
        }, 0)
    }
})
</script>
<style lang="scss" scoped></style>
