2019-07-26 13:32:43 +08:00
|
|
|
<template>
|
2019-10-31 17:30:24 +08:00
|
|
|
<div class="joylink-card">
|
|
|
|
<div class="card-title">
|
2019-09-11 09:25:16 +08:00
|
|
|
<b>{{ $t('exam.nameOfTestPaper') +': ' + examDetails.name }}</b>
|
2019-08-14 10:36:55 +08:00
|
|
|
</div>
|
2019-11-07 18:46:17 +08:00
|
|
|
<div class="card_content">
|
2019-10-31 17:30:24 +08:00
|
|
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
2019-08-14 10:36:55 +08:00
|
|
|
<p class="list-item">
|
2019-10-17 11:20:09 +08:00
|
|
|
<span class="list-label">{{ $t('exam.examStartTime') +':' }}</span>
|
2019-08-14 10:36:55 +08:00
|
|
|
<span v-if="examDetails.startTime" class="list-elem">
|
|
|
|
{{ examDetails.startTime }} - {{ examDetails.endTime }}</span>
|
2019-09-11 09:25:16 +08:00
|
|
|
<span v-else class="list-elem">{{ $t('exam.theExamIsReadyAnyTime') }}</span>
|
2019-08-14 10:36:55 +08:00
|
|
|
</p>
|
|
|
|
<p class="list-item">
|
2019-09-11 09:25:16 +08:00
|
|
|
<span class="list-label">{{ $t('exam.testExplanation') + ':' }}</span>
|
2019-08-14 10:36:55 +08:00
|
|
|
<span class="list-elem">{{ examDetails.remarks }}</span>
|
|
|
|
</p>
|
|
|
|
<p class="list-item">
|
2019-09-11 09:25:16 +08:00
|
|
|
<span class="list-label">{{ $t('exam.examTimeAvailable') + ':' }}</span>
|
2019-11-13 14:16:59 +08:00
|
|
|
<span class="list-elem" v-html="parseInt(examDetails.duration) / 60 + $t('exam.minutes')" />
|
2019-08-14 10:36:55 +08:00
|
|
|
</p>
|
|
|
|
<p class="list-item">
|
2019-09-11 09:25:16 +08:00
|
|
|
<span class="list-label">{{ $t('exam.fullMarksInTheExam') + ':' }}</span>
|
2019-10-17 11:20:09 +08:00
|
|
|
<span class="list-elem">{{ examDetails.fullPoint }}</span>
|
2019-08-14 10:36:55 +08:00
|
|
|
</p>
|
|
|
|
<p class="list-item">
|
2019-09-11 09:25:16 +08:00
|
|
|
<span class="list-label">{{ $t('exam.passMarkTheExam') + ':' }}</span>
|
2019-10-17 11:20:09 +08:00
|
|
|
<span class="list-elem">{{ examDetails.passingPoint }}</span>
|
2019-08-14 10:36:55 +08:00
|
|
|
</p>
|
|
|
|
<p class="list-item">
|
2019-09-11 09:25:16 +08:00
|
|
|
<span class="list-label">{{ $t('exam.examinationRules') + ':' }}</span>
|
2019-08-14 10:36:55 +08:00
|
|
|
<span class="list-elem">
|
|
|
|
<p class="list-table">
|
|
|
|
<el-table :data="examDetails.examDefinitionRulesVOList" border show-summary>
|
2019-09-11 09:25:16 +08:00
|
|
|
<el-table-column prop="name" :label="this.$t('exam.trainingType')" width="180" />
|
|
|
|
<el-table-column prop="num" :label="this.$t('exam.numberOfQuestions')" />
|
|
|
|
<el-table-column prop="point" :label="this.$t('exam.score')" />
|
|
|
|
<el-table-column prop="chapterIdLong" :label="this.$t('exam.totalScore')" />
|
2019-08-14 10:36:55 +08:00
|
|
|
</el-table>
|
|
|
|
</p>
|
|
|
|
</span>
|
|
|
|
</p>
|
2019-10-31 17:30:24 +08:00
|
|
|
<div class="btn-start">
|
2019-11-25 18:21:56 +08:00
|
|
|
<el-button :disabled="disabled" type="primary" @click="exmaStart">{{ $t('exam.startTheExam') }}</el-button>
|
|
|
|
<el-button :disabled="disabled" @click="back">{{ $t('global.back') }}</el-button>
|
2019-10-31 17:30:24 +08:00
|
|
|
</div>
|
2019-08-14 10:36:55 +08:00
|
|
|
</el-scrollbar>
|
|
|
|
</div>
|
2019-10-31 17:30:24 +08:00
|
|
|
</div>
|
2019-07-26 13:32:43 +08:00
|
|
|
</template>
|
|
|
|
<script>
|
2020-03-27 10:51:49 +08:00
|
|
|
import { examNotify, examNotifyNew } from '@/api/simulation';
|
2019-08-14 10:36:55 +08:00
|
|
|
import { getExamLessonDetail } from '@/api/management/exam';
|
|
|
|
import { generateExamList } from '@/api/management/userexam';
|
|
|
|
import { getPublishLessonDetail } from '@/api/jmap/lesson';
|
|
|
|
import { PermissionType } from '@/scripts/ConstDic';
|
|
|
|
import { getDetailList } from '@/api/management/dictionary';
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import { launchFullscreen } from '@/utils/screen';
|
2020-03-30 13:07:11 +08:00
|
|
|
import { UrlConfig } from '@/scripts/ConstDic';
|
2019-11-01 18:08:05 +08:00
|
|
|
import LangStorage from '@/utils/lang';
|
2020-03-27 10:51:49 +08:00
|
|
|
import { getPublishMapInfo } from '@/api/jmap/map';
|
2019-07-26 13:32:43 +08:00
|
|
|
|
2019-08-14 10:36:55 +08:00
|
|
|
export default {
|
2019-10-30 13:56:43 +08:00
|
|
|
name: 'ExamDetailView',
|
|
|
|
data() {
|
|
|
|
return {
|
2019-11-25 18:21:56 +08:00
|
|
|
disabled: false,
|
2019-10-30 13:56:43 +08:00
|
|
|
examDetails: {
|
|
|
|
lessonId: '',
|
|
|
|
name: '',
|
|
|
|
remarks: '',
|
|
|
|
examDefinitionRulesVOList: [],
|
|
|
|
startTime: '',
|
|
|
|
endTime: '',
|
|
|
|
fullPoint: '',
|
|
|
|
passingPoint: '',
|
2019-11-13 14:16:59 +08:00
|
|
|
duration: 0,
|
2019-10-30 13:56:43 +08:00
|
|
|
type: ''
|
|
|
|
},
|
|
|
|
typeList: [],
|
|
|
|
examList: [],
|
2020-03-27 10:51:49 +08:00
|
|
|
trainingOperateTypeMap: {},
|
|
|
|
drawWay: false
|
2019-10-30 13:56:43 +08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters('trainingList', [
|
|
|
|
'trainingList'
|
2019-11-01 18:08:05 +08:00
|
|
|
])
|
2019-10-30 13:56:43 +08:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
'$route.params.examId': function (val) {
|
|
|
|
this.loadInitPage(val);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async mounted() {
|
|
|
|
this.trainingOperateTypeMap = {};
|
|
|
|
this.$Dictionary.stationControl().then(list => {
|
|
|
|
this.trainingOperateTypeMap['01'] = list; // 控制权实训
|
|
|
|
});
|
|
|
|
this.$Dictionary.signalOperation().then(list => {
|
|
|
|
this.trainingOperateTypeMap['02'] = list; // 信号机实训
|
|
|
|
});
|
|
|
|
this.$Dictionary.switchOperation().then(list => {
|
|
|
|
this.trainingOperateTypeMap['03'] = list; // 道岔实训
|
|
|
|
});
|
|
|
|
this.$Dictionary.sectionOperation().then(list => {
|
|
|
|
this.trainingOperateTypeMap['04'] = list; // 区段实训
|
|
|
|
});
|
|
|
|
this.$Dictionary.stationStandOperation().then(list => {
|
|
|
|
this.trainingOperateTypeMap['05'] = list; // 站台实训
|
|
|
|
});
|
|
|
|
this.$Dictionary.trainPlanOperation().then(list => {
|
|
|
|
this.trainingOperateTypeMap['06'] = list; // 行车计划实训
|
|
|
|
});
|
|
|
|
this.$Dictionary.trainOperation().then(list => {
|
|
|
|
this.trainingOperateTypeMap['07'] = list; // 列车实训
|
|
|
|
});
|
|
|
|
await this.getList();
|
|
|
|
this.loadInitPage(this.$route.params.examId);
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async getList() {
|
|
|
|
this.typeList = [];
|
|
|
|
await getDetailList('training_type').then(res => {
|
|
|
|
this.typeList = res.data;
|
2019-11-01 18:08:05 +08:00
|
|
|
if (LangStorage.getLang() == 'en') {
|
|
|
|
this.typeList.forEach(item => {
|
|
|
|
switch (item.code) {
|
|
|
|
case '01':
|
|
|
|
item.name = 'Control permission operation';
|
|
|
|
break;
|
|
|
|
case '02':
|
|
|
|
item.name = 'Signalling machine operation';
|
|
|
|
break;
|
|
|
|
case '03':
|
|
|
|
item.name = 'Turnout operation';
|
|
|
|
break;
|
|
|
|
case '04':
|
|
|
|
item.name = 'Section operation';
|
|
|
|
break;
|
|
|
|
case '05':
|
|
|
|
item.name = 'Platform operation';
|
|
|
|
break;
|
|
|
|
case '06':
|
|
|
|
item.name = 'Train scheduling operation';
|
|
|
|
break;
|
|
|
|
case '07':
|
|
|
|
item.name = 'Train operation';
|
|
|
|
break;
|
|
|
|
case '08':
|
|
|
|
item.name = 'Temporary speed limit operation of the whole line';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2019-10-30 13:56:43 +08:00
|
|
|
});
|
|
|
|
},
|
|
|
|
async loadInitPage(examId) {
|
|
|
|
if (examId) {
|
2020-03-27 10:51:49 +08:00
|
|
|
getPublishMapInfo(this.$route.query.mapId).then(res => {
|
|
|
|
if (res.data) {
|
|
|
|
this.drawWay = res.data.drawWay;
|
|
|
|
}
|
|
|
|
}).catch(() => {
|
|
|
|
this.$message.error(this.$t('error.getMapDataFailed'));
|
|
|
|
});
|
2019-10-30 13:56:43 +08:00
|
|
|
const res = await getExamLessonDetail(examId);
|
|
|
|
this.examDetails = res.data;
|
|
|
|
this.examDetails.examDefinitionRulesVOList.forEach((res, index) => {
|
|
|
|
res.chapterIdLong = Number(res.num) * Number(res.point);
|
|
|
|
this.typeList.forEach(v => {
|
|
|
|
if (res.trainingType == v.code) {
|
|
|
|
this.examDetails.examDefinitionRulesVOList[index].name = v.name;
|
|
|
|
if (res.operateType) {
|
|
|
|
this.trainingOperateTypeMap[res.trainingType].forEach(item => {
|
|
|
|
if (item.code == res.operateType) {
|
|
|
|
this.examDetails.examDefinitionRulesVOList[index].name = `${this.examDetails.examDefinitionRulesVOList[index].name}-${item.name}`;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
buy() {
|
|
|
|
getPublishLessonDetail({ id: this.examDetails.lessonId }).then((res) => {
|
|
|
|
this.$router.push({
|
|
|
|
path: `${UrlConfig.trainingPlatform.pay}/${this.examDetails.lessonId}`,
|
2019-12-27 17:09:56 +08:00
|
|
|
query: { permissionType: PermissionType.EXAM, lessonId: this.examDetails.lessonId, prdType: res.data.prdType, mapId: res.data.mapId }
|
2019-10-30 13:56:43 +08:00
|
|
|
});
|
|
|
|
}).catch(() => {
|
|
|
|
this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
|
|
|
|
});
|
2019-07-26 13:32:43 +08:00
|
|
|
|
2019-10-30 13:56:43 +08:00
|
|
|
},
|
|
|
|
async examDetail() {
|
|
|
|
const data = this.examDetails;
|
|
|
|
try {
|
|
|
|
const response = await generateExamList(data.id);
|
|
|
|
this.examList = response.data.userExamQuestionsVOs;
|
|
|
|
this.userExam = response.data;
|
|
|
|
const list = response.data.userExamQuestionsVOs;
|
|
|
|
await this.$store.dispatch('exam/setUsedTime', this.userExam.usedTime);
|
|
|
|
await this.$store.dispatch('exam/setTotalTime', this.userExam.duration);
|
|
|
|
await this.$store.dispatch('trainingList/setTrainingList', list);
|
|
|
|
} catch (error) {
|
|
|
|
// 判断是否有考试权限,如果没有权限则跳到购买页面,否则报错
|
|
|
|
if (error.code === 500004) {
|
|
|
|
this.$confirm( this.$t('tip.noCourseAuthority'), this.$t('tip.hint'), {
|
|
|
|
cancelButtonText: this.$t('global.cancel'),
|
|
|
|
confirmButtonText: this.$t('global.confirm'),
|
|
|
|
type: 'warning',
|
|
|
|
center: true
|
|
|
|
}).then(() => {
|
|
|
|
this.buy();
|
|
|
|
}).catch(() => { });
|
|
|
|
} else if (error.code === 500005) {
|
|
|
|
this.$messageBox(this.$t('tip.notWithinTheScopeOfTheExamination'));
|
|
|
|
} else {
|
|
|
|
this.$messageBox(`${error.message}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async exmaStart() {
|
2019-11-25 18:21:56 +08:00
|
|
|
this.disabled = true;
|
2019-10-30 13:56:43 +08:00
|
|
|
await this.examDetail();
|
2020-03-27 10:51:49 +08:00
|
|
|
if (this.examList.length && !this.drawWay) {
|
2019-10-30 13:56:43 +08:00
|
|
|
examNotify({ examId: this.$route.params.examId }).then(resp => {
|
|
|
|
const query = {
|
|
|
|
group: resp.data,
|
|
|
|
trainingId: this.examList[0].trainingId,
|
|
|
|
userExamId: this.userExam.id,
|
|
|
|
examQuestionId: this.examList[0].id,
|
|
|
|
subSystem: this.$route.query.subSystem,
|
|
|
|
examId: this.$route.params.examId,
|
|
|
|
mapId: this.$route.query.mapId
|
|
|
|
};
|
|
|
|
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
|
|
|
|
launchFullscreen();
|
|
|
|
}).catch(error => {
|
2019-11-25 18:21:56 +08:00
|
|
|
this.disabled = false;
|
2019-10-30 13:56:43 +08:00
|
|
|
this.$messageBox( this.$t('error.createSimulationFailed') + `: ${error.message}`);
|
2020-03-27 10:51:49 +08:00
|
|
|
});
|
|
|
|
} else if (this.examList.length && this.drawWay) {
|
|
|
|
examNotifyNew({ examId: this.$route.params.examId }).then(resp => {
|
|
|
|
const query = {
|
|
|
|
group: resp.data,
|
|
|
|
trainingId: this.examList[0].trainingId,
|
|
|
|
userExamId: this.userExam.id,
|
|
|
|
examQuestionId: this.examList[0].id,
|
|
|
|
subSystem: this.$route.query.subSystem,
|
|
|
|
examId: this.$route.params.examId,
|
|
|
|
mapId: this.$route.query.mapId
|
|
|
|
};
|
|
|
|
this.$router.push({ path: `${UrlConfig.display}/exam`, query: query });
|
|
|
|
launchFullscreen();
|
|
|
|
}).catch(error => {
|
|
|
|
this.disabled = false;
|
|
|
|
this.$messageBox( this.$t('error.createSimulationFailed') + `: ${error.message}`);
|
2019-10-30 13:56:43 +08:00
|
|
|
});
|
|
|
|
} else {
|
2019-11-25 18:21:56 +08:00
|
|
|
this.disabled = false;
|
2019-10-30 13:56:43 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
back() {
|
2019-11-25 18:21:56 +08:00
|
|
|
this.disabled = true;
|
|
|
|
setTimeout(() => {
|
|
|
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`, query: {lessonId: this.examDetails.lessonId}});
|
|
|
|
}, 100);
|
2019-10-30 13:56:43 +08:00
|
|
|
}
|
|
|
|
}
|
2019-08-14 10:36:55 +08:00
|
|
|
};
|
2019-07-26 13:32:43 +08:00
|
|
|
</script>
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
|
@import "src/styles/mixin.scss";
|
2019-10-31 17:30:24 +08:00
|
|
|
.joylink-card{
|
|
|
|
height: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
.card-title{
|
|
|
|
height: 47px;
|
|
|
|
line-height: 47px;
|
|
|
|
text-align: center;
|
|
|
|
border-bottom: 1px solid #e6e6e6;
|
|
|
|
}
|
2019-11-07 18:46:17 +08:00
|
|
|
.card_content{
|
|
|
|
padding:50px;
|
|
|
|
padding-right: 0;
|
|
|
|
height: 100%;
|
|
|
|
}
|
2019-10-31 17:30:24 +08:00
|
|
|
}
|
2019-07-26 13:32:43 +08:00
|
|
|
|
|
|
|
.menu li {
|
|
|
|
border-right: solid white 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
ul {
|
|
|
|
line-height: 22px;
|
|
|
|
margin: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.noList {
|
|
|
|
text-align: center;
|
|
|
|
padding-top: 20px;
|
|
|
|
font-size: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.btn-buy {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
padding-right: 50px;
|
|
|
|
transform: translateY(-30px);
|
|
|
|
}
|
|
|
|
|
|
|
|
::-webkit-scrollbar {
|
|
|
|
width: 10px;
|
|
|
|
height: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
/deep/ {
|
|
|
|
.el-table__footer-wrapper {
|
|
|
|
.is-leaf:nth-child(3) {
|
|
|
|
font-size: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
font-weight: bold
|
|
|
|
}
|
|
|
|
|
|
|
|
.list-item {
|
|
|
|
font-size: 16px;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.list-label {
|
|
|
|
display: -moz-inline-box;
|
|
|
|
display: inline-block;
|
|
|
|
text-align: right;
|
|
|
|
width: 120px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.list-table {
|
|
|
|
padding-top: 10px;
|
|
|
|
padding-left: 120px;
|
2019-10-31 17:30:24 +08:00
|
|
|
width: calc(100% - 80px);
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.list-elem {
|
|
|
|
color: #808080 !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.btn-start {
|
|
|
|
text-align: center;
|
2019-10-31 17:30:24 +08:00
|
|
|
margin-bottom: 20px;
|
2019-07-26 13:32:43 +08:00
|
|
|
}
|
2019-08-09 15:52:55 +08:00
|
|
|
</style>
|