考试系统代码调整
This commit is contained in:
parent
1f7c3f3bf7
commit
c2cd9e73d5
@ -77,7 +77,7 @@ export default {
|
||||
{
|
||||
label: '人工解锁进路', // 信号机引导取消
|
||||
handler: this.humanTrainRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
|
||||
},
|
||||
{
|
||||
label: '信号封锁',
|
||||
@ -129,7 +129,7 @@ export default {
|
||||
{
|
||||
label: '人工解锁进路', // 信号机引导取消
|
||||
handler: this.humanTrainRoute,
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_CANCEL_GUIDE
|
||||
cmdType: CMD.Signal.CMD_SIGNAL_HUMAN_RELEASE_ROUTE
|
||||
},
|
||||
{
|
||||
label: '信号重开',
|
||||
|
@ -687,8 +687,8 @@ export default {
|
||||
trainingType: 'Signal',
|
||||
productTypes: ['01', '02'],
|
||||
stepVOList: [
|
||||
{ deviceType: '04', orderNum: 1, operateCode: '318', tip: '鼠标右键菜单选择【人工解锁进路】' },
|
||||
{ deviceType: '04', orderNum: 2, operateCode: '318', tip: '鼠标左键点击【确定】按钮' }
|
||||
{ deviceType: '04', orderNum: 1, operateCode: '305', tip: '鼠标右键菜单选择【人工解锁进路】' },
|
||||
{ deviceType: '04', orderNum: 2, operateCode: '305', tip: '鼠标左键点击【确定】按钮' }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -12,17 +12,19 @@
|
||||
<el-button type="success" :disabled="isDisable || dataError" :loading="startLoading" @click="start">{{ $t('display.startBtn') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<tip-exam-list :offset-bottom="offsetBottom" @refresh="refresh" />
|
||||
<tip-exam-list :offset-bottom="offsetBottom" />
|
||||
<!-- @refresh="refresh" -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getTrainingDetailNew } from '@/api/jmap/training';
|
||||
// import { getTrainingDetailNew } from '@/api/jmap/training';
|
||||
import TipExamList from './tipExamList';
|
||||
import { Notification } from 'element-ui';
|
||||
import { startTrainingNew } from '@/api/jmap/training';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { refreshExamList, finishOneExamQuestion } from '@/api/management/userexam';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
name: 'MenuExam',
|
||||
@ -49,6 +51,7 @@ export default {
|
||||
return {
|
||||
isDisable: false,
|
||||
startLoading: false,
|
||||
locateDeviceCode:null,
|
||||
training: {
|
||||
id: '',
|
||||
name: '',
|
||||
@ -73,14 +76,22 @@ export default {
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function() {
|
||||
this.$store.dispatch('exam/countUsedTime');
|
||||
this.locateDeviceCode && this.$store.dispatch('exam/setCenter', this.locateDeviceCode); // 设置考题对象居中
|
||||
},
|
||||
$route() {
|
||||
this.initData();
|
||||
// this.initData();
|
||||
this.isDisable = false;
|
||||
this.$store.dispatch('training/end', null);
|
||||
this.$store.dispatch('training/reset');
|
||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||
this.$store.dispatch('training/setStopCountTime');
|
||||
this.$store.dispatch('training/setTrainingStart', false);
|
||||
EventBus.$emit('viewLoading', false);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initData();
|
||||
},
|
||||
// mounted() {
|
||||
// this.initData();
|
||||
// },
|
||||
methods: {
|
||||
tipInfo(opt) {
|
||||
if (opt && opt.hasOwnProperty('color') && opt.hasOwnProperty('message')) {
|
||||
@ -171,28 +182,28 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
refresh() {
|
||||
this.isDisable = false;
|
||||
this.$store.dispatch('training/end', null);
|
||||
},
|
||||
// 课程和考试系统
|
||||
async initData() {
|
||||
if (parseInt(this.$route.query.trainingId)) {
|
||||
const resp = await getTrainingDetailNew(this.$route.query.trainingId);
|
||||
this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode); // 设置考题对象居中
|
||||
if (resp && resp.code == 200) {
|
||||
const detail = resp.data;
|
||||
await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
|
||||
|
||||
await this.$store.dispatch('training/setTrainingData', detail); // 设置实训信息
|
||||
} else {
|
||||
this.$messageBox(`获取实训步骤数据失败`);
|
||||
this.endViewLoading();
|
||||
}
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
},
|
||||
// refresh() {
|
||||
// this.isDisable = false;
|
||||
// this.$store.dispatch('training/end', null);
|
||||
// },
|
||||
// // 课程和考试系统
|
||||
// async initData() {
|
||||
// if (parseInt(this.$route.query.trainingId)) {
|
||||
// const resp = await getTrainingDetailNew(this.$route.query.trainingId);
|
||||
// if (resp && resp.code == 200) {
|
||||
// const detail = resp.data;
|
||||
// this.locateDeviceCode = resp.data.locateDeviceCode;
|
||||
// debugger;
|
||||
// await this.$store.dispatch('training/setPrdType', this.prdTypeMap[detail.prdType]);
|
||||
// await this.$store.dispatch('training/setTrainingData', detail); // 设置实训信息
|
||||
// } else {
|
||||
// this.$messageBox(`获取实训步骤数据失败`);
|
||||
// this.endViewLoading();
|
||||
// }
|
||||
// } else {
|
||||
// this.endViewLoading();
|
||||
// }
|
||||
// },
|
||||
// 结束加载状态
|
||||
endViewLoading(isSuccess) {
|
||||
if (!isSuccess) {
|
||||
|
@ -82,6 +82,7 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
import { refreshExamList } from '@/api/management/userexam';
|
||||
// loadTrainingInSimulation
|
||||
import { getTrainingDetailNew } from '@/api/jmap/training';
|
||||
|
||||
export default {
|
||||
@ -113,7 +114,13 @@ export default {
|
||||
},
|
||||
detailShow: false,
|
||||
examIndex: 0,
|
||||
scanInter:null
|
||||
scanInter:null,
|
||||
prdTypeMap: {
|
||||
'01': '01', // 现地 => 现地
|
||||
'02': '02', // 行调 => 行调
|
||||
'04': '02', // 司机 => 行调
|
||||
'05': '' // 派班 => null
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -151,7 +158,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 获取试题详情
|
||||
selectedTraining(obj) {
|
||||
selectedTraining(obj, type = null) {
|
||||
this.trainingList.forEach((item, index) => {
|
||||
if (item.id == obj.id) {
|
||||
this.examIndex = index;
|
||||
@ -159,21 +166,41 @@ export default {
|
||||
}
|
||||
});
|
||||
if (obj) {
|
||||
getTrainingDetailNew(obj.trainingId).then(res => {
|
||||
// if (type) {
|
||||
getTrainingDetailNew(obj.trainingId).then(resp => {
|
||||
this.courseModel = {
|
||||
id: res.data.id,
|
||||
name: res.data.name,
|
||||
maxDuration: res.data.maxDuration,
|
||||
remarks: res.data.remarks,
|
||||
minDuration: res.data.minDuration,
|
||||
updateTime: res.data.updateTime
|
||||
id: resp.data.id,
|
||||
name: resp.data.name,
|
||||
maxDuration: resp.data.maxDuration,
|
||||
remarks: resp.data.remarks,
|
||||
minDuration: resp.data.minDuration,
|
||||
updateTime: resp.data.updateTime
|
||||
};
|
||||
// this.$store.dispatch('exam/setCenter', res.data.locateDeviceCode);
|
||||
this.$store.dispatch('training/setPrdType', this.prdTypeMap[resp.data.prdType]);
|
||||
this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode);
|
||||
this.$store.dispatch('training/setTrainingData', resp.data); // 设置实训信息
|
||||
}).catch(error => {
|
||||
this.$message.error(this.$t('display.exam.getTestInformation') + ':' + error.message);
|
||||
});
|
||||
// } else {
|
||||
// loadTrainingInSimulation(this.$route.query.group, this.$route.query.trainingId).then(resp => {
|
||||
// // getTrainingDetailNew(obj.trainingId).then(res => {
|
||||
// this.courseModel = {
|
||||
// id: resp.data.id,
|
||||
// name: resp.data.name,
|
||||
// maxDuration: resp.data.maxDuration,
|
||||
// remarks: resp.data.remarks,
|
||||
// minDuration: resp.data.minDuration,
|
||||
// updateTime: resp.data.updateTime
|
||||
// };
|
||||
// this.$store.dispatch('training/setPrdType', this.prdTypeMap[resp.data.prdType]);
|
||||
// this.$store.dispatch('exam/setCenter', resp.data.locateDeviceCode);
|
||||
// this.$store.dispatch('training/setTrainingData', resp.data); // 设置实训信息
|
||||
// }).catch(error => {
|
||||
// this.$message.error(this.$t('display.exam.getTestInformation') + ':' + error.message);
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
this.jump(obj);
|
||||
},
|
||||
getTrainDetail(obj) {
|
||||
@ -200,7 +227,7 @@ export default {
|
||||
obj.trainingId = response.data.userExamQuestionsVOs[0].trainingId;
|
||||
obj.id = response.data.userExamQuestionsVOs[0].id;
|
||||
}
|
||||
this.selectedTraining(obj);
|
||||
this.selectedTraining(obj, 'first');
|
||||
this.scanCommit();
|
||||
}).catch(error => {
|
||||
// 如果时50009则表示考试已完成,不能再次进行y
|
||||
@ -271,7 +298,7 @@ export default {
|
||||
noPreLogout: this.$route.query.noPreLogout
|
||||
};
|
||||
this.$router.replace({query: query});
|
||||
this.$emit('refresh');
|
||||
// this.$emit('refresh');
|
||||
},
|
||||
overExam() {
|
||||
this.$store.dispatch('exam/isOver').then(isOver => {
|
||||
|
@ -30,7 +30,7 @@ import MenuTrainList from '@/views/newMap/displayNew/menuTrainList';
|
||||
import MenuSystemTime from '@/views/newMap/displayNew/menuSystemTime';
|
||||
|
||||
import { clearSimulation, getSimulationInfoNew, ranAsPlan, exitRunPlan } from '@/api/simulation';
|
||||
import { loadNewMapDataByGroup } from '@/utils/loaddata';
|
||||
import { loadNewMapDataByGroup, loadMapDataById } from '@/utils/loaddata';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
@ -118,7 +118,7 @@ export default {
|
||||
}
|
||||
},
|
||||
$route() {
|
||||
if (!this.isLesson) {
|
||||
if (!this.isLesson && !this.isExam) {
|
||||
this.initLoadData();
|
||||
}
|
||||
}
|
||||
@ -225,6 +225,7 @@ export default {
|
||||
loadMapData() {
|
||||
if (parseInt(this.mapId)) {
|
||||
this.loadNewMapDataByGroup(this.group);
|
||||
// this.loadNewMapDataByGroup(this.mapId);
|
||||
} else {
|
||||
this.endViewLoading();
|
||||
}
|
||||
@ -234,6 +235,7 @@ export default {
|
||||
try {
|
||||
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式
|
||||
await loadNewMapDataByGroup(group);
|
||||
// await loadMapDataById(group);
|
||||
await this.$store.dispatch('training/setMapDefaultState');
|
||||
} catch (error) {
|
||||
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
||||
|
Loading…
Reference in New Issue
Block a user