仿真代码调整

This commit is contained in:
joylink_cuiweidong 2020-11-09 15:17:11 +08:00
parent e9c65e5ba3
commit 8d14c93231
3 changed files with 22 additions and 50 deletions

View File

@ -4,26 +4,10 @@
<transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<status-icon v-if="($route.query.lineCode == '11' || $route.query.lineCode == '10') && isDemon" ref="statusIcon" />
<menu-demon v-if="isDemon" ref="menuDemon" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" />
<menu-lesson v-if="isLesson" ref="lessonMenu" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom" :tip-bottom="tipBottom" />
<menu-exam v-if="isExam" ref="menuExam" :offset="offset" :data-error="dataError" :offset-bottom="offsetBottom" />
<menu-script
v-if="isScript"
ref="menuScript"
:offset-bottom="offsetBottom"
:offset="offset"
:project="project"
:text-status-height="textStatusHeight"
:data-error="dataError"
/>
<menu-practice
v-if="isPractice"
ref="menuPractice"
:offset="offset"
:offset-bottom="offsetBottom"
:data-error="dataError"
/>
<menu-script v-if="isScript" ref="menuScript" :offset-bottom="offsetBottom" :offset="offset" :text-status-height="textStatusHeight" :data-error="dataError" />
<menu-dispather-contest v-if="isContest" ref="menuDispatherContest" :offset="offset" :offset-bottom="offsetBottom" :data-error="dataError" :text-status-height="textStatusHeight" />
</template>
<menu-train-list v-if="isDemon||isContest||isScript" @setCenter="setCenter" />
@ -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;
}
},
//

View File

@ -1,5 +1,6 @@
<template>
<div>
<status-icon v-if="$route.query.lineCode == '11' || $route.query.lineCode == '10'" ref="statusIcon" />
<demon-chat ref="chatbox" :group="group" :user-role="userRole" :offset="offset" />
<div class="display-card" :style="{top: offset+'px'}">
<el-row>
@ -63,6 +64,7 @@ import { TrainingMode } from '@/scripts/ConstDic';
import { quitScriptNew } from '@/api/simulation';
import { setGoodsTryUse } from '@/api/management/goods';
import {loadScriptNew } from '@/api/simulation';
import StatusIcon from '@/views/components/StatusIcon/statusIcon';
import Vue from 'vue';
import { EventBus } from '@/scripts/event-bus';
@ -72,7 +74,8 @@ export default {
SetTime,
DemonChat,
MenuSchema,
DemonMenu
DemonMenu,
StatusIcon
},
props: {
offset: {

View File

@ -88,12 +88,6 @@ export default {
default() {
return 0;
}
},
project:{
type: String,
default() {
return '';
}
}
},
data() {