实训调整

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