电子沙盘界面添加退出和消息监听

This commit is contained in:
fan 2020-08-04 13:30:42 +08:00
parent 9a4591effd
commit 8096076be3
4 changed files with 758 additions and 745 deletions

File diff suppressed because it is too large Load Diff

View File

@ -80,6 +80,11 @@ export default {
token:null
};
},
watch: {
'$store.state.socket.simulationOver':function(val) {
this.back();
}
},
beforeDestroy() {
// console.log("destroy");
if (this.jlmap3d) {
@ -183,7 +188,15 @@ export default {
},
back() {
window.close();
if (this.$route.query.projectDevice) {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('LogOut').then(() => {
location.reload();
});
});
} else {
window.close();
}
// this.$emit('showpanel');
// this.jlmap3d.eventoff();
// this.jlmap3d.animateoff();

View File

@ -475,7 +475,9 @@ export default {
mapid: query.mapId,
group: query.group,
project: getSessionStorage('project'),
token: getToken()
token: getToken(),
projectDevice: this.$route.query.projectDevice,
type: this.$route.query.type
};
this.$router.push({ path: `/jlmap3d/sandbox`, query: sandboxQuery });
} else {

View File

@ -721,6 +721,10 @@ function timedCount() {
postMessage(data);
return;
}
if (data.type == 'Simulation_Over') {
postMessage(data);
return;
}
if ( data.body.length > 300) {
// console.log(data);
postMessage(data);