调度实训平台问题调整

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

View File

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

View File

@ -5,7 +5,7 @@
<template v-if="!dataError"> <template v-if="!dataError">
<el-button-group> <el-button-group>
<el-button v-if="isScheduling && isDepot" size="small" type="primary" @click="runPlanEditShow">运行图编辑</el-button> <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> <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" /> <add-quest ref="addQuest" @selectQuest="selectQuest" />
<run-plan-edit v-if="isScheduling && isDepot" ref="runPlanEdit" /> <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> </div>
</template> </template>
<script> <script>
@ -37,6 +37,7 @@ import { OperateMode } from '@/scripts/ConstDic';
import { getByGroupStationList } from '@/api/jmap/map'; import { getByGroupStationList } from '@/api/jmap/map';
import RunPlanEdit from './demon/runPlanEdit'; import RunPlanEdit from './demon/runPlanEdit';
import { getEveryDayRunPlanNew } from '@/api/simulation'; import { getEveryDayRunPlanNew } from '@/api/simulation';
import { getSessionStorage } from '@/utils/auth';
// //
export default { export default {
@ -83,6 +84,9 @@ export default {
isScript() { isScript() {
return this.$route.params.mode === 'script'; return this.$route.params.mode === 'script';
}, },
project() {
return getSessionStorage('project');
},
isContest() { isContest() {
return this.$route.params.mode === 'demon' && this.project == 'drts'; return this.$route.params.mode === 'demon' && this.project == 'drts';
}, },

View File

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