考试系统代码调整

This commit is contained in:
joylink_cuiweidong 2020-11-27 14:05:10 +08:00
parent 1f7c3f3bf7
commit c2cd9e73d5
5 changed files with 87 additions and 47 deletions

View File

@ -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: '信号重开',

View File

@ -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: '鼠标左键点击【确定】按钮' }
]
},
{

View File

@ -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) {

View File

@ -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 => {
// 50009y
@ -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 => {

View File

@ -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}`);