72 lines
1.5 KiB
Vue
72 lines
1.5 KiB
Vue
<template>
|
||
<div id="app"> <router-view /> </div>
|
||
</template>
|
||
<script>
|
||
import autofit from "autofit.js";
|
||
export default {
|
||
data() {
|
||
return {};
|
||
},
|
||
mounted() {
|
||
autofit.init(
|
||
{
|
||
dh: 3240,
|
||
dw: 7680,
|
||
el: "#app",
|
||
resize: true,
|
||
},
|
||
false
|
||
);
|
||
|
||
if (window.vuplex) {
|
||
this.addMessageListener();
|
||
} else {
|
||
window.addEventListener("vuplexready", this.addMessageListener);
|
||
}
|
||
},
|
||
methods: {
|
||
addMessageListener() {
|
||
let that = this;
|
||
window.vuplex.addEventListener("message", function (event) {
|
||
if (that.$route.path == "/area/nyjcd/pds") {
|
||
let json = event.data;
|
||
if (json == "无操作标识") {
|
||
that.$store.commit("SetNoOperation", json);
|
||
} else {
|
||
that.$store.commit("SetNoOperation", "无操作标识");
|
||
}
|
||
that.$router.push({
|
||
name: "pds1",
|
||
query: {
|
||
type: json,
|
||
},
|
||
});
|
||
}
|
||
});
|
||
},
|
||
},
|
||
beforeDestroy() {
|
||
autofit.off();
|
||
},
|
||
};
|
||
</script>
|
||
<style>
|
||
* {
|
||
margin: 0;
|
||
padding: 0;
|
||
font-family: "MicrosoftYaHei" !important;
|
||
background: transparent;
|
||
}
|
||
|
||
#app {
|
||
/* width: 7680px;
|
||
height: 3240px; */
|
||
width: 100vw;
|
||
height: 100vh;
|
||
overflow: hidden;
|
||
/* background-image: url(./assets/img/左遮罩.png), url(./assets/img/右遮罩.png),
|
||
url(./assets/img/遮罩上.png), url(./assets/img/下遮罩.png); */
|
||
/* background: #fff; */
|
||
}
|
||
</style>
|