This commit is contained in:
unknown 2023-12-08 17:54:15 +08:00
commit 360ece6eb7
4 changed files with 60 additions and 14 deletions

View File

@ -15,13 +15,20 @@ export default {
addMessageListener() {
let that = this;
window.vuplex.addEventListener("message", function (event) {
let json = event.data;
that.$router.push({
name: "pds1",
query: {
type: json,
},
});
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,
},
});
}
});
},
},

View File

@ -4,9 +4,15 @@ import Vuex from "vuex";
Vue.use(Vuex);
export default new Vuex.Store({
state: {},
state: {
NoOperation: "",
},
getters: {},
mutations: {},
mutations: {
SetNoOperation(state, a) {
state.NoOperation = a;
},
},
actions: {},
modules: {},
});

View File

@ -120,7 +120,7 @@
alt=""
class="img1"
@click="
this.sendMessageToCSharp({
sendMessageToCSharp({
type: 'video',
message: '余热发电动画',
})
@ -140,7 +140,7 @@
alt=""
class="img1"
@click="
this.sendMessageToCSharp({
sendMessageToCSharp({
type: 'video',
message: '垃圾发电动画',
})

View File

@ -26,7 +26,10 @@
</div>
</div>
</div>
<img src="../../assets/img/pdsbg.png" alt="" class="bgt" />
<img src="../../assets/img/pdsbg.png" v-if="falg" alt="" class="bgt" />
<div class="boxLeft" v-if="falg"></div>
<div class="boxRight" v-if="falg"></div>
</div>
</template>
<script>
@ -38,12 +41,23 @@ export default {
arr: [],
list: [],
res: "",
falg: false,
};
},
created() {
this.getList(this.$route.query.type);
this.changeArr(this.$route.query.type);
},
watch: {
//
"$store.state.NoOperation": {
handler(newValue, oldValue) {
if (newValue == "无操作标识") {
this.$router.push("/");
}
},
},
},
methods: {
initViewer() {
this.viewer = new Viewer(this.$el, {
@ -80,6 +94,7 @@ export default {
this.list = list;
},
sendMessageToCSharp(name) {
this.falg = true;
let that = this;
window.vuplex.postMessage({
type: that.$route.query.type,
@ -211,6 +226,7 @@ export default {
this.initViewer();
},
beforeDestroy() {
this.falg = false;
if (this.viewer) {
this.viewer.destroy();
}
@ -227,6 +243,7 @@ export default {
background-color: transparent;
background-image: url(../../assets/img/左遮罩.png);
justify-content: space-between;
position: relative;
.left {
width: 1237px;
@ -328,9 +345,25 @@ export default {
width: 317px;
height: 485px;
position: absolute;
left: 52.5%;
top: 50%;
left: 52%;
top: 75%;
// border: 2px solid #20d6fe;
transform: translate(50%, -50%);
}
.boxLeft {
width: 1089px;
height: 1468px;
background-color: red;
position: absolute;
left: 2237px;
top: 1200px;
}
.boxRight {
width: 1089px;
height: 1317px;
background-color: red;
position: absolute;
left: 5400px;
top: 1200px;
}
</style>