diff --git a/src/views/planMonitor/editTool/menus/modifyingStationIntervalTime.vue b/src/views/planMonitor/editTool/menus/modifyingStationIntervalTime.vue index 067d33101..62c3049ca 100644 --- a/src/views/planMonitor/editTool/menus/modifyingStationIntervalTime.vue +++ b/src/views/planMonitor/editTool/menus/modifyingStationIntervalTime.vue @@ -152,17 +152,17 @@ export default { this.$ConstSelect.DirectionCodeList.forEach(elem => { this.DirectionCodeMap[elem.value] = elem.label; }); - - this.stationIntervalData = []; if (this.$route.query.lineCode) { getMapStationRunUser(this.$route.query.mapId).then(resp =>{ const list = resp.data.list; + this.stationIntervalData = []; this.stationIntervalData = list; this.form.level1 = ''; this.form.level2 = ''; this.form.level3 = ''; this.form.level4 = ''; this.form.level5 = ''; + }); } }, @@ -192,10 +192,24 @@ export default { }, handleStationDistance() { updateRunlevelDistance(this.$route.query.mapId).then(resp => { - this.loadInitData(); + if (resp.data) { + const list = resp.data; + const stationIntervalData = []; + this.stationIntervalData.forEach(station=>{ + if (list[station.id]) { + const tempStation = Object.assign({}, station); + tempStation.distance = list[station.id]; + stationIntervalData.push(tempStation); + } + }); + this.stationIntervalData = stationIntervalData; + } else { + this.$messageBox('更新失败'); + } + this.$message.success('更新成功'); }).catch(() => { - this.$messageBox('更新失败'); + }); }, doShow(params) {