查询实训调整

This commit is contained in:
fan 2023-01-03 17:45:30 +08:00
parent fe080d704f
commit 416590008e
2 changed files with 13 additions and 5 deletions

View File

@ -199,11 +199,11 @@ export function getAllPublishTrainingList(params) {
});
}
/** 查询组织已发布实训的基础信息 */
export function getPublishTrainingListInOrg(params) {
export function getPublishTrainingListInOrg(data) {
return request({
url: `/api/v2/training/published/infos`,
method: 'get',
params
method: 'post',
data
});
}
/** 根据实训id查该已发布实训的所有信息 */

View File

@ -56,8 +56,16 @@ export default {
methods: {
initLoadPage() {
const trainingType = this.$store.state.training.domConfig ? this.$store.state.training.domConfig.trainingType : '';
console.log(trainingType, this.$store.state.training.domConfig);
getPublishTrainingListInOrg({mapId: this.mapId, type: trainingType.toLowerCase()}).then(response => {
// labels: ['', '']
const data = {mapId: this.mapId, type: trainingType.toLowerCase()};
if (this.$route.query.labels) {
const labels = this.$route.query.labels.split('-');
const labelMap = { loc: '现地', dis: '行调', section: '区段', signal: '信号机', switch: '道岔', stand: '站台', station: '车站', control: '控制权' };
const newLabels = [];
labels.forEach(item => newLabels.push(labelMap[item]));
data.labels = newLabels;
}
getPublishTrainingListInOrg(data).then(response => {
this.trainingList = response.data;
EventBus.$emit('setTrainingList', this.trainingList);
}).catch(error => {