实训调整

This commit is contained in:
fan 2022-09-02 17:03:43 +08:00
parent 97065ca162
commit 0851691587
2 changed files with 18 additions and 2 deletions

View File

@ -135,12 +135,12 @@ export default {
break;
}
case 'trainingDesign': {
const data = { mapId: obj.mapId };
const data = { mapId: obj.mapId, prdType: '01' };
createSimulationNew(data).then(resp => {
if (this.loadingProjectList.includes(this.project)) {
this.$store.dispatch('app/transitionAnimations');
}
const query = { ...data, group: resp.data, lineCode:obj.lineCode};
const query = { mapId: obj.mapId, group: resp.data, lineCode:obj.lineCode};
this.$router.push({ path: `/trainingDesign`, query });
}).catch(error => {
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);

View File

@ -459,6 +459,14 @@ export default {
if (this.$route.query.newApi + '' === 'true') {
getMemberListCommon(this.group).then(resp => {
this.$store.dispatch('training/setMemberList', { memberList: resp.data, userId: this.userId });
const member = resp.data.find(elem => elem.userId === this.userId);
if (member) {
this.userRole = member.type || 'AUDIENCE';
this.$store.dispatch('training/setRoleDeviceCode', member.deviceCode);
this.$store.dispatch('training/setUserRole', this.userRole);
this.deviceCode = member.deviceCode;
this.setSimulationPrdType(this.centralizedStationMap[member.deviceCode]);
}
getUserListCommon(this.group).then(res => {
this.$store.dispatch('training/setSimulationUserList', res.data);
}).catch(() => {
@ -471,6 +479,14 @@ export default {
// 仿
getSimulationMemberList(this.group).then(resp => {
this.$store.dispatch('training/setMemberList', { memberList: resp.data, userId: this.userId });
const member = resp.data.find(elem => elem.userId === this.userId);
if (member) {
this.userRole = member.type || 'AUDIENCE';
this.$store.dispatch('training/setRoleDeviceCode', member.deviceCode);
this.$store.dispatch('training/setUserRole', this.userRole);
this.deviceCode = member.deviceCode;
this.setSimulationPrdType(this.centralizedStationMap[member.deviceCode]);
}
getAllSimulationUser(this.group).then(res => {
this.$store.dispatch('training/setSimulationUserList', res.data);
}).catch(() => {