diff --git a/src/store/modules/runplan.js b/src/store/modules/runplan.js index f25d034d8..26055c105 100644 --- a/src/store/modules/runplan.js +++ b/src/store/modules/runplan.js @@ -123,7 +123,10 @@ const runPlan = { }, /** 设置stations数据 */ setStations: ({ commit }, mapModel) => { - commit('setStations', mapModel); + return new Promise((resolve) => { + commit('setStations', mapModel); + resolve(mapModel); + }); }, /** 重置运行图数据更新池 */ resetRunPlanData:({ commit }) => { diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 778caeb7b..c59924e25 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -2,9 +2,9 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 - // BASE_API = 'http://192.168.3.6:9000'; // 旭强 + BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.41:9000'; // 张赛 // BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://b29z135112.zicp.vip'; diff --git a/src/views/newMap/displayNew/demon/runPlanView.vue b/src/views/newMap/displayNew/demon/runPlanView.vue index a81f24251..7b5eee40b 100644 --- a/src/views/newMap/displayNew/demon/runPlanView.vue +++ b/src/views/newMap/displayNew/demon/runPlanView.vue @@ -203,7 +203,8 @@ export default { trainLabelPosition:0, updateCount: 0, op: null, - updateData: [] + updateData: [], + seriesMap: {} }; }, computed: { @@ -377,11 +378,15 @@ export default { async loadChartPage() { try { this.series = []; + this.seriesMap = {}; const stations = this.$store.state.runPlan.stations; const planData = this.$store.state.runPlan.planData; this.kmRangeCoordMap = this.PlanConvert.convertStationsToMap(stations); this.pushModels(this.series, [this.PlanConvert.initializeYaxis(stations)]); this.oldseries = this.pushModels(this.series, this.PlanConvert.convertDataToModels(planData, stations, this.kmRangeCoordMap, { color: '#000', width: 1 })); + this.oldseries.forEach(item => { + this.seriesMap[item.name] = item; + }); await this.analyticalServiceNumber(this.$store.state.runPlan.editData); } catch (error) { this.$messageBox(`加载运行图数据失败`); @@ -499,30 +504,50 @@ export default { op.series.splice(this.trainLabelPosition - 1, 1); this.myChart && this.myChart.setOption(op, true); } - this.oldseries.forEach((item, index) => { - if (item.name == serviceNumber && item.data) { - if (tripNumber) { - const temp = item.data.filter(elem => elem[3] == tripNumber); - if (temp.length) { - data = temp; - item.markPoint.data.forEach(each=>{ - if (each.name == temp[0][4]) { - markPoint = deepAssign({}, {data:[each]}); - markPoint.symbol = 'roundRect'; - markPoint.symbolSize = 1; - markPoint.data[0].label.color = '#f00'; - } - }); + if (tripNumber && this.seriesMap[serviceNumber]) { + const temp = this.seriesMap[serviceNumber].data.filter(elem => elem[3] == tripNumber); + if (temp.length) { + data = temp; + this.seriesMap[serviceNumber].markPoint.data.forEach(each=> { + if (each.name == temp[0][4]) { + markPoint = deepAssign({}, {data:[each]}); + markPoint.symbol = 'roundRect'; + markPoint.symbolSize = 1; + markPoint.data[0].label.color = '#f00'; } - } else { - markPoint = deepAssign({}, item.markPoint); - markPoint.data.forEach(each=>{ - each.label.color = '#f00'; - }); - data = item.data; - } + }); } - }); + } else if (this.seriesMap[serviceNumber]) { + markPoint = deepAssign({}, this.seriesMap[serviceNumber].markPoint); + markPoint.data.forEach(each => { + each.label.color = '#f00'; + }); + data = this.seriesMap[serviceNumber].data; + } + // this.oldseries.forEach((item, index) => { + // if (item.name == serviceNumber && item.data) { + // if (tripNumber) { + // const temp = item.data.filter(elem => elem[3] == tripNumber); + // if (temp.length) { + // data = temp; + // item.markPoint.data.forEach(each=>{ + // if (each.name == temp[0][4]) { + // markPoint = deepAssign({}, {data:[each]}); + // markPoint.symbol = 'roundRect'; + // markPoint.symbolSize = 1; + // markPoint.data[0].label.color = '#f00'; + // } + // }); + // } + // } else { + // markPoint = deepAssign({}, item.markPoint); + // markPoint.data.forEach(each=>{ + // each.label.color = '#f00'; + // }); + // data = item.data; + // } + // } + // }); op.series.push({ name: 'trainLabel', lineStyle: { diff --git a/src/views/newMap/displayNew/menuDemon.vue b/src/views/newMap/displayNew/menuDemon.vue index 75b52d4d8..5e882daa7 100644 --- a/src/views/newMap/displayNew/menuDemon.vue +++ b/src/views/newMap/displayNew/menuDemon.vue @@ -6,19 +6,18 @@ {{ $t('display.demon.trialTime') }} {{ countTime }} -