调度实训平台问题调整

This commit is contained in:
fan 2020-08-26 14:08:50 +08:00
parent c1f139e9a8
commit 8d35c1353f
4 changed files with 16 additions and 14 deletions

View File

@ -144,7 +144,6 @@ export default {
this.$store.dispatch('map/mapClear');
},
async mounted() {
this.group = this.$route.query.group;
this.setWindowSize();
this.initLoadData();
},
@ -217,6 +216,7 @@ export default {
},
//
initLoadData() {
this.group = this.$route.query.group;
this.$store.dispatch('training/reset');
this.loadSimulationInfo();
this.loadMapData();

View File

@ -57,7 +57,6 @@
import SetTime from './demon/setTime';
import DemonMenu from './demonMenu';
import DemonChat from './demonChat';
import { Notification } from 'element-ui';
import MenuSchema from '@/views/newMap/displayNew/menuSchema';
import { getGoodsTryUse } from '@/api/management/goods';
import { ranAsPlan, exitRunPlan, clearSimulation, getSimulationInfoNew } from '@/api/simulation';
@ -156,9 +155,9 @@ export default {
}
});
},
'$store.state.socket.simulationOver':function(val) {
!this.isGoback && this.back();
},
// '$store.state.socket.simulationOver':function(val) {
// !this.isGoback && this.back();
// },
// '$store.state.training.started': function (val) {
// this.setRuning(val);
// },
@ -258,7 +257,8 @@ export default {
this.$store.dispatch('map/mapClear');
this.$store.dispatch('training/setPrdType', this.currentPrdType); // prdType
query.group = resp.data;
this.$router.replace({query: query});
const newQuery = Object.assign({}, query);
this.$router.replace({query: newQuery});
launchFullscreen();
}).catch(error => {
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);

View File

@ -5,7 +5,7 @@
<template v-if="!dataError">
<el-button-group>
<el-button v-if="isScheduling && isDepot" size="small" type="primary" @click="runPlanEditShow">运行图编辑</el-button>
<el-button v-if="isContest && !isScheduling" size="small" :disabled="viewDisabled" type="primary" @click="viewChangeMap">切换地图</el-button>
<el-button v-if="isContest" size="small" :disabled="viewDisabled" type="primary" @click="viewChangeMap">切换地图</el-button>
<!-- 加载剧本 -->
<el-button v-if="isDemon && !isScheduling" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">{{ $t('display.schema.loadScript') }}</el-button>
<!-- 运行图加载 -->
@ -23,7 +23,7 @@
<!-- 加载剧本列表弹窗 -->
<add-quest ref="addQuest" @selectQuest="selectQuest" />
<run-plan-edit v-if="isScheduling && isDepot" ref="runPlanEdit" />
<change-map v-if="isContest && !isScheduling" ref="changeMap" @changeMap="changeMap" />
<change-map v-if="isContest" ref="changeMap" @changeMap="changeMap" />
</div>
</template>
<script>
@ -37,6 +37,7 @@ import { OperateMode } from '@/scripts/ConstDic';
import { getByGroupStationList } from '@/api/jmap/map';
import RunPlanEdit from './demon/runPlanEdit';
import { getEveryDayRunPlanNew } from '@/api/simulation';
import { getSessionStorage } from '@/utils/auth';
//
export default {
@ -83,6 +84,9 @@ export default {
isScript() {
return this.$route.params.mode === 'script';
},
project() {
return getSessionStorage('project');
},
isContest() {
return this.$route.params.mode === 'demon' && this.project == 'drts';
},

View File

@ -26,8 +26,7 @@ export default {
mouseNum: 1,
mouseNumTime: 0,
mapBoxP: null,
mode: '',
group: ''
mode: ''
};
},
computed: {
@ -58,7 +57,6 @@ export default {
mounted() {
window.onbeforeunload = this.clearSubscribe;
this.mode = this.$route.params.mode || '';
this.group = this.$route.query.group || '';
this.currentMap = this.$refs.mapCommon;
this.checkLoginLineTimer(); //
this.checkMouseStatusTimer(); //
@ -96,13 +94,13 @@ export default {
},
async subscribe() {
this.clearSubscribe();
const header = { group: this.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.group}`, header);
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.group}`);
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
},
setCenter(code) {
this.$refs.mapCommon && this.$refs.mapCommon.setCenter(code);