From cc3f117a8fd8eb93f3ca212322764aec2ff5f61a Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Tue, 19 May 2020 13:41:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=81=E6=B3=A2=E4=B8=80=E7=BB=BC=E5=90=88?= =?UTF-8?q?=E6=BC=94=E7=BB=83=E7=8E=B0=E5=9C=B0=E8=AE=BE=E7=BD=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/jointTrainingNew/index.vue | 20 +++++++++++++++---- .../newMap/jointTrainingNew/menuSchema.vue | 4 +++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/views/newMap/jointTrainingNew/index.vue b/src/views/newMap/jointTrainingNew/index.vue index 9f4c980ff..d8e45b8f1 100644 --- a/src/views/newMap/jointTrainingNew/index.vue +++ b/src/views/newMap/jointTrainingNew/index.vue @@ -50,6 +50,7 @@ import { EventBus } from '@/scripts/event-bus'; import ibpData from '@/ibp/constant/ibpData'; import { timeFormat } from '@/utils/date'; import { Message } from 'element-ui'; +import Vue from 'vue'; export default { name: 'JointTrainingDraft', @@ -126,17 +127,17 @@ export default { this.setPosition(); if (val === '01' && this.$route.query.lineCode === '06') { 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') { this.showSelectStation = false; - this.mapViewLoadedOver && this.$refs.mapCanvas && this.$refs.mapCanvas.setShowStation(''); + this.mapViewLoadedOver && this.setShowStation(''); } }, '$store.state.map.mapViewLoadedCount': function (val) { this.mapBoxP = document.getElementById(this.canvasId).children[0]; this.mapBoxP.style.cursor = ''; 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 () { this.$alert(this.$t('tip.userRightsHaveBeenReclaimed'), this.$t('tip.hint'), { @@ -436,7 +437,18 @@ export default { }, switchStationMode(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) { this.stationList = []; diff --git a/src/views/newMap/jointTrainingNew/menuSchema.vue b/src/views/newMap/jointTrainingNew/menuSchema.vue index eecb13afc..692dc1cb8 100644 --- a/src/views/newMap/jointTrainingNew/menuSchema.vue +++ b/src/views/newMap/jointTrainingNew/menuSchema.vue @@ -10,7 +10,7 @@ > - + @@ -91,6 +91,7 @@ export default { viewDisabled: true, realData: {}, series: [], + chiShowStation: '', kmRangeCoordMap: {}, runPlanData: {}, swch: '02', @@ -156,6 +157,7 @@ export default { }); }, switchMode(swch) { + this.chiShowStation = this.showStation; this.$store.dispatch('training/setPrdType', swch); }, initPlannedDriving(isDisable) {