退出iscs工作站清理仿真

This commit is contained in:
fan 2020-08-13 09:22:31 +08:00
parent f4f1b8792d
commit 066340930f

View File

@ -35,6 +35,7 @@ import merge from 'webpack-merge';
import { getToken } from '@/utils/auth';
import { getSessionStorage } from '@/utils/auth';
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
import { clearSimulation } from '@/api/simulation';
export default {
data() {
return {
@ -268,7 +269,8 @@ export default {
]
}
],
stationList: []
stationList: [],
firstBack: false
};
},
computed: {
@ -283,12 +285,12 @@ export default {
'$store.state.socket.simulationRoleList':function(val) {
(val || []).forEach(item => {
if (item.messageType === 'KICK_OUT' && item.userId == this.$store.state.user.id) {
this.back();
!this.firstBack && this.back();
}
});
},
'$store.state.socket.simulationOver':function(val) {
this.back();
!this.firstBack && this.back();
}
},
async created () {
@ -388,12 +390,17 @@ export default {
this.$router.push({ path: `/displayIscs/system/config/${this.type}`, query: query });
},
back() {
this.firstBack = true;
if (this.projectDevice) {
this.$store.dispatch('LogOut').then(() => {
location.reload();
});
} else {
this.$router.push({ path: `/trainingPlatform` });
clearSimulation(this.$route.query.group).then(resp => {
this.$router.push({ path: `/trainingPlatform` });
}).catch(()=> {
this.$message.error('清除仿真失败!');
});
}
},
changeCurrentSystem() {