diff --git a/src/views/components/StatusIcon/statusIcon.vue b/src/views/components/StatusIcon/statusIcon.vue index c8a6bd787..2a916e311 100644 --- a/src/views/components/StatusIcon/statusIcon.vue +++ b/src/views/components/StatusIcon/statusIcon.vue @@ -71,17 +71,20 @@ export default { const point = {}; point.x = e.clientX; point.y = e.clientY; + const stationList = []; if (this.$store.state.map.holdStandList.length) { this.menu = []; this.$store.state.map.holdStandList.forEach(item => { const stand = this.$store.getters['map/getDeviceByCode'](item); const station = this.$store.getters['map/getDeviceByCode'](stand.stationCode); - this.menu.push({ - label: station.name, - code: station.code, - handler: this.setCenter - }); - + if (stationList.indexOf(station.code) === -1) { + stationList.push(station.code); + this.menu.push({ + label: station.name, + code: station.code, + handler: this.setCenter + }); + } }); if (this.$refs && this.$refs.popMenu) { this.$refs.popMenu.resetShowPosition(point); @@ -94,14 +97,18 @@ export default { point.y = e.clientY; if (this.$store.state.map.jumpStandList.length) { this.menu = []; + const stationList = []; this.$store.state.map.jumpStandList.forEach(item => { const stand = this.$store.getters['map/getDeviceByCode'](item); const station = this.$store.getters['map/getDeviceByCode'](stand.stationCode); - this.menu.push({ - label: station.name, - code: station.code, - handler: this.setCenter - }); + if (stationList.indexOf(station.code) === -1) { + stationList.push(station.code); + this.menu.push({ + label: station.name, + code: station.code, + handler: this.setCenter + }); + } }); if (this.$refs && this.$refs.popMenu) { this.$refs.popMenu.resetShowPosition(point);