调整参赛人员路由判断

This commit is contained in:
zyy 2020-05-25 18:26:05 +08:00
parent ef9dc7c25e
commit dc33306c96
3 changed files with 47 additions and 33 deletions

View File

@ -75,7 +75,7 @@ export function getIsSignUp(raceId, params = {}) {
/** 分页查询竞赛报名人员 */
export function getRaceUserList(params) {
return request({
url: `/api/race/${params.raceId}/raceUser`,
url: `/api/race/${params.raceId}/raceUser/page`,
method: 'get',
params
});
@ -108,9 +108,9 @@ export function getCompetitionPractical(competitionId) {
}
/** 查询竞赛报名人员详情 */
export function getRaceUserById(raceId, userId) {
export function getRaceUserById(raceId) {
return request({
url: `/api/race/${raceId}/raceUser/${userId}`,
url: `/api/race/${raceId}/raceUser`,
method: 'get'
});
}

View File

@ -1,7 +1,7 @@
<template>
<div class="joylink-card">
<b class="title-name">{{ examType }}</b>
<img class="img_box" :src="applyImg" alt="">
<!-- <img class="img_box" :src="applyImg" alt=""> -->
<div class="btn-start">
<el-button :disabled="disabled" type="primary" @click="exmaStart">{{ $t('exam.startTheExam') }}</el-button>
</div>
@ -15,15 +15,16 @@ import LangStorage from '@/utils/lang';
import { getPublishMapInfo } from '@/api/jmap/map';
import ConstConfig from '@/scripts/ConstConfig';
import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { participantCreatTrainingRoom, getCompetitionPractical, getPracticalQuestion, getTheoryQuestion } from '@/api/competition';
import applyImg from '@/assets/apply.png';
import {getRaceUserById} from '@/api/competition';
import { participantCreatTrainingRoom, getPracticalQuestion, getTheoryQuestion } from '@/api/competition';
// import applyImg from '@/assets/apply.png';
export default {
name: 'ExamDetailView',
data() {
return {
disabled: false,
applyImg: applyImg,
// applyImg: applyImg,
examDetails: {
lessonId: '',
name: '',
@ -150,6 +151,8 @@ export default {
},
async exmaStart() {
if (this.$route.query.type == 'theory') {
const res = await getRaceUserById(this.$route.query.raceId);
if (res.data.status != 4 || res.data.status != 5) {
getTheoryQuestion(this.$route.query.raceId).then((resp)=>{
if (resp.data) {
this.$router.push(`/jsxt/theory/detail/${this.$route.query.mapId}?raceId=${this.$route.query.raceId}`);
@ -160,6 +163,11 @@ export default {
}).catch(()=>{
});
} else {
this.$router.replace({ path: `/jsxt/result`, query: { type: 'theory', raceId:this.$route.query.raceId } });
}
} else {
const res = await getRaceUserById(this.$route.query.raceId);
if (res.data.status != 4 || res.data.status != 6) {
getPracticalQuestion(this.$route.query.raceId).then((responese)=>{
if (responese.data) {
participantCreatTrainingRoom(this.$route.query.raceId, {mapId: 41, prdType: '02'}).then(resp => {
@ -171,8 +179,10 @@ export default {
} else {
this.$messageBox('试卷还没被加载');
}
});
} else {
this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId, type: 'operate', raceId:this.$route.query.raceId } });
}
}
}
}
@ -196,11 +206,15 @@ export default {
height: 100%;
}
.title-name{
position: absolute;
left: 50%;
top: 66px;
transform: translateX(-80px);
// position: absolute;
// left: 50%;
// top: 66px;
// transform: translateX(-80px);
font-size: 30px;
text-align: center;
width: 100%;
margin-top: 50px;
display: block;
}
}
.img_box{

View File

@ -365,7 +365,7 @@ export default {
// 01 02 ''
let resp = {data: {}};
if (this.project == 'jsxt' ) {
resp = await getRaceUserById(this.$route.query.raceId, this.userId);
resp = await getRaceUserById(this.$route.query.raceId);
resp.data.userRole = resp.data.role;
} else if (this.project == 'refereeJsxt') {
resp['code'] = 200;