添加实操考试 结束生成分值流程

This commit is contained in:
zyy 2020-05-21 15:18:00 +08:00
parent 9827e8aae8
commit 81973b6967
4 changed files with 31 additions and 30 deletions

View File

@ -128,12 +128,12 @@ const CompetitionDetail = () => import('@/views/jsxt/competition/examDetail');
const CompetitionManage = () => import('@/views/jsxt/competition/index'); const CompetitionManage = () => import('@/views/jsxt/competition/index');
const CompetitionHome = () => import('@/views/jsxt/competition/home'); const CompetitionHome = () => import('@/views/jsxt/competition/home');
const Refereedetail = () => import('@/views/jsxt/competition/theory/quiz/index'); const Refereedetail = () => import('@/views/jsxt/competition/theory/quiz/index');
const JsxtExamResult = () => import('@/views/jsxt/competition/result');
const JsxtApply = () => import('@/views/jsxt/apply/index'); const JsxtApply = () => import('@/views/jsxt/apply/index');
// const theoryManage = () => import('@/views/jsxt/competition/theory/index'); // const theoryManage = () => import('@/views/jsxt/competition/theory/index');
const RefereeList = () => import('@/views/jsxt/refereeList/index'); const RefereeList = () => import('@/views/jsxt/refereeList/index');
const homeJsxt = () => import('@/views/jsxt/home/index'); const homeJsxt = () => import('@/views/jsxt/home/index');
const RecaList = () => import('@/views/jsxt/reca/list'); const RecaList = () => import('@/views/jsxt/reca/list');
const JsxtExamResult = () => import('@/views/jsxt/competition/result');
import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
@ -1005,7 +1005,7 @@ export const JSXT = [
} }
}, },
{ // 考试结果 { // 考试结果
path: 'result/:userExamId', path: 'result',
component: JsxtExamResult, component: JsxtExamResult,
hidden: true hidden: true
} }

View File

@ -5,7 +5,7 @@
</div> </div>
<div class="card_content"> <div class="card_content">
<el-scrollbar wrap-class="scrollbar-wrapper"> <el-scrollbar wrap-class="scrollbar-wrapper">
<p class="list-item"> <!-- <p class="list-item">
<span class="list-label">{{ $t('exam.examStartTime') +':' }}</span> <span class="list-label">{{ $t('exam.examStartTime') +':' }}</span>
<span v-if="examDetails.startTime" class="list-elem"> <span v-if="examDetails.startTime" class="list-elem">
{{ examDetails.startTime }} - {{ examDetails.endTime }}</span> {{ examDetails.startTime }} - {{ examDetails.endTime }}</span>
@ -39,7 +39,7 @@
<el-table-column prop="chapterIdLong" :label="this.$t('exam.totalScore')" /> <el-table-column prop="chapterIdLong" :label="this.$t('exam.totalScore')" />
</el-table> </el-table>
</p> </p>
</div> </div> -->
<div class="btn-start"> <div class="btn-start">
<el-button :disabled="disabled" type="primary" @click="exmaStart">{{ $t('exam.startTheExam') }}</el-button> <el-button :disabled="disabled" type="primary" @click="exmaStart">{{ $t('exam.startTheExam') }}</el-button>
</div> </div>

View File

@ -32,8 +32,8 @@
</div> </div>
</template> </template>
<script> <script>
import { submitExam } from '@/api/management/userexam'; // import { submitExam } from '@/api/management/userexam';
import { UrlConfig } from '@/scripts/ConstDic'; // import { UrlConfig } from '@/scripts/ConstDic';
export default { export default {
name: 'ExamResult', name: 'ExamResult',
@ -87,29 +87,30 @@ export default {
return sums; return sums;
}, },
submitExamData() { submitExamData() {
this.loading = true; // this.loading = true;
let count = 3; // let count = 3;
const userExamId = this.$route.params.userExamId; // const userExamId = this.$route.params.userExamId;
let interval = setInterval(() => { // let interval = setInterval(() => {
submitExam(userExamId).then(response => { // submitExam(userExamId).then(response => {
this.loading = false; this.loading = false;
this.resultModel = response.data; // this.resultModel = response.data;
clearInterval(interval); // clearInterval(interval);
interval = null; // interval = null;
}).catch(() => { // }).catch(() => {
if (count-- < 0) { // if (count-- < 0) {
this.loading = false; // this.loading = false;
clearInterval(interval); // clearInterval(interval);
interval = null; // interval = null;
this.$messageBox(this.$t('error.submitExamFailed')); // this.$messageBox(this.$t('error.submitExamFailed'));
} // }
}); // });
}, 1000); // }, 1000);
}, },
back() { back() {
const examId = this.resultModel.examId; const query = {type: 'operation', mapId: this.$route.query.mapId};
this.$router.push({path: `${UrlConfig.trainingPlatform.examDetail}/${examId}`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId }}); this.$router.push({path: `/jsxt/examDetail`, query: query});
// const examId = this.resultModel.examId;
// this.$router.push({path: `${UrlConfig.trainingPlatform.examDetail}/${examId}`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId }});
} }
} }
}; };

View File

@ -313,8 +313,8 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
participantCompleteCompetition(1, this.group).then(resp => { participantCompleteCompetition(1, this.group).then(resp => {
this.$router.go(-1); // this.$router.go(-1);
// this.submit(); this.submit();
}).catch(()=> { }).catch(()=> {
this.$message.success('提交试卷失败!'); this.$message.success('提交试卷失败!');
}); });
@ -323,7 +323,7 @@ export default {
submit() { submit() {
// this.$store.dispatch('exam/over').then(() => { // this.$store.dispatch('exam/over').then(() => {
// this.$store.dispatch('trainingList/clearTrainingList'); // this.$store.dispatch('trainingList/clearTrainingList');
this.$router.replace({ path: `/jsxt/result/${this.$route.query.userExamId}`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId } }); this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId } });
// }); // });
} }
} }