代码调整

This commit is contained in:
joylink_cuiweidong 2022-07-26 16:30:48 +08:00
parent d79e95425b
commit 246f204eb7
2 changed files with 18 additions and 5 deletions

View File

@ -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;

View File

@ -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;
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); }