竞赛代码调整
This commit is contained in:
parent
c00e502320
commit
0f3520a8e3
@ -80,3 +80,29 @@ export function getRaceUserList(params) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 分页查询理论题列表 */
|
||||
export function getCompetitionTheory(params) {
|
||||
return request({
|
||||
url: `/api/v1/competitionTheory`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交试卷 */
|
||||
export function postCompetitionTheory(theoryId, data) {
|
||||
return request({
|
||||
url: `/api/v1/competitionTheory/${theoryId}/submit`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询用户是否已经报名该竞赛 */
|
||||
export function getCompetitionPractical(competitionId) {
|
||||
return request({
|
||||
url: `/api/v1/competitionPractical/competition/${competitionId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -70,12 +70,12 @@ export default {
|
||||
clickEvent(obj, data, ele) {
|
||||
if (obj.type === 'Map') {
|
||||
this.mapId = obj.id;
|
||||
this.$router.push({ path: `/jsxt/home`});
|
||||
this.$router.push({ path: `/jsxt/home`, query:{raceId:this.$route.query.raceId}});
|
||||
} else if (obj.type === 'theory') {
|
||||
const query = {type: 'theory', mapId: this.mapId};
|
||||
const query = {type: 'theory', mapId: this.mapId, raceId:this.$route.query.raceId};
|
||||
this.$router.push({path: `/jsxt/examDetail`, query: query});
|
||||
} else if (obj.type === 'operation') {
|
||||
const query = {type: 'operation', mapId: this.mapId};
|
||||
const query = {type: 'operation', mapId: this.mapId, raceId:this.$route.query.raceId};
|
||||
this.$router.push({path: `/jsxt/examDetail`, query: query});
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import LangStorage from '@/utils/lang';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import { participantCreatTrainingRoom } from '@/api/competition';
|
||||
import { participantCreatTrainingRoom, getCompetitionTheory, getCompetitionPractical } from '@/api/competition';
|
||||
import applyImg from '@/assets/apply.png';
|
||||
|
||||
export default {
|
||||
@ -150,12 +150,17 @@ export default {
|
||||
},
|
||||
async exmaStart() {
|
||||
if (this.$route.query.type == 'theory') {
|
||||
this.$router.push(`/jsxt/theory/detail/${this.$route.query.mapId}`);
|
||||
getCompetitionTheory({competitionId:this.$route.query.raceId}).then(()=>{
|
||||
this.$router.push(`/jsxt/theory/detail/${this.$route.query.mapId}`);
|
||||
}).catch(()=>{
|
||||
});
|
||||
} else {
|
||||
// this.disabled = true;
|
||||
participantCreatTrainingRoom(1, {mapId: 41, prdType: '02'}).then(resp => {
|
||||
const query = { lineCode: '11', mapId: '41', group: resp.data, roomId: '385' };
|
||||
this.$router.replace({ path: `/jointTrainingNew`, query: query});
|
||||
getCompetitionPractical(this.$route.query.raceId).then(()=>{
|
||||
participantCreatTrainingRoom(1, {mapId: 41, prdType: '02'}).then(resp => {
|
||||
const query = { lineCode: '11', mapId: '41', group: resp.data, roomId: '385' };
|
||||
this.$router.replace({ path: `/jointTrainingNew`, query: query});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
|
||||
// import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import Question from './question';
|
||||
import {postCompetitionTheory} from '@/api/competition';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -155,7 +156,9 @@ export default {
|
||||
doEnd() {
|
||||
// console.log('考试成绩');
|
||||
// this.$router.push({ path: `/jsxt/home`});
|
||||
this.$router.push({ path: `/jsxt/result`, query: { type: 'theory' } });
|
||||
postCompetitionTheory(1, {competitionId:this.$route.query.raceId}).then(()=>{
|
||||
this.$router.push({ path: `/jsxt/result`, query: { type: 'theory', raceId:this.$route.query.raceId } });
|
||||
});
|
||||
},
|
||||
onSave(data) {
|
||||
console.log(data, '问答题');
|
||||
|
Loading…
Reference in New Issue
Block a user