教学系统 代码调整
This commit is contained in:
parent
8388bf42b3
commit
c7a98096a2
@ -118,7 +118,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
$route() {
|
$route() {
|
||||||
this.initLoadData();
|
if (!this.isLesson) {
|
||||||
|
this.initLoadData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
@ -34,6 +34,7 @@ import { trainingNotifyNew } from '@/api/simulation';
|
|||||||
import { TrainingMode, UrlConfig } from '@/scripts/ConstDic';
|
import { TrainingMode, UrlConfig } from '@/scripts/ConstDic';
|
||||||
import { timeFormat } from '@/utils/date';
|
import { timeFormat } from '@/utils/date';
|
||||||
import { getTrainingStepsDetailNew } from '@/api/jmap/training';
|
import { getTrainingStepsDetailNew } from '@/api/jmap/training';
|
||||||
|
import { EventBus } from '@/scripts/event-bus';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MenuLesson',
|
name: 'MenuLesson',
|
||||||
@ -110,23 +111,15 @@ export default {
|
|||||||
this.isDisable = false;
|
this.isDisable = false;
|
||||||
},
|
},
|
||||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||||
if (this.$route.query.trainingId) {
|
this.getTrainingData();
|
||||||
// 获取实训步骤数据(新版地图)
|
|
||||||
getTrainingStepsDetailNew(this.$route.query.trainingId, { group: this.group }).then(resp => {
|
|
||||||
this.trainingObj = resp.data;
|
|
||||||
this.$store.dispatch('training/setTrainingData', this.trainingObj); // 设置实训教学信息
|
|
||||||
}).catch(error => {
|
|
||||||
this.$messageBox(`初始化失败实训内容失败: ${error.message}`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.$store.dispatch('training/end', null);
|
|
||||||
this.$store.dispatch('training/reset');
|
|
||||||
this.$store.dispatch('training/emitTipFresh');
|
|
||||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
|
||||||
this.isDisable = false;
|
|
||||||
},
|
},
|
||||||
'$store.state.training.operateErrMsg': function (val) {
|
'$store.state.training.operateErrMsg': function (val) {
|
||||||
this.tipInfo({ color: val.color, message: val.errMsg });
|
this.tipInfo({ color: val.color, message: val.errMsg });
|
||||||
|
},
|
||||||
|
async $route() {
|
||||||
|
await this.initData();
|
||||||
|
await this.getTrainingData();
|
||||||
|
this.endViewLoading(true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -143,6 +136,24 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getTrainingData() {
|
||||||
|
if (this.$route.query.trainingId) {
|
||||||
|
// 获取实训步骤数据(新版地图)
|
||||||
|
getTrainingStepsDetailNew(this.$route.query.trainingId, { group: this.group }).then(resp => {
|
||||||
|
this.trainingObj = resp.data;
|
||||||
|
this.$store.dispatch('training/setTrainingData', this.trainingObj); // 设置实训教学信息
|
||||||
|
const detail = resp.data;
|
||||||
|
this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
|
||||||
|
}).catch(error => {
|
||||||
|
this.$messageBox(`初始化失败实训内容失败: ${error.message}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.$store.dispatch('training/end', null);
|
||||||
|
this.$store.dispatch('training/reset');
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||||
|
this.isDisable = false;
|
||||||
|
},
|
||||||
overallTranslation(flag) {
|
overallTranslation(flag) {
|
||||||
const panel = document.getElementById('leftSlider');
|
const panel = document.getElementById('leftSlider');
|
||||||
if (flag) {
|
if (flag) {
|
||||||
@ -262,8 +273,8 @@ export default {
|
|||||||
const resp = await getTrainingDetailNew(this.$route.query.trainingId);
|
const resp = await getTrainingDetailNew(this.$route.query.trainingId);
|
||||||
this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode);
|
this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode);
|
||||||
if (resp && resp.code == 200) {
|
if (resp && resp.code == 200) {
|
||||||
const detail = resp.data;
|
// const detail = resp.data;
|
||||||
await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
|
// await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
|
||||||
} else {
|
} else {
|
||||||
this.$messageBox(`获取实训步骤数据失败`);
|
this.$messageBox(`获取实训步骤数据失败`);
|
||||||
this.endViewLoading();
|
this.endViewLoading();
|
||||||
@ -277,6 +288,9 @@ export default {
|
|||||||
if (!isSuccess) {
|
if (!isSuccess) {
|
||||||
this.$store.dispatch('map/mapClear');
|
this.$store.dispatch('map/mapClear');
|
||||||
}
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
EventBus.$emit('viewLoading', false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user