代码调整
This commit is contained in:
parent
d79e95425b
commit
246f204eb7
@ -306,8 +306,10 @@ export default {
|
|||||||
this.$refs.registerBook.doShow();
|
this.$refs.registerBook.doShow();
|
||||||
},
|
},
|
||||||
checkRoleInit(data) {
|
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 => {
|
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.$store.dispatch('training/setRoleDeviceCode', item.deviceCode);
|
||||||
this.deviceCode = item.deviceCode;
|
this.deviceCode = item.deviceCode;
|
||||||
this.setShowStation(item.deviceCode);
|
this.setShowStation(item.deviceCode);
|
||||||
@ -316,8 +318,10 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
checkRoleChange(data) {
|
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 => {
|
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.userRole = item.type || 'AUDIENCE';
|
||||||
this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode);
|
this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode);
|
||||||
this.deviceCode = item.deviceCode;
|
this.deviceCode = item.deviceCode;
|
||||||
|
@ -222,13 +222,22 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
checkRoleChange(data) {
|
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 => {
|
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.userRole = item.type || 'AUDIENCE';
|
||||||
this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode);
|
this.$store.dispatch('training/setRoleDeviceCode', item.deviceCode);
|
||||||
this.deviceCode = item.deviceCode;
|
this.deviceCode = item.deviceCode;
|
||||||
|
|
||||||
|
if (item.type == 'STATION_SUPERVISOR' || item.type == 'STATION_SIGNALER') {
|
||||||
this.setShowStation(item.deviceCode);
|
this.setShowStation(item.deviceCode);
|
||||||
this.$store.dispatch('training/setPrdType', '01');
|
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.setSimulationPrdType(this.centralizedStationMap[item.deviceCode]);
|
||||||
// this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
// if (item.deviceCode && this.$store.state.training.prdType !== '09') { this.setCenter(item.deviceCode); }
|
// if (item.deviceCode && this.$store.state.training.prdType !== '09') { this.setCenter(item.deviceCode); }
|
||||||
|
Loading…
Reference in New Issue
Block a user