|
@@ -0,0 +1,49 @@
|
|
|
+<template>
|
|
|
+ <iframe @load="sendToken" id="myIframe" :src="iframeSrc" style="height: calc(100% - 70px);width: 100%;border: none;" ></iframe>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {goPage} from "@/utils/cqcy";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "index2",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ iframeWin: null,
|
|
|
+ iframeSrc: 'http://127.0.0.1:8848/reportSheet/index.html'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ sendToken() {
|
|
|
+ document.getElementById('myIframe').contentWindow.postMessage({
|
|
|
+ cmd: 'init',
|
|
|
+ data: {
|
|
|
+ token: localStorage.getItem('C_TOKEN'),
|
|
|
+ url: localStorage.getItem('SYS_HOST'),
|
|
|
+ }
|
|
|
+ }, '*')
|
|
|
+ const _this = this
|
|
|
+ window.addEventListener('message', function (event) {
|
|
|
+ const json = event.data
|
|
|
+ if (json.cmd === 'close') {
|
|
|
+ goPage(_this, '/index')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ },
|
|
|
+ destroyed() {
|
|
|
+ window.removeEventListener('message', function (e) {
|
|
|
+ console.log(e)
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|