From 246f204eb7b8a1e21d498421e1b34f0ccda7643b Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 26 Jul 2022 16:30:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/newMap/displayNew/menuSchema.vue | 8 ++++++-- .../scriptDisplay/scriptRecord/index.vue | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/views/newMap/displayNew/menuSchema.vue b/src/views/newMap/displayNew/menuSchema.vue index c51b0f211..6b99b6028 100644 --- a/src/views/newMap/displayNew/menuSchema.vue +++ b/src/views/newMap/displayNew/menuSchema.vue @@ -306,8 +306,10 @@ export default { this.$refs.registerBook.doShow(); }, checkRoleInit(data) { + const stationRoleList = ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'STATION_MASTER', 'STATION_SIGNALER', + 'STATION_PASSENGER', 'STATION_SWITCH_MAN', 'STATION_FACILITATOR', 'STATION_WORKER', 'DEVICE_MANAGER']; data.forEach(item => { - if ((item.admin && item.online) && item.userId == this.userId && item.type == 'STATION_SUPERVISOR') { + if ((item.admin && item.online) && item.userId == this.userId && stationRoleList.includes(item.type)) { this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode); this.deviceCode = item.deviceCode; this.setShowStation(item.deviceCode); @@ -316,8 +318,10 @@ export default { }); }, checkRoleChange(data) { + const stationRoleList = ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'STATION_MASTER', 'STATION_SIGNALER', + 'STATION_PASSENGER', 'STATION_SWITCH_MAN', 'STATION_FACILITATOR', 'STATION_WORKER', 'DEVICE_MANAGER']; data.forEach(item => { - if ((item.messageType === 'PLAY_CHANGE' || item.messageType === 'ONLINE' ) && item.userId == this.userId && item.type == 'STATION_SUPERVISOR') { + if ((item.messageType === 'PLAY_CHANGE' || item.messageType === 'ONLINE' ) && item.userId == this.userId && stationRoleList.includes(item.type)) { // this.userRole = item.type || 'AUDIENCE'; this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode); this.deviceCode = item.deviceCode; diff --git a/src/views/newMap/displayNew/scriptDisplay/scriptRecord/index.vue b/src/views/newMap/displayNew/scriptDisplay/scriptRecord/index.vue index 3e73c46c3..a9fb99ad7 100644 --- a/src/views/newMap/displayNew/scriptDisplay/scriptRecord/index.vue +++ b/src/views/newMap/displayNew/scriptDisplay/scriptRecord/index.vue @@ -222,13 +222,22 @@ export default { }, checkRoleChange(data) { + const stationRoleList = ['STATION_SUPERVISOR', 'STATION_ASSISTANT', 'STATION_MASTER', 'STATION_SIGNALER', + 'STATION_PASSENGER', 'STATION_SWITCH_MAN', 'STATION_FACILITATOR', 'STATION_WORKER', 'DEVICE_MANAGER']; data.forEach(item => { - if ((item.messageType === 'PLAY_CHANGE' || item.messageType === 'ONLINE' ) && item.userId == this.userId && item.type == 'STATION_SUPERVISOR') { + if ((item.messageType === 'PLAY_CHANGE' || item.messageType === 'ONLINE' ) && item.userId == this.userId && (stationRoleList.includes(item.type) )) { // this.userRole = item.type || 'AUDIENCE'; this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode); this.deviceCode = item.deviceCode; - this.setShowStation(item.deviceCode); - this.$store.dispatch('training/setPrdType', '01'); + + if (item.type == 'STATION_SUPERVISOR' || item.type == 'STATION_SIGNALER') { + this.setShowStation(item.deviceCode); + this.$store.dispatch('training/setPrdType', '01'); + } else { + const showStation = this.centralizedStationMap[item.deviceCode]; + this.setShowStation(''); + this.$jlmap.setCenter(showStation); + } // this.setSimulationPrdType(this.centralizedStationMap[item.deviceCode]); // this.$nextTick(() => { // if (item.deviceCode && this.$store.state.training.prdType !== '09') { this.setCenter(item.deviceCode); }