diff --git a/src/views/newMap/displayNew/index.vue b/src/views/newMap/displayNew/index.vue index 9c15c91eb..8bff0852b 100644 --- a/src/views/newMap/displayNew/index.vue +++ b/src/views/newMap/displayNew/index.vue @@ -4,26 +4,10 @@ - - - + @@ -35,12 +19,11 @@ import { getSessionStorage } from '@/utils/auth'; import { mapGetters } from 'vuex'; import { OperateMode } from '@/scripts/ConstDic'; import { timeFormat } from '@/utils/date'; -import MapSystemDraft from '@/views/newMap/mapsystemNew/index'; -import StatusIcon from '@/views/components/StatusIcon/statusIcon'; -import MenuDemon from '@/views/newMap/displayNew/menuDemon'; -import MenuExam from './exam/index'; +import MapSystemDraft from '@/views/newMap/mapsystemNew/index'; import MenuLesson from './lesson/index'; +import MenuDemon from './menuDemon'; +import MenuExam from './exam/index'; import MenuScript from './scriptDisplay/scriptRecord/index'; import MenuDispatherContest from './dispatherContest/index'; @@ -50,11 +33,11 @@ import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime'; import { clearSimulation, getSimulationInfoNew } from '@/api/simulation'; import { loadNewMapDataByGroup } from '@/utils/loaddata'; import { EventBus } from '@/scripts/event-bus'; + export default { name: 'DisplayDraft', components: { MapSystemDraft, - StatusIcon, MenuDemon, MenuExam, MenuLesson, @@ -99,9 +82,6 @@ export default { isScript() { return this.mode === 'script'; }, - isPractice() { - return this.mode === 'practice'; - }, mapId() { return this.$route.query.mapId; }, @@ -140,12 +120,11 @@ export default { } }, beforeDestroy() { - this.quit(this.group); + clearSimulation(this.group); this.$store.dispatch('training/reset'); this.$store.dispatch('map/mapClear'); }, async mounted() { - this.setWindowSize(); this.initLoadData(); }, methods:{ @@ -158,11 +137,6 @@ export default { EventBus.$emit('viewLoading', false); }); }, - // 销毁仿真 - quit(group) { - clearSimulation(group); - this.$store.dispatch('training/over'); - }, // 仿真错误时,被动退出时调用 async back() { if (this.isExam) { @@ -227,18 +201,19 @@ export default { // 新版地图根据仿真group获取仿真基础信息 async loadSimulationInfo() { const resp = await getSimulationInfoNew(this.group); - if (resp && resp.code == 200 && resp.data && !resp.data.dataError) { - this.dataError = false; - this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); // 是否暂停判断 - this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`)); - this.$store.dispatch('training/countTime'); - this.planRunning = resp.data.planRunning; - if (resp.data.planRunning) { - this.$store.commit('training/start'); + if (resp && resp.code == 200 && resp.data) { + if (!resp.data.dataError) { + this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); // 是否暂停判断 + this.$store.dispatch('training/setInitTime', +new Date(`${new Date().toLocaleDateString()} ${timeFormat(resp.data.systemTime)}`)); + this.$store.dispatch('training/countTime'); + this.planRunning = resp.data.planRunning; + if (resp.data.planRunning) { + this.$store.commit('training/start'); + } + } else { + this.$messageBox('此地图数据正在维护中,无法运行!'); } - } else if (resp && resp.code == 200 && resp.data && resp.data.dataError) { - this.dataError = true; - this.$messageBox('此地图数据正在维护中,无法运行!'); + this.dataError = resp.data.dataError; } }, // 加载地图数据 diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue index b48b9eccf..767399fa4 100644 --- a/src/views/newMap/displayNew/menuDemon.vue +++ b/src/views/newMap/displayNew/menuDemon.vue @@ -1,5 +1,6 @@