From 5bf8ffe9ac8c773da028dad25e684dd9a276c3ca Mon Sep 17 00:00:00 2001 From: fan <18706759286@163.com> Date: Thu, 28 Jan 2021 18:22:13 +0800 Subject: [PATCH] =?UTF-8?q?BUG=20149:=E6=B5=99=E5=A4=A7=E7=BD=91=E6=96=B0?= =?UTF-8?q?=EF=BC=9A=E7=8E=B0=E5=9C=B0=E4=BB=BF=E7=9C=9F=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=B8=AD=E8=BD=A6=E7=AB=99=E5=88=87=E6=8D=A2=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=9C=89=E8=AF=AF;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/displayNew/selectStation.vue | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/views/newMap/displayNew/selectStation.vue b/src/views/newMap/displayNew/selectStation.vue index 4a0b717ab..a5ebebab8 100644 --- a/src/views/newMap/displayNew/selectStation.vue +++ b/src/views/newMap/displayNew/selectStation.vue @@ -45,7 +45,7 @@ export default { EventBus.$on('switchStationMode', (stationCode) => { this.$store.state.training.memberList.filter(el => el.type == 'STATION_SUPERVISOR').find(el => { if (el.deviceCode == stationCode) { - this.oldShowMemberId = el.id; + this.oldShowMemberId = el.id; this.switchStationMode(el.id); } }); @@ -54,30 +54,30 @@ export default { methods:{ switchStationMode(val) { assignUsersPlayRoles([{ userId: this.$store.state.user.id, memberId: val}], this.$route.query.group).then(resp => { - this.showMemberId = val; - const nameList = Object.keys(this.$store.state.map.map||{}); + this.showMemberId = val; + const nameList = Object.keys(this.$store.state.map.map || {}); let list = []; const member = this.$store.state.training.memberData[val]; - const station = this.$store.getters['map/getDeviceByCode'](member.deviceCode); - if (station) { - this.showStation = station.code; - const showStationCode = this.stationCentralizedMap[station.code]; - nameList.forEach(item => { - if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) { - if (item === 'trainList') { - this.$store.state.map.map[item].forEach(elem => { - elem && list.push(elem); - }); - } else { - list = [...list, ...this.$store.state.map.map[item]]; - } - } - }); - this.$jlmap.updateShowStation(list, showStationCode); - this.setCenter(showStationCode); - } + const station = this.$store.getters['map/getDeviceByCode'](member.deviceCode); + if (station) { + this.showStation = station.code; + const showStationCode = this.stationCentralizedMap[station.code]; + nameList.forEach(item => { + if (this.$store.state.map.map[item] && this.$store.state.map.map[item].constructor === Array) { + if (item === 'trainList') { + this.$store.state.map.map[item].forEach(elem => { + elem && list.push(elem); + }); + } else { + list = [...list, ...this.$store.state.map.map[item]]; + } + } + }); + this.$jlmap.updateShowStation(list, showStationCode); + this.setCenter(showStationCode); + } }).catch((err) => { - console.log(err) + console.log(err); this.showMemberId = this.oldShowMemberId; this.$message.error('调整角色成员失败!'); }); @@ -89,16 +89,16 @@ export default { this.stationListMode = []; this.$store.state.training.memberList.forEach(item => { if (item.type === 'STATION_SUPERVISOR') { - const station = this.$store.getters['map/getDeviceByCode'](item.deviceCode); - if (station) { - this.stationListMode.push({value:item.id, name: station.name}); - } + const station = this.$store.getters['map/getDeviceByCode'](item.deviceCode); + if (station) { + this.stationListMode.push({value:item.id, name: station.name}); + } } }); }, initData() { this.$store.state.training.simulationUserList.forEach(item => { - if (item.userId == this.$store.state.user.id) { + if (item.type === 'STATION_SUPERVISOR' && item.userId == this.$store.state.user.id) { this.showMemberId = item.memberId; this.oldShowMemberId = item.memberId; }