<template>
|
<div class="report-box">
|
<iframe id="iframe-box" @load="loadFrame" ref="iframe" :src="url" scrolling="auto" :style="{height:'100%',width:'100%',border:'none'}" />
|
</div>
|
</template>
|
|
<script>
|
import { getToken } from '@/utils/auth';
|
export default {
|
name: "",
|
data() {
|
return {
|
url: '',
|
height: 500
|
}
|
},
|
created() {
|
// const orgLv = this.$store.getters.info.orgLv
|
// const orgCode = this.$store.getters.info.orgNo
|
// this.url = globalConf.reportUrl + `/decision/view/report?viewlet=score_summary_branch.cpt&lv=${orgLv}&orgCode=${orgCode}`
|
// let token = 'Bearer ' + getToken();
|
let token = getToken();
|
this.url = globalConf.baseUrl + `/jmreport/view/ff9bd143582a6dfed897ba8b6f93b175?token=${token}`
|
this.height = window.screen.availHeight
|
},
|
methods:{
|
loadFrame() {
|
const iframeBox = document.getElementById('iframe-box')
|
const doc = iframeBox.contentWindow.document
|
const head = doc.getElementsByTagName('head')
|
const linkTag = document.createElement('link')
|
linkTag.id = 'newstyle'
|
linkTag.href = `./iframe.css`
|
linkTag.setAttribute('rel', 'stylesheet')
|
linkTag.setAttribute('type', 'text/css')
|
head[0].append(linkTag)
|
}
|
}
|
}
|
</script>
|
<style lang="scss">
|
.report-box{
|
height: calc( 100vh - 150px );
|
}
|
</style>
|