添加地图
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
<template>
|
||||
<div class="plan">
|
||||
<!-- src=" http://192.168.1.128:3001/zutai/?id=44368e72a2e594d14ebaf317f0f6ad00&&name=decodeURI(APP测试项目)&&flag=true&&wxqr=true#/" -->
|
||||
<!-- <iframe
|
||||
src="http://192.168.1.62:8088/zutai/?id=0944fe372e90daeefd040916a105ac8b&&name=测试组态编辑器&&preview=true#/preview"
|
||||
width="100%"
|
||||
height="100%"
|
||||
frameborder="0"
|
||||
></iframe> -->
|
||||
<bdMap v-show="store.state.showMap" width="100%" height="100%"></bdMap>
|
||||
|
||||
<!-- 添加加载事件监听 -->
|
||||
<iframe
|
||||
v-if="!store.state.showMap"
|
||||
:src="iframeSrc"
|
||||
width="100%"
|
||||
height="100%"
|
||||
@@ -23,6 +19,7 @@
|
||||
import { ref, watch, onMounted, onUnmounted } from "vue";
|
||||
import { getActive } from "@/api/manage_wx/index";
|
||||
import { useStore } from "vuex";
|
||||
import bdMap from "./bdMap.vue";
|
||||
const store = useStore();
|
||||
const props = defineProps<{
|
||||
project: { id: string; name: string } | null;
|
||||
@@ -50,6 +47,7 @@ watch(
|
||||
);
|
||||
|
||||
onMounted(() => {
|
||||
// store.dispatch("setStateKey", { key: "showMap", value: false });
|
||||
// 监听来自 eventStatistics 组件的消息
|
||||
window.addEventListener("message", handleMessage);
|
||||
getActive({}).then((res: any) => {
|
||||
@@ -65,12 +63,13 @@ onMounted(() => {
|
||||
});
|
||||
// 子页面
|
||||
const iframe = document.getElementById("iframeLeft");
|
||||
|
||||
// 监听 iframe 加载完成事件
|
||||
iframe.addEventListener("load", function () {
|
||||
// 通知父页面:我已加载完毕
|
||||
store.dispatch("setIframeLoad", true);
|
||||
});
|
||||
if (iframe) {
|
||||
// 监听 iframe 加载完成事件
|
||||
iframe.addEventListener("load", function () {
|
||||
// 通知父页面:我已加载完毕
|
||||
store.dispatch("setStateKey", { key: "iframeLoad", value: true });
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user