综合演练调整

This commit is contained in:
fan 2020-03-17 18:44:49 +08:00
parent b94c2b47de
commit 71d328296f
3 changed files with 10 additions and 6 deletions

View File

@ -316,7 +316,7 @@ export default {
// 01 02 '' // 01 02 ''
const resp = await this.getUserRole(); const resp = await this.getUserRole();
if (resp && resp.code == 200) { if (resp && resp.code == 200) {
// Admin Instructor Dispatcher Attendant Audience Driver Repair IBP:IBP // Admin Instructor Dispatcher STATION_SUPERVISOR Audience Driver MAINTAINER IBP:IBP
this.userRole = resp.data.userRole; this.userRole = resp.data.userRole;
switch (this.userRole) { switch (this.userRole) {
case 'ADMIN': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'ADMIN'); this.hideIbp(); break; case 'ADMIN': this.$store.dispatch('training/setPrdType', '02'); this.$store.dispatch('training/setRoles', 'ADMIN'); this.hideIbp(); break;
@ -325,7 +325,7 @@ export default {
case 'STATION_SUPERVISOR': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR'); this.hideIbp(); break; case 'STATION_SUPERVISOR': this.$store.dispatch('training/setPrdType', '01'); this.$store.dispatch('training/setRoles', 'STATION_SUPERVISOR'); this.hideIbp(); break;
case 'AUDIENCE': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'AUDIENCE'); this.hideIbp(); break; case 'AUDIENCE': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'AUDIENCE'); this.hideIbp(); break;
case 'DRIVER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'DRIVER'); this.hideIbp(); break; case 'DRIVER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'DRIVER'); this.hideIbp(); break;
case 'REPAIR': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'REPAIR'); this.hideIbp(); break; case 'MAINTAINER': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'MAINTAINER'); this.hideIbp(); break;
case 'IBP': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP'); this.showIbp(resp.data.deviceCode); break; case 'IBP': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'IBP'); this.showIbp(resp.data.deviceCode); break;
case 'BIGSCREEN': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'BIGSCREEN'); this.hideIbp(); break; case 'BIGSCREEN': this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'BIGSCREEN'); this.hideIbp(); break;
} }

View File

@ -218,7 +218,7 @@ export default {
} }
}); });
}, },
// Admin Instructor Dispatcher Attendant Audience Driver Repair // Admin Instructor Dispatcher Attendant Audience Driver MAINTAINER
addrolesList(list) { addrolesList(list) {
list.forEach(item => { list.forEach(item => {
if (this.userId == item.id) { if (this.userId == item.id) {
@ -243,8 +243,8 @@ export default {
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'DRIVER'); this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'DRIVER');
this.$emit('getUserRole'); this.$emit('getUserRole');
break; break;
case 'REPAIR': case 'MAINTAINER':
this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'REPAIR'); this.$store.dispatch('training/setPrdType', ''); this.$store.dispatch('training/setRoles', 'MAINTAINER');
this.$emit('getUserRole'); this.$emit('getUserRole');
break; break;
case 'IBP': case 'IBP':

View File

@ -208,7 +208,7 @@ export default {
return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('INSTRUCTOR'); }); return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('INSTRUCTOR'); });
}, },
repairList() { repairList() {
return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('REPAIR'); }); return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('REPAIR') || [elem.userRole.toUpperCase()].includes('MAINTAINER'); });
}, },
driverList() { driverList() {
return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('DRIVER'); }); return this.members.filter(elem => { return [elem.userRole.toUpperCase()].includes('DRIVER'); });
@ -305,6 +305,8 @@ export default {
params[0].userRole = roleType.toUpperCase(); params[0].userRole = roleType.toUpperCase();
if (roleType === 'Attendant') { if (roleType === 'Attendant') {
params[0].userRole = 'STATION_SUPERVISOR'; params[0].userRole = 'STATION_SUPERVISOR';
} else if (roleType === 'Repair') {
params[0].userRole = 'MAINTAINER';
} }
await putUserRolesNew(params, this.group); await putUserRolesNew(params, this.group);
} else { } else {
@ -327,6 +329,8 @@ export default {
if (this.drawWay) { if (this.drawWay) {
if (roleType === 'Attendant') { if (roleType === 'Attendant') {
list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: 'STATION_SUPERVISOR' }; }); list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: 'STATION_SUPERVISOR' }; });
} else if (roleType === 'Repair') {
list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: 'MAINTAINER'}; });
} else { } else {
list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: roleType.toUpperCase() }; }); list = userList.map(elem => { return { id: elem.id, nickName: elem.nickName, userRole: roleType.toUpperCase() }; });
} }