This commit is contained in:
fan 2021-06-16 16:55:49 +08:00
commit c574f0249c
2 changed files with 28 additions and 17 deletions

View File

@ -25,7 +25,7 @@
/>
</el-select>
</div>
<div class="back-box" @click="back">{{ projectDevice? '退出': '返回主页面' }}</div>
<div v-if="!projectDevice" class="back-box" @click="back">返回主页面</div>
</div>
</template>
@ -416,17 +416,17 @@ export default {
back() {
this.firstBack = true;
this.clearSubscribe();
if (this.projectDevice) {
this.$store.dispatch('LogOut').then(() => {
location.reload();
});
} else {
clearSimulation(this.$route.query.group).then(resp => {
this.$router.push({ path: `/trainingPlatform` });
}).catch(()=> {
this.$message.error('清除仿真失败!');
});
}
// if (this.projectDevice) {
// this.$store.dispatch('LogOut').then(() => {
// location.reload();
// });
// } else {
clearSimulation(this.$route.query.group).then(resp => {
this.$router.push({ path: `/trainingPlatform` });
}).catch(()=> {
this.$message.error('清除仿真失败!');
});
// }
},
changeCurrentSystem() {
this.$router.push({

View File

@ -342,16 +342,27 @@ export default {
async back() {
this.isGoback = true;
if (this.projectDevice) {
// || this.project === 'bjd'
clearSimulation(this.group).then(res=>{
if (this.$route.query.type == 'IM') {
clearSimulation(this.group).then(res=>{
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('LogOut').then(() => {
// this.$store.dispatch('training/reset');
// this.$store.dispatch('map/mapClear');
location.reload();
});
});
});
} else {
this.$store.dispatch('training/over').then(() => {
this.$store.dispatch('LogOut').then(() => {
// this.$store.dispatch('training/reset');
// this.$store.dispatch('map/mapClear');
// this.$store.dispatch('training/reset');
// this.$store.dispatch('map/mapClear');
location.reload();
});
});
});
}
// || this.project === 'bjd'
} else {
if (this.project === 'bjd') {
window.close();