diff --git a/src/api/contest.js b/src/api/contest.js index 10aaa2467..c5013e53c 100644 --- a/src/api/contest.js +++ b/src/api/contest.js @@ -329,3 +329,22 @@ export function getTaskTree(paperId, moduleId) { method: 'get' }); } + +/** 竞赛开始训练 + * @param {String} paperId 试卷id + * @param {String} moduleId 模块id + */ +export function beginContestExercise(paperId, moduleId) { + return request({ + url: `/api/race/${paperId}/${moduleId}`, + method: 'POST' + }); +} + +/** 竞赛完成训练 */ +export function finishContestExercise() { + return request({ + url: '/api/race/finish', + method: 'PUT' + }); +} diff --git a/src/api/race.js b/src/api/race.js index c5f6bc3ef..43e444dd8 100644 --- a/src/api/race.js +++ b/src/api/race.js @@ -15,3 +15,20 @@ export function selectQuestionTypeNum(companyId) { method: 'get' }); } + +/** 加载场景 */ +export function loadRace(simulationId, sceneId) { + return request({ + url: `/api/race/${simulationId}/load/${sceneId}`, + method: 'put' + }); + +} +/** 完成任务 */ +export function overTask(taskId, data) { + return request({ + url: `/api/race/${taskId}/finish`, + method: 'put', + data + }); +} diff --git a/src/scripts/cmdPlugin/newValidateHandler.js b/src/scripts/cmdPlugin/newValidateHandler.js index 11435304f..c4ce288c8 100644 --- a/src/scripts/cmdPlugin/newValidateHandler.js +++ b/src/scripts/cmdPlugin/newValidateHandler.js @@ -84,8 +84,9 @@ class ValidateHandler { valid = ((operate.val).toString() === stepOperation.val.toString()) && valid; } const opParam = operate.param === undefined ? {} : operate.param; + const stepParam = stepOperation.params === undefined ? {} : stepOperation.params; if ((opParam || stepOperation.params) && !opParam.hasOwnProperty('fileBase64Str')) { - valid = this.checkParamConsistent(opParam, stepOperation.params, operate.operation) && valid; + valid = this.checkParamConsistent(opParam, stepParam, operate.operation) && valid; } if (valid && store.state.trainingNew.voiceStepIndex > -1) { diff --git a/src/store/modules/trainingNew.js b/src/store/modules/trainingNew.js index 6301a8d56..8f0dec7b1 100644 --- a/src/store/modules/trainingNew.js +++ b/src/store/modules/trainingNew.js @@ -21,7 +21,8 @@ const training = { voiceStepIndex: -1, examSwitch: false, // 考试开始结束标注 stepRecord: [], // 操作记录 - joinTrainingInfo: null + joinTrainingInfo: null, + isRecord: false }, getters: { teachMode: (state) => { @@ -131,6 +132,9 @@ const training = { }, setJoinTrainingInfo: (state, joinTrainingInfo) => { state.joinTrainingInfo = joinTrainingInfo; + }, + setIsRecord: (state, flag) => { + state.isRecord = flag; } }, actions: { @@ -234,6 +238,9 @@ const training = { }, setJoinTrainingInfo: ({ commit }, joinTrainingInfo ) => { commit('setJoinTrainingInfo', joinTrainingInfo); + }, + setIsRecord: ({ commit }, flag) => { + commit('setIsRecord', flag); } } }; diff --git a/src/views/contest/ScoringSettlement.vue b/src/views/contest/ScoringSettlement.vue index 306518861..919bd8a88 100644 --- a/src/views/contest/ScoringSettlement.vue +++ b/src/views/contest/ScoringSettlement.vue @@ -1,13 +1,86 @@ - diff --git a/src/views/contest/contestDetail.vue b/src/views/contest/contestDetail.vue index e9b3254b9..b05d5b2d6 100644 --- a/src/views/contest/contestDetail.vue +++ b/src/views/contest/contestDetail.vue @@ -42,9 +42,9 @@
- 评分表 + 评分表 开始任务 - 下一任务 + 下一任务
@@ -154,6 +154,8 @@ export default { project: 'dsxl', paperId: this.$route.query.paperId, moduleId: this.$route.query.moduleId, + sceneId: this.nowData.sceneId, + taskId: this.nowData.id, nowKey: this.nowKey }; this.$router.push({ path: '/display/demon', query: query }); diff --git a/src/views/contest/contestList.vue b/src/views/contest/contestList.vue index 316cd728e..f9e616eb3 100644 --- a/src/views/contest/contestList.vue +++ b/src/views/contest/contestList.vue @@ -45,7 +45,7 @@ import paperList from './paperList'; import drapLeft from '@/views/components/drapLeft/index'; import ScoreRule from './scoreRule'; -import { getPaperDetail, getContextScoreDetail} from '@/api/contest'; +import { getPaperDetail, getContextScoreDetail, beginContestExercise} from '@/api/contest'; let id = 1; export default { @@ -64,7 +64,6 @@ export default { moduleList:[], moduleTreeDatas:[], taskTreeDatas:[], - ruleData:[], defaultProps: { disabled: true } @@ -100,9 +99,6 @@ export default { }; }); this.taskTreeDatas = this.moduleTreeDatas[0].children; - getContextScoreDetail(this.moduleTreeDatas[0].moduleScoreRuleId).then(res => { - this.ruleData = res.data.rule ? res.data.rule.units : []; - }).catch(() => { this.ruleData = []; }); }).catch(error => { this.$message.error(error.message); }); @@ -111,7 +107,11 @@ export default { this.$refs.scoreRule.doShow(moduleScoreRuleId); }, beginExercise(moduleId) { - this.$router.push({path: '/contest/detail', query:{paperId:this.paperId, moduleId }}); + beginContestExercise(this.paperId, moduleId).then(res => { + this.$router.push({path: '/contest/detail', query:{paperId:this.paperId, moduleId }}); + }).catch(error => { + this.$message.error(error.message); + }); }, transformTree(data) { const result = {label:data.name, children:[], id:id++, type:'taskCatalog' }; diff --git a/src/views/contest/scoreRule.vue b/src/views/contest/scoreRule.vue index 7d868a5a3..808f2c4f9 100644 --- a/src/views/contest/scoreRule.vue +++ b/src/views/contest/scoreRule.vue @@ -38,7 +38,7 @@ export default { getContextScoreDetail(id).then(resp => { this.tableData = resp.data.rule ? resp.data.rule.units : []; this.loading = false; - }).catch(() => { this.$message.error('初始化数据失败!'); this.loading = false; this.tableData = []; }); + }).catch(() => { this.loading = false; this.tableData = []; }); }, handleClose() { this.dialogVisible = false; diff --git a/src/views/newMap/chatView/chatBox.vue b/src/views/newMap/chatView/chatBox.vue index 8227cd99c..f3fbccbc0 100644 --- a/src/views/newMap/chatView/chatBox.vue +++ b/src/views/newMap/chatView/chatBox.vue @@ -247,7 +247,7 @@ export default { } }, isRecord() { - return !!this.$route.query.record; + return !!this.$store.state.trainingNew.record; } }, watch:{ diff --git a/src/views/newMap/chatView/voiceChatBox.vue b/src/views/newMap/chatView/voiceChatBox.vue index 398ff7461..04663d4c2 100644 --- a/src/views/newMap/chatView/voiceChatBox.vue +++ b/src/views/newMap/chatView/voiceChatBox.vue @@ -31,7 +31,7 @@