+ {{ '剩余时间:'+countdownTime }}
开始
提交
@@ -34,8 +35,9 @@ import { putJointTrainingSimulationUserNew} from '@/api/jointTraining';
import { EventBus } from '@/scripts/event-bus';
import { getSessionStorage } from '@/utils/auth';
import RealDevice from './menuDraft/realDevice';
-import { participantCompleteCompetition, refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
+import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
import { prefixIntrger } from '@/utils/date';
+import localStore from 'storejs';
export default {
name: 'MenuDemonJoint',
@@ -56,6 +58,10 @@ export default {
type: String,
required: true
},
+ countdownTime: {
+ type: String,
+ required: true
+ },
deviceCode: {
type: String,
default() {
@@ -315,6 +321,7 @@ export default {
},
startCompetition() {
startPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
+ this.$emit('startCounting');
this.jsStart = false;
}).catch(()=> {
this.$message.error('开始竞赛失败');
@@ -326,12 +333,7 @@ export default {
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
- submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
- // this.$router.go(-1);
- this.submit();
- }).catch(()=> {
- this.$message.error('提交试卷失败!');
- });
+ this.submit();
});
},
refeeEndCompetition() {
@@ -343,10 +345,13 @@ export default {
});
},
submit() {
- // this.$store.dispatch('exam/over').then(() => {
- // this.$store.dispatch('trainingList/clearTrainingList');
- this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId, type: 'operate', raceId:this.$route.query.raceId } });
- // });
+ submitPracticalCompetition(this.group, this.$route.query.raceId).then(resp => {
+ const storeKey = this.$store.state.user.id + '' + this.$route.query.raceId + 'practical';
+ localStore.remove(storeKey);
+ this.$router.replace({ path: `/jsxt/result`, query: { subSystem: this.$route.query.subSystem, mapId: this.$route.query.mapId, type: 'operate', raceId:this.$route.query.raceId } });
+ }).catch(()=> {
+ this.$message.error('提交试卷失败!');
+ });
}
}
};