From 82b2f701ad44e5e08b2d69cbdbcd53608b1cd762 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Sun, 29 Sep 2024 10:12:02 +0800 Subject: [PATCH] fix --- src/pages/match/details/index.vue | 2 +- src/pages/match/list/index.vue | 5 ++-- src/pages/match/theoryExam/index.vue | 45 +++++++++++++++------------- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/pages/match/details/index.vue b/src/pages/match/details/index.vue index 85411ae..318a5ba 100644 --- a/src/pages/match/details/index.vue +++ b/src/pages/match/details/index.vue @@ -966,7 +966,7 @@ export default { } else { info.isCaption = info.team.caption } - const caption = info.teamDetail.find(e => !e.caption) + const caption = info.teamDetail.find(e => !e.captain) info.caption = caption ? caption : {} info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId) if (info.person) this.curRealSchoolId = info.person.realSchoolId diff --git a/src/pages/match/list/index.vue b/src/pages/match/list/index.vue index a0533ce..5c4fa79 100644 --- a/src/pages/match/list/index.vue +++ b/src/pages/match/list/index.vue @@ -816,8 +816,9 @@ export default { - initOss () { - this.client = new OSS(OssConfig.config) + async initOss () { + const o = await OssConfig() + this.client = new OSS(o.config) }, // 附件上传前 beforeUpload (file) { diff --git a/src/pages/match/theoryExam/index.vue b/src/pages/match/theoryExam/index.vue index d37e8a9..adadcaf 100644 --- a/src/pages/match/theoryExam/index.vue +++ b/src/pages/match/theoryExam/index.vue @@ -240,10 +240,7 @@ export default { // 如果已经结束 if (now >= endTime) { this.loading = false - this.$alert('竞赛时间已到,系统已自动交卷', '提示', { - confirmButtonText: '确定' - }) - this.submit(1) + this.submit(1, 1) } else { // 没结束,则显示倒计时 this.countVal = (endTime - now) / 1000 load && this.getPaper(now) @@ -390,11 +387,7 @@ export default { if (counterTime <= 0) { if (this.per) { // 竞赛/考核 clearInterval(this.counterTimer) - this.$alert(`${this.per == 2 ? '竞赛' : '考核'}时间已到,系统已自动交卷`, '提示', { - confirmButtonText: '确定', - type: 'warning' - }) - this.submit(1) + this.submit(1, 1) } else { this.handleCounter(counterTime, 1) } @@ -620,7 +613,7 @@ export default { } catch (e) { } }, // 提交 - async submit (isSubmit) { + async submit (isSubmit, autoSubmit) { if (isSubmit && this.submiting) return false try { if (isSubmit) this.submiting = true @@ -663,13 +656,11 @@ export default { paperId: curStage.paperId, examSubmitJudgeList: ques, } - // if (isSubmit) { const now = isSubmit ? await Util.getNow() : new Date() const submitTime = Util.formatDate('yyyy-MM-dd hh:mm:ss', now) data.endTime = this.per ? curStage.endTime : submitTime data.submitTime = submitTime data.timeSum = Math.ceil((now - entryTime) / 60000) // 计算实验用时(分钟),向上取整 - // } // 缓存跟提交接口的参数一样 await this.$post(this.api[isSubmit ? 'submitTheExamPaper' : 'examPaperRecordCache'], data) @@ -679,20 +670,32 @@ export default { clearInterval(this.counterTimer) this.submiting = false this.submited = true - // 如果是竞赛,并且勾选了公布成绩详情的选项,则弹框提示 - if (this.id) { - const time = curStage.resultAnnouncementTime - const msg = - time === 0 ? '提交成功!成绩将在比赛结束后公布,请前往参赛信息模块查看' : time > 0 ? `提交成功!成绩将在比赛结束后${time}小时公布,请前往参赛信息模块查看` : '提交成功'; - this.$alert(msg, '提示', { + + // 如果是时间到了自动提交,则提交完不弹框,直接关闭页面 + if (autoSubmit) { + this.$alert(`${this.per == 2 ? '竞赛' : '考核'}时间已到,系统已自动交卷`, '提示', { confirmButtonText: '确定', - type: 'success', - callback: () => { + type: 'warning', + callback: _ => { this.close() } }) } else { - this.$message.success('提交成功!') + // 如果是竞赛,并且勾选了公布成绩详情的选项,则弹框提示 + if (this.id) { + const time = curStage.resultAnnouncementTime + const msg = + time === 0 ? '提交成功!成绩将在比赛结束后公布,请前往参赛信息模块查看' : time > 0 ? `提交成功!成绩将在比赛结束后${time}小时公布,请前往参赛信息模块查看` : '提交成功'; + this.$alert(msg, '提示', { + confirmButtonText: '确定', + type: 'success', + callback: () => { + this.close() + } + }) + } else { + this.$message.success('提交成功!') + } } } } catch (e) {