This commit is contained in:
fan 2020-05-25 10:32:27 +08:00
commit 6012a5ce5c
9 changed files with 66 additions and 51 deletions

View File

@ -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'
});
}

View File

@ -47,6 +47,10 @@ function getRouteInfo(to) {
} else { } else {
const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : ''; const whitePage = PermissionParam[current_session] ? PermissionParam[current_session].whitePage : '';
loginPath = whitePage || loginPage; loginPath = whitePage || loginPage;
if (current_session && current_session.startsWith('jsxt') || current_session && current_session.startsWith('refereeJsxt')) {
const raceId = getSessionStorage('raceId'); // 登陆时候保存 竞赛id
loginPath = `${loginPath}?raceId=${raceId}`;
}
if (current_session && current_session.startsWith('design')) { if (current_session && current_session.startsWith('design')) {
removeToken(); removeToken();
} }

View File

@ -2,12 +2,11 @@ export function getBaseUrl() {
let BASE_API; let BASE_API;
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'; // BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 张赛 BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://192.168.3.82:9000'; // 杜康 // BASE_API = 'http://192.168.3.82:9000'; // 杜康
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
// BASE_API = 'http://b29z135112.zicp.vip'; // BASE_API = 'http://b29z135112.zicp.vip';
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康 // BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
// BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛 // BASE_API = 'http://2i38984j47.qicp.vip'; // 张赛

View File

@ -70,12 +70,12 @@ export default {
clickEvent(obj, data, ele) { clickEvent(obj, data, ele) {
if (obj.type === 'Map') { if (obj.type === 'Map') {
this.mapId = obj.id; 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') { } 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}); this.$router.push({path: `/jsxt/examDetail`, query: query});
} else if (obj.type === 'operation') { } 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}); this.$router.push({path: `/jsxt/examDetail`, query: query});
} }
} }

View File

@ -15,7 +15,7 @@ import LangStorage from '@/utils/lang';
import { getPublishMapInfo } from '@/api/jmap/map'; import { getPublishMapInfo } from '@/api/jmap/map';
import ConstConfig from '@/scripts/ConstConfig'; import ConstConfig from '@/scripts/ConstConfig';
import CMD from '@/scripts/cmdPlugin/CommandEnum'; import CMD from '@/scripts/cmdPlugin/CommandEnum';
import { participantCreatTrainingRoom } from '@/api/competition'; import { participantCreatTrainingRoom, getCompetitionTheory, getCompetitionPractical } from '@/api/competition';
import applyImg from '@/assets/apply.png'; import applyImg from '@/assets/apply.png';
export default { export default {
@ -150,13 +150,18 @@ export default {
}, },
async exmaStart() { async exmaStart() {
if (this.$route.query.type == 'theory') { 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}?raceId=${this.$route.query.raceId}`);
}).catch(()=>{
});
} else { } else {
// this.disabled = true; // this.disabled = true;
participantCreatTrainingRoom(1, {mapId: 41, prdType: '02'}).then(resp => { getCompetitionPractical(this.$route.query.raceId).then(()=>{
const query = { lineCode: '11', mapId: '41', group: resp.data, roomId: '385' }; participantCreatTrainingRoom(this.$route.query.raceId, {mapId: 41, prdType: '02'}).then(resp => {
const query = { lineCode: '11', mapId: '41', group: resp.data, roomId: '385', raceId: this.$route.query.raceId};
this.$router.replace({ path: `/jointTrainingNew`, query: query}); this.$router.replace({ path: `/jointTrainingNew`, query: query});
}); });
});
} }
} }
} }

View File

@ -125,7 +125,7 @@ export default {
} }
}, },
back() { back() {
const query = {type: 'operation', mapId: this.$route.query.mapId}; const query = {type: 'operation', mapId: this.$route.query.mapId, raceId:this.$route.query.raceId};
this.$router.push({path: `/jsxt/home`, query: query }); this.$router.push({path: `/jsxt/home`, query: query });
}, },
objectSpanMethod({ row, column, rowIndex, columnIndex }) { objectSpanMethod({ row, column, rowIndex, columnIndex }) {

View File

@ -26,6 +26,7 @@
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js'; // import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
// import WindowResizeHandler from '@/mixin/WindowResizeHandler'; // import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import Question from './question'; import Question from './question';
import {postCompetitionTheory} from '@/api/competition';
export default { export default {
components: { components: {
@ -155,7 +156,10 @@ export default {
doEnd() { doEnd() {
// console.log(''); // console.log('');
// this.$router.push({ path: `/jsxt/home`}); // this.$router.push({ path: `/jsxt/home`});
this.$router.push({ path: `/jsxt/result`, query: { type: 'theory' } }); const params = {competitionId:this.$route.query.raceId};
postCompetitionTheory(1, params).then(()=>{
this.$router.push({ path: `/jsxt/result`, query: { type: 'theory', raceId:this.$route.query.raceId } });
});
}, },
onSave(data) { onSave(data) {
console.log(data, '问答题'); console.log(data, '问答题');

View File

@ -6,8 +6,9 @@
</template> </template>
<script> <script>
import {refereeGetCompetitionList, refereeEnterSimulation} from '@/api/competition'; import { refereeEnterSimulation } from '@/api/competition';
import {getPermissionJointNew} from '@/api/jointTraining'; import {getPermissionJointNew} from '@/api/jointTraining';
import { getRaceUserList } from '@/api/competition';
// import QuestionList from './questionList'; // import QuestionList from './questionList';
export default { export default {
@ -36,38 +37,8 @@ export default {
} }
}, },
queryList: { queryList: {
data:[ data:[],
{ query: this.queryFunction,
name:'xxx',
mobile:'189xxxx0023',
organization:'xx企业',
department:'xx部门',
status:'01'
},
{
name:'xxx',
mobile:'189xxxx0023',
organization:'xx企业',
department:'xx部门',
status:'02'
},
{
name:'xxx',
mobile:'189xxxx0023',
organization:'xx企业',
department:'xx部门',
status:'03'
},
{
name:'xxx',
mobile:'189xxxx0023',
organization:'xx企业',
department:'xx部门',
status:'04',
score:80
}
],
// query: this.queryFunction,
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
@ -87,6 +58,10 @@ export default {
title: '部门', title: '部门',
prop: 'department' prop: 'department'
}, },
{
title: '报名时间',
prop: 'time'
},
{ {
title: '状态', title: '状态',
prop: 'status', prop: 'status',
@ -169,9 +144,9 @@ export default {
// //
queryFunction(params) { queryFunction(params) {
if (this.$route.query.raceId) { if (this.$route.query.raceId) {
params['id'] = this.$route.query.raceId; params['raceId'] = this.$route.query.raceId;
} }
return refereeGetCompetitionList(this.$route.query.raceId); return getRaceUserList(params);
}, },
handleClick(row) { handleClick(row) {
const group = row.room.group; const group = row.room.group;

View File

@ -339,6 +339,7 @@ export default {
if (this.$route.path.includes('jsxt/login')) { if (this.$route.path.includes('jsxt/login')) {
getIsSignUp(this.$route.query.raceId).then(res => { getIsSignUp(this.$route.query.raceId).then(res => {
if (res.data) { if (res.data) {
setSessionStorage('raceId', this.$route.query.raceId);
this.$router.push({ path: this.path, query:{ raceId:this.$route.query.raceId } }); this.$router.push({ path: this.path, query:{ raceId:this.$route.query.raceId } });
} else { } else {
this.$messageBox('您未报名该竞赛,所以无法进入竞赛系统'); this.$messageBox('您未报名该竞赛,所以无法进入竞赛系统');
@ -347,6 +348,7 @@ export default {
this.$messageBox('您未报名该竞赛,所以无法进入竞赛系统'); this.$messageBox('您未报名该竞赛,所以无法进入竞赛系统');
}); });
} else { } else {
setSessionStorage('raceId', this.$route.query.raceId);
this.$router.push({ path: this.path, query:{ raceId:this.$route.query.raceId } }); this.$router.push({ path: this.path, query:{ raceId:this.$route.query.raceId } });
} }
} else if (!this.$route.path.includes('jsxt/login') && !this.$route.path.includes('refereeJsxt/login')) { } else if (!this.$route.path.includes('jsxt/login') && !this.$route.path.includes('refereeJsxt/login')) {