修改无锡测试bug
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, onMounted, onUnmounted } from "vue";
|
||||
import { getActive } from "@/api/manage_wx/index";
|
||||
|
||||
import { useStore } from "vuex";
|
||||
const store = useStore();
|
||||
const props = defineProps<{
|
||||
project: { id: string; name: string } | null;
|
||||
}>();
|
||||
@@ -37,6 +38,7 @@ watch(
|
||||
// window.location.origin
|
||||
iframeSrc.value =
|
||||
window.location.origin +
|
||||
// "http://192.168.1.128:4001" +
|
||||
`/zutai/?id=${newVal.id}&&name=${encodeURIComponent(
|
||||
newVal.name
|
||||
)}&&preview=true&&display=true&&graphicDisplay=wx#/preview`;
|
||||
@@ -50,17 +52,25 @@ watch(
|
||||
onMounted(() => {
|
||||
// 监听来自 eventStatistics 组件的消息
|
||||
window.addEventListener("message", handleMessage);
|
||||
|
||||
getActive({}).then((res: any) => {
|
||||
if (res.code == "A0000") {
|
||||
// window.location.origin
|
||||
iframeSrc.value =
|
||||
window.location.origin +
|
||||
// "http://192.168.1.128:4001" +
|
||||
`/zutai/?id=${res.data.id}&&name=${encodeURIComponent(
|
||||
res.data.name
|
||||
)}&&preview=true&&display=true&&graphicDisplay=wx#/preview`;
|
||||
}
|
||||
});
|
||||
// 子页面
|
||||
const iframe = document.getElementById("iframeLeft");
|
||||
|
||||
// 监听 iframe 加载完成事件
|
||||
iframe.addEventListener("load", function () {
|
||||
// 通知父页面:我已加载完毕
|
||||
store.dispatch("setIframeLoad", true);
|
||||
});
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -107,7 +117,6 @@ const sendKeysToIframe = (keyList: string[]) => {
|
||||
); // 在生产环境中应该指定具体的域名而不是 '*'
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.plan {
|
||||
|
||||
Reference in New Issue
Block a user