From 7328ac596a7e132063ec1dcedca69b09f73e80b5 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Fri, 22 Jul 2022 16:56:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E9=93=81=E7=BA=BF=E8=B7=AF=20?= =?UTF-8?q?=E5=89=A7=E6=9C=AC=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scriptDisplay/scriptRecord/index.vue | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/views/newMap/displayNew/scriptDisplay/scriptRecord/index.vue b/src/views/newMap/displayNew/scriptDisplay/scriptRecord/index.vue index 4bf75606e..dab8dcd91 100644 --- a/src/views/newMap/displayNew/scriptDisplay/scriptRecord/index.vue +++ b/src/views/newMap/displayNew/scriptDisplay/scriptRecord/index.vue @@ -121,6 +121,9 @@ export default { }, isDisable() { return this.$store.state.training.started; + }, + userId() { + return this.$store.state.user ? this.$store.state.user.id : ''; } }, watch: { @@ -165,9 +168,14 @@ export default { '$store.state.scriptRecord.userRole':function (val) { this.userRole = val; }, - '$store.state.training.roleDeviceCode':function (val) { - if (val) { - this.setShowStation(val); + // '$store.state.training.roleDeviceCode':function (val) { + // if (val) { + // this.setShowStation(val); + // } + // }, + '$store.state.socket.simulationRoleList':function(list) { + if (list && list.length) { // 人员变化监控 + this.checkRoleChange(list); } } @@ -210,6 +218,22 @@ export default { changeShowMap() { this.$emit('changeShowMap', false); }, + + checkRoleChange(data) { + data.forEach(item => { + if ((item.messageType === 'PLAY_CHANGE' || item.messageType === 'ONLINE' ) && item.userId == this.userId && item.type == 'STATION_SUPERVISOR') { + // this.userRole = item.type || 'AUDIENCE'; + this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode); + this.deviceCode = item.deviceCode; + this.setShowStation(item.deviceCode); + // this.setSimulationPrdType(this.centralizedStationMap[item.deviceCode]); + this.$nextTick(() => { + if (item.deviceCode && this.$store.state.training.prdType !== '09') { this.setCenter(item.deviceCode); } + }); + } + }); + }, + setShowStation(stationCode) { const showStation = this.centralizedStationMap[stationCode]; const list = [];