调整参赛人员路由判断

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,29 +151,38 @@ export default {
},
async exmaStart() {
if (this.$route.query.type == 'theory') {
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}`);
} else {
this.$messageBox('试卷还没被加载');
}
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}`);
} else {
this.$messageBox('试卷还没被加载');
}
}).catch(()=>{
});
}).catch(()=>{
});
} else {
this.$router.replace({ path: `/jsxt/result`, query: { type: 'theory', raceId:this.$route.query.raceId } });
}
} else {
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});
});
} else {
this.$messageBox('试卷还没被加载');
}
});
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 => {
// 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});
});
} 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;