增加与模型之间的交互
This commit is contained in:
parent
d7b4da8962
commit
ad67a446e3
|
|
@ -5,12 +5,11 @@
|
|||
<Kongtiao v-if="tagId === '空调'" @close="close" />
|
||||
<shexiangtou v-if="tagId === '枪式摄像机'" @close="close"></shexiangtou>
|
||||
<Light v-if="tagId === '照明'" @close="close" />
|
||||
<Device v-if="tagId === '设备'" @close="close" />
|
||||
<Menjin v-if="tagId === '门禁'" @close="close" />
|
||||
<Device v-if="tagId === '设备'" @close="close" />
|
||||
<Menjin v-if="tagId === '门禁'" @close="close" />
|
||||
<GaoJing v-if="tagId === '告警'" @close="close" />
|
||||
|
||||
|
||||
<!--
|
||||
<!--
|
||||
<SongFeng v-if="objectID === 'songfeng'" @close="close" />
|
||||
|
||||
<GaoJing v-if="tagId === '告警'" @close="close" />
|
||||
|
|
@ -38,7 +37,6 @@ import Device from "./children/device.vue";
|
|||
import Light from "./children/light.vue";
|
||||
import GaoJing from "./children/GaoJing.vue";
|
||||
|
||||
|
||||
// import Face from "../dialog/children/Face";
|
||||
// import Huiyi from "./children/Huiyi.vue";
|
||||
// import Gongwei from "./children/Gongwei";
|
||||
|
|
@ -51,7 +49,7 @@ import GaoJing from "./children/GaoJing.vue";
|
|||
// import Zhaji from "./children/Zhaji.vue";
|
||||
// import HaoNeng from "./children/HaoNeng.vue";
|
||||
|
||||
import {mapMutations, mapState} from "vuex";
|
||||
import { mapMutations, mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "Dialog",
|
||||
|
|
@ -61,7 +59,15 @@ export default {
|
|||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState(["tagId", "objectID", "Id", "timer", "infoTree","infoId","infoName"]),
|
||||
...mapState([
|
||||
"tagId",
|
||||
"objectID",
|
||||
"Id",
|
||||
"timer",
|
||||
"infoTree",
|
||||
"infoId",
|
||||
"infoName",
|
||||
]),
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
|
|
@ -81,13 +87,15 @@ export default {
|
|||
this.screenPosition1 = this.$store.state.screenPosition;
|
||||
console.log(this.screenPosition1);
|
||||
document.getElementsByClassName("dialog")[0].style.position = absolute;
|
||||
document.getElementsByClassName("dialog")[0].style.top = this.screenPosition1[1] + "px";
|
||||
document.getElementsByClassName("dialog")[0].style.left = this.screenPosition1[0] + "px";
|
||||
document.getElementsByClassName("dialog")[0].style.top =
|
||||
this.screenPosition1[1] + "px";
|
||||
document.getElementsByClassName("dialog")[0].style.left =
|
||||
this.screenPosition1[0] + "px";
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// let a = docum
|
||||
console.log(this.$store.state.tagId)
|
||||
console.log(this.$store.state.tagId);
|
||||
},
|
||||
beforeDestroy() {},
|
||||
components: {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,13 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
// this.initInterface();
|
||||
|
||||
window.addEventListener("message", this.handleIframeMessage); // 监听子页面发送的消息
|
||||
},
|
||||
|
||||
// 在组件销毁前移除监听
|
||||
beforeDestroy() {
|
||||
window.removeEventListener("message", this.handleIframeMessage);
|
||||
},
|
||||
destroyed() {
|
||||
// this.aircityPlayer && this.aircityPlayer.destroy();
|
||||
|
|
@ -245,6 +252,20 @@ export default {
|
|||
console.warn("iframe not ready");
|
||||
}
|
||||
},
|
||||
|
||||
// 监听子页面消息
|
||||
handleIframeMessage(event) {
|
||||
console.log(event, "event");
|
||||
// if (event.origin !== "http://192.168.0.90:8888/#/fullScreen") {
|
||||
// return; // 如果不是预期的来源,忽略消息
|
||||
// }
|
||||
|
||||
const message = event.data;
|
||||
console.log(
|
||||
"Received message from iframe:接收的子页面传递的消息",
|
||||
message
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue