实训调整

This commit is contained in:
fan 2022-08-30 11:14:24 +08:00
parent 5fe936e754
commit caacfa5719

View File

@ -120,17 +120,22 @@ export default {
try {
const detailResp = await getPublishTrainingDetail(data.id);
this.training = detailResp.data;
const mapLocation = JSON.parse(detailResp.data.mapLocationJson);
const playerId = JSON.parse(detailResp.data.playerIdJson)[0];
const member = this.$store.state.training.memberData[playerId];
this.$store.dispatch('training/setPrdType', this.prdTypeMap[member.type]);
this.$store.dispatch('training/setRoles', member.type);
this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
if (detailResp.data.mapLocationJson) {
const mapLocation = JSON.parse(detailResp.data.mapLocationJson);
this.$jlmap.updateTransform(mapLocation.scale, {x:mapLocation.x, y:mapLocation.y});
}
if (detailResp.data.playerIdJson) {
const playerId = JSON.parse(detailResp.data.playerIdJson)[0];
if (playerId) {
const member = this.$store.state.training.memberData[playerId];
this.$store.dispatch('training/setPrdType', this.prdTypeMap[member.type]);
this.$store.dispatch('training/setRoles', member.type);
}
}
this.$store.dispatch('trainingNew/setTrainingDetail', detailResp.data);
await loadPublishTraining(this.group, data.id, {mode: this.teachMode});
this.$message.success('加载实训成功!');
} catch (e) {
console.error('ceshi', e);
this.$message.error('加载实训失败!');
}
},