调整理论流程结果页面

This commit is contained in:
zyy 2020-05-27 18:30:14 +08:00
parent 32d94e6b38
commit 07679a37e7
2 changed files with 22 additions and 25 deletions

View File

@ -159,7 +159,6 @@ export default {
async getUserStatus() {
this.resultFlag = false;
const res = await getRaceUserById(this.$route.query.raceId);
// console.log(res.data.status);
if (this.$route.query.type == 'theory' && (res.data.status == 4 || res.data.status == 5)) {
this.$router.replace({ path: `/jsxt/result`, query: { type: 'theory', raceId:this.$route.query.raceId } });
} else if (this.$route.query.type == 'operation' && (res.data.status == 4 || res.data.status == 6)) {
@ -182,8 +181,6 @@ export default {
getPracticalQuestion(this.$route.query.raceId).then((responese)=>{
if (responese.data) {
participantCreatTrainingRoom(this.$route.query.raceId, {mapId: 41, prdType: '02'}).then(resp => {
// const query = { lineCode: '11', mapId: '41', group: resp.data, prdType: '03', raceId: this.$route.query.raceId};
// this.$router.replace({ path: `/displayNew/demon`, query: query});
const query = { lineCode: '11', mapId: '41', group: resp.data, raceId: this.$route.query.raceId};
this.$router.replace({ path: `/jointTrainingNew`, query: query});
});

View File

@ -4,23 +4,19 @@
<span style="font-weight:bold ">{{ $t('exam.examResultsDetails') }}</span>
</div>
<div class="context">
<el-form ref="form" :model="resultModel" size="mini">
<!-- <el-form ref="form" :model="resultModel" size="mini">
<el-form-item :label="this.$t('exam.testScores')+':'" prop="score">
<span>{{ resultModel.score + ' '+ $t('exam.points') }}</span>
</el-form-item>
<el-form-item :label="this.$t('exam.examTime')+':'" prop="detail">
<span>{{ Math.ceil((resultModel.usedTime || 0)/60) + ' '+ $t('global.minutes') }}</span>
</el-form-item>
</el-form>
</el-form> -->
<el-table :data="tableData" border style="width: 100%; min-height: 200px;" :summary-method="getSummaries" show-summary :span-method="objectSpanMethod">
<el-table-column prop="title" label="题数">
<template slot-scope="scope">
<span>{{ '第'+scope.row.title + '题' }}</span>
</template>
</el-table-column>
<el-table-column prop="score" label="分值(分)" />
<el-table-column prop="goal" label="得分(分)" />
<el-table-column v-if="this.$route.query.type ==='theory'" prop="correctAnswer" label="正确答案" />
<el-table-column prop="title" label="题目" />
<el-table-column prop="score" label="分值" />
<el-table-column prop="goal" label="得分" />
<el-table-column v-if="this.$route.query.type ==='theory'" prop="correctAnswer" label="答题结果" />
<el-table-column v-if="this.$route.query.type ==='theory'" prop="explain" label="说明" />
<el-table-column v-if="this.$route.query.type ==='operate'" prop="scoringPointIndex" label="得分点">
<template slot-scope="scope">
@ -78,18 +74,10 @@ export default {
}
},
created() {
this.getResult();
},
mounted() {
this.submitExamData();
},
methods: {
async getResult() {
getCompetitionDetail(this.$route.query.raceId).then(res => {
console.log(res);
});
},
getSummaries(param) {
getSummaries(param) { //
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
@ -118,9 +106,21 @@ export default {
},
submitExamData() {
this.loading = false;
if (this.$route.query.type === 'theory') {
this.tableData = this.theoryData;
} else if (this.$route.query.type === 'operate') {
if (this.$route.query.type == 'theory') {
getCompetitionDetail(this.$route.query.raceId).then(res => {
console.log(res);
this.tableData = [];
res.data.forEach(item => {
this.tableData.push({
title: item.topic,
score: item.totalScore,
goal: item.score,
correctAnswer: item.correct ? '正确' : '错误',
explain: item.remarks
});
});
});
} else if (this.$route.query.type == 'operate') {
this.tableData = [];
this.operateData.forEach(item => {
if (item.scoringPoints && item.scoringPoints.length) {