From db25648ed29e0d5e3f4380f8c92790300efa61ce Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 3 Jun 2024 15:22:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E4=BA=8B=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 2 ++ src/pages/achievement/show/index.vue | 2 +- src/pages/match/add/step1.vue | 7 ++-- src/pages/match/add/step3.vue | 44 +++++++++++-------------- src/pages/match/manage/abnormalTeam.vue | 2 +- src/pages/match/manage/matchInfo.vue | 11 ++++--- src/pages/match/manage/matchSignup.vue | 16 ++++++--- src/pages/station/preview/index.vue | 4 +-- 8 files changed, 49 insertions(+), 39 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 39339bc..5a9747a 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -229,8 +229,10 @@ export default { TeamDataExportFailure: `${host}competition/competition/registration/exportFailure`, batchDeleteApplicants: `competition/competition/registration/batchDeleteApplicants`, deleteAllData: `competition/competition/registration/deleteAllData`, + whetherThereIsReport: `competition/competitionAutomaticAllocationRecord/whetherThereIsReport`, competionPersonTemplate: `https://huoran.oss-cn-shenzhen.aliyuncs.com/%E6%95%99%E5%B8%88%E7%AB%AF%E4%B8%AA%E4%BA%BA%E8%B5%9B%E6%8A%A5%E5%90%8D%E4%BA%BA%E5%91%98%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 教师端个人报名人员模板 competionTeamTemplate: `https://huoran.oss-cn-shenzhen.aliyuncs.com/%E6%95%99%E5%B8%88%E7%AB%AF%E5%9B%A2%E9%98%9F%E8%B5%9B%E6%8A%A5%E5%90%8D%E4%BA%BA%E5%91%98%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 教师端团队报名人员导入模板 + exportAbnormalData: `${host}competition/teamAbnormalInformation/exportAbnormalData`, // 赛事公告 addAnnouncement: `competition/competition/announcement/addAnnouncement`, diff --git a/src/pages/achievement/show/index.vue b/src/pages/achievement/show/index.vue index eb9d00f..e345841 100644 --- a/src/pages/achievement/show/index.vue +++ b/src/pages/achievement/show/index.vue @@ -219,7 +219,7 @@ export default { } }) e.lcStudentAnswer.map((n, i) => { - e.answer += `${i + 1}.${n.userAnswer};` + e.answer += `${i + 1}.${n.userAnswer || '未填写'};` }) }) } else { // python系统显示图片(从userScores里取) diff --git a/src/pages/match/add/step1.vue b/src/pages/match/add/step1.vue index d6d86fa..cc41e5d 100644 --- a/src/pages/match/add/step1.vue +++ b/src/pages/match/add/step1.vue @@ -290,7 +290,8 @@ export default { }, submiting: false, updateTime: 0, - quillShow: true + quillShow: true, + originSignUpEndTime: '', }; }, components: { @@ -384,6 +385,7 @@ export default { }) this.rangeName = range.join(',') } + this.originSignUpEndTime = competition.signUpEndTime this.form = competition this.$parent.resumeData() this.$nextTick(() => { @@ -625,11 +627,12 @@ export default { const now = await Util.getNow() // 报名结束之后修改的报名结束时间晚于当前现实时间的话,就调接口 - if (this.originSignUpEndTime && signUpEndTime !== this.originSignUpEndTime && new Date(signUpEndTime) < now) { + if (this.originSignUpEndTime && signUpEndTime !== this.originSignUpEndTime && (new Date(signUpEndTime) < now || (new Date(this.originSignUpEndTime) < now && new Date(signUpEndTime) > now))) { await this.$post(this.api.updateEventAllocationRecord, { competitionId: id, whetherToModifyTheRule: 1, }) + this.originSignUpEndTime = signUpEndTime } } }, diff --git a/src/pages/match/add/step3.vue b/src/pages/match/add/step3.vue index 32f7b04..395d227 100644 --- a/src/pages/match/add/step3.vue +++ b/src/pages/match/add/step3.vue @@ -311,7 +311,7 @@ export default { // 自动分配人员弹框 async autoAllocationConfirm (next) { const { data } = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.competitionId}`) - if (data.assignOrNot === undefined || !this.form[0].contentId) { + if (!data || data.assignOrNot === undefined || !this.form[0].contentId) { // 首次发布 or 新增 才需要弹框 this.$confirm('

团队赛发布成功,是否要自动分配阶段参赛人员?

(点击“是”将会在报名结束后给报名的团队自动分配阶段参赛人员

', '提示', { confirmButtonText: '是', @@ -325,31 +325,25 @@ export default { this.automaticAllocation(0, next) }) } else { - const now = await Util.getNow() - // 报名结束时间>当前时间 - if (new Date(this.$parent.$refs.step1.form.signUpEndTime) > now) { - this.$emit('next', next) - } else { - // 查询是否需要弹框 - const res = await this.$post(`${this.api.editWhetherPopUpsAppear}?competitionId=${this.competitionId}`) - if (res.popupState) { - this.$confirm('

团队赛发布成功,是否要重新自动分配阶段参赛人员?

(点击“是”将会立即给报名的团队自动分配阶段参赛人员

', '提示', { - confirmButtonText: '是', - cancelButtonText: '否', - type: 'success', - closeOnClickModal: false, - showClose: false, - dangerouslyUseHTMLString: true, - }).then(async () => { - await this.$post(`${this.api.automaticAllocation}?competitionId=${this.id}`) // 立马分配 - this.$emit('next', next) - }).catch(() => { - this.automaticAllocation(0, next) - }) - } else { - // 无需弹框 + // 查询是否需要弹框 + const res = await this.$post(`${this.api.editWhetherPopUpsAppear}?competitionId=${this.competitionId}`) + if (res.popupState) { + this.$confirm('

团队赛发布成功,是否要重新自动分配阶段参赛人员?

(点击“是”将会立即给报名的团队自动分配阶段参赛人员

', '提示', { + confirmButtonText: '是', + cancelButtonText: '否', + type: 'success', + closeOnClickModal: false, + showClose: false, + dangerouslyUseHTMLString: true, + }).then(async () => { + await this.$post(`${this.api.automaticAllocation}?competitionId=${this.id}`) // 立马分配 this.$emit('next', next) - } + }).catch(() => { + this.automaticAllocation(0, next) + }) + } else { + // 无需弹框 + this.$emit('next', next) } } }, diff --git a/src/pages/match/manage/abnormalTeam.vue b/src/pages/match/manage/abnormalTeam.vue index de1875e..bb2f54d 100644 --- a/src/pages/match/manage/abnormalTeam.vue +++ b/src/pages/match/manage/abnormalTeam.vue @@ -561,7 +561,7 @@ export default { this.exporting = false }) } else { - axios.get(`${this.api.excelExport}?competitionId=${this.id}`, { + axios.get(`${this.api.exportAbnormalData}?competitionId=${this.id}`, { headers: { token: this.token }, diff --git a/src/pages/match/manage/matchInfo.vue b/src/pages/match/manage/matchInfo.vue index 5fbfe15..c0abf53 100644 --- a/src/pages/match/manage/matchInfo.vue +++ b/src/pages/match/manage/matchInfo.vue @@ -6,7 +6,7 @@ - +
@@ -110,7 +110,7 @@ - 异常 @@ -230,6 +230,7 @@ export default { return { id: +this.$route.query.id, accountId: +this.$route.query.accountId, + loading: false, status: 5, form: { competitionStage: [], @@ -297,6 +298,7 @@ export default { }, methods: { getData () { + this.loading = true this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { this.form = competition this.timer = setInterval(this.handleStatus, 1000) @@ -336,6 +338,7 @@ export default { }) this.info = info this.form.completeCompetitionSetup.competitionType && this.getErrorInfo() + this.loading = false }).catch(err => { }); }, // 获取团队异常信息 @@ -345,7 +348,7 @@ export default { teamId: this.info.teamId }) this.teamErrors = res.teamTip.split(';').filter(e => e) - if (Object.keys(res.stageTip)) { + if (Object.keys(res.stageTip).length) { this.stageTip = res.stageTip } }, @@ -530,7 +533,7 @@ export default { this.chooses = this.info.teamDetail } this.curRow = row - this.checkedMembers = row.participants.map(e => e.id) + this.checkedMembers = row.participants ? row.participants.map(e => e.id) : [] this.chooseVisible = true } }, diff --git a/src/pages/match/manage/matchSignup.vue b/src/pages/match/manage/matchSignup.vue index ab6efad..2b512a1 100644 --- a/src/pages/match/manage/matchSignup.vue +++ b/src/pages/match/manage/matchSignup.vue @@ -18,7 +18,8 @@
{{ !notBeginSign && allocated ? '取消' : '' + :disabled="hasReport" :loading="allocating" @click="autoAllocationConfirm">{{ !notBeginSign && allocated ? + '取消' : '' }}自动分配阶段成员 导入 新增 @@ -287,6 +288,7 @@ export default { now: '', notBeginSign: true, allocated: true, + hasReport: false, allocating: false, loaded: 0, }; @@ -359,21 +361,27 @@ export default { // 团队赛才有自动分配 if (this.info.completeCompetitionSetup.competitionType) { - this.getAutomaticAllocation() - this.notBeginSign = this.now > new Date(this.info.signUpEndTime) // 是否在报名结束时间之前 // 判断当前处于报名结束前还是后,报名结束前显示:自动分配/取消分配。报名结束后显示:自动分配。 clearInterval(this.timer) this.now = await Util.getNow() + this.notBeginSign = this.now > new Date(this.info.signUpEndTime) // 是否在报名结束时间之前 + this.getAutomaticAllocation() this.timer = setInterval(() => { this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1)) this.notBeginSign = this.now > new Date(this.info.signUpEndTime) // 是否在报名结束时间之前 }, 1000) } }, - // 获取是否已分配 + // 查询分配状态 async getAutomaticAllocation () { + // 查询是否已分配 const res = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.id}`) this.allocated = res.data && res.data.assignOrNot + + // 查询赛事是否存在实验报告 + const res1 = await this.$post(`${this.api.whetherThereIsReport}?competitionId=${this.id}`) + this.hasReport = res1.hasReport + this.allocating = false this.loaded = 1 }, diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index 19aa710..d4c4056 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -978,8 +978,8 @@ $height: 700px; .entry { width: 100%; - height: 50px; - font-size: 18px; + height: 34px; + font-size: 17px; } .types {