宁波一综合演练现地设置显示站

This commit is contained in:
fan 2020-05-19 13:41:48 +08:00
parent 6afafc9371
commit cc3f117a8f
2 changed files with 19 additions and 5 deletions

View File

@ -50,6 +50,7 @@ import { EventBus } from '@/scripts/event-bus';
import ibpData from '@/ibp/constant/ibpData'; import ibpData from '@/ibp/constant/ibpData';
import { timeFormat } from '@/utils/date'; import { timeFormat } from '@/utils/date';
import { Message } from 'element-ui'; import { Message } from 'element-ui';
import Vue from 'vue';
export default { export default {
name: 'JointTrainingDraft', name: 'JointTrainingDraft',
@ -126,17 +127,17 @@ export default {
this.setPosition(); this.setPosition();
if (val === '01' && this.$route.query.lineCode === '06') { if (val === '01' && this.$route.query.lineCode === '06') {
this.showSelectStation = true; this.showSelectStation = true;
this.mapViewLoadedOver && this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation); this.mapViewLoadedOver && this.setShowStation(this.showStation);
} else if (val === '02' && this.$route.query.lineCode === '06') { } else if (val === '02' && this.$route.query.lineCode === '06') {
this.showSelectStation = false; this.showSelectStation = false;
this.mapViewLoadedOver && this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(''); this.mapViewLoadedOver && this.setShowStation('');
} }
}, },
'$store.state.map.mapViewLoadedCount': function (val) { '$store.state.map.mapViewLoadedCount': function (val) {
this.mapBoxP = document.getElementById(this.canvasId).children[0]; this.mapBoxP = document.getElementById(this.canvasId).children[0];
this.mapBoxP.style.cursor = ''; this.mapBoxP.style.cursor = '';
this.mapViewLoadedOver = true; this.mapViewLoadedOver = true;
this.showSelectStation && this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation); this.showSelectStation && this.setShowStation(this.showStation);
}, },
'$store.state.socket.permissionOver': function () { '$store.state.socket.permissionOver': function () {
this.$alert(this.$t('tip.userRightsHaveBeenReclaimed'), this.$t('tip.hint'), { this.$alert(this.$t('tip.userRightsHaveBeenReclaimed'), this.$t('tip.hint'), {
@ -436,7 +437,18 @@ export default {
}, },
switchStationMode(val) { switchStationMode(val) {
this.showStation = val; this.showStation = val;
this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(this.showStation); this.setShowStation(this.showStation);
},
setShowStation(val) {
const nameList = Object.keys(this.$store.state.map.map);
let list = [];
nameList.forEach(item => {
if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) {
list = [...list, ...this.$store.state.map.map[item]];
}
});
Vue.prototype.$jlmap.updateShowStation(list, val);
Vue.prototype.$jlmap.setCenter(val);
}, },
setStationList(val) { setStationList(val) {
this.stationList = []; this.stationList = [];

View File

@ -10,7 +10,7 @@
> >
<el-option v-for="item in swchList" :key="item.value" :label="item.name" :value="item.value" /> <el-option v-for="item in swchList" :key="item.value" :label="item.name" :value="item.value" />
</el-select> </el-select>
<el-select v-if="showSelectStation" v-model="showStation" style="width: 100px;" size="small" @change="switchStationMode"> <el-select v-if="showSelectStation" v-model="chiShowStation" style="width: 100px;" size="small" @change="switchStationMode">
<el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" /> <el-option v-for="item in stationList" :key="item.value" :label="item.name" :value="item.value" />
</el-select> </el-select>
<el-button-group> <el-button-group>
@ -91,6 +91,7 @@ export default {
viewDisabled: true, viewDisabled: true,
realData: {}, realData: {},
series: [], series: [],
chiShowStation: '',
kmRangeCoordMap: {}, kmRangeCoordMap: {},
runPlanData: {}, runPlanData: {},
swch: '02', swch: '02',
@ -156,6 +157,7 @@ export default {
}); });
}, },
switchMode(swch) { switchMode(swch) {
this.chiShowStation = this.showStation;
this.$store.dispatch('training/setPrdType', swch); this.$store.dispatch('training/setPrdType', swch);
}, },
initPlannedDriving(isDisable) { initPlannedDriving(isDisable) {