提交 9514b044 authored 作者: lidongxu's avatar lidongxu

style(jimureport): 积木报表广告上移

同上
上级 219ccbaf
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
:src="url" :src="url"
frameborder="no" frameborder="no"
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
scrolling="auto" /> scrolling="auto"
@load="loadCompleted" />
</div> </div>
</template> </template>
...@@ -15,6 +16,7 @@ const props = defineProps({ ...@@ -15,6 +16,7 @@ const props = defineProps({
required: true required: true
} }
}) })
const emits = defineEmits(['load'])
const height = ref(document.documentElement.clientHeight - 94.5 + "px;") const height = ref(document.documentElement.clientHeight - 94.5 + "px;")
const loading = ref(true) const loading = ref(true)
...@@ -28,4 +30,8 @@ onMounted(() => { ...@@ -28,4 +30,8 @@ onMounted(() => {
height.value = document.documentElement.clientHeight - 94.5 + "px;"; height.value = document.documentElement.clientHeight - 94.5 + "px;";
}; };
}) })
const loadCompleted = () => {
emits('load')
}
</script> </script>
<template> <template>
<i-frame :src="openUrl" <i-frame :src="openUrl"
id="jimuReportFrame" ></i-frame> id="jimuReportFrame"
ref="myIframe"
@load="load"></i-frame>
</template> </template>
<script> <script>
// 报表设计器 // 报表设计器
...@@ -17,17 +19,28 @@ export default { ...@@ -17,17 +19,28 @@ export default {
}, },
mounted: function () { mounted: function () {
},
methods: {
load() {
setTimeout(() => {
const iframe = this.$refs.myIframe;
console.log(iframe.contentDocument)
const iframeBody = iframe.body;
console.log(iframeBody)
}, 5000)
// 现在你可以操作 iframeBody 中的标签了
// const h1Element = iframeBody.querySelector('h1');
// console.log(h1Element.textContent); // 输出 h1 标签的文本内容
}
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
#jimuReportFrame{ #jimuReportFrame {
width: 100%; width: 100%;
height: 100%; height: 100%;
margin-top: -50px;
::v-deep(.layout){
background-color: transparent !important;
}
} }
</style> </style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论