From 2ba3b6e75dfdaf36307508c271aff0a94201ae88 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 21 Nov 2023 18:10:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/const/match.js | 2 +- src/views/match/manage/index.vue | 211 ++++++++++++++------------- src/views/match/manage/matchInfo.vue | 12 +- src/views/match/preview/index.vue | 6 +- 4 files changed, 114 insertions(+), 117 deletions(-) diff --git a/src/const/match.js b/src/const/match.js index 928ad4d..647fafe 100644 --- a/src/const/match.js +++ b/src/const/match.js @@ -28,7 +28,7 @@ }, { id: 2, - name: '线下' + name: '其它' } ], teamCalculationMethods: [ diff --git a/src/views/match/manage/index.vue b/src/views/match/manage/index.vue index f76eec9..3c8e24d 100644 --- a/src/views/match/manage/index.vue +++ b/src/views/match/manage/index.vue @@ -1,22 +1,30 @@ @@ -28,100 +36,99 @@ import MatchProgress from "./matchProgress"; import notice from "./notice"; import MatchSignup from "./matchSignup"; export default { - name: "matchManage", - data() { - return { - name: this.$route.query.name, - active: this.$route.query.tab || "tab1", - tabs: { - tab1: "大赛详情", - tab2: "大赛成绩管理", - tab3: "竞赛进展", - tab4: "公告通知", - tab5: "报名人员" - } - }; - }, - components: { - MatchDetail, - MatchArch, - MatchProgress, - notice, - MatchSignup + name: "matchManage", + data () { + return { + name: this.$route.query.name, + active: this.$route.query.tab || '', + tabs: { + tab1: "大赛详情", + tab2: "大赛成绩管理", + tab3: "竞赛进展", + tab4: "公告通知", + tab5: "报名人员" + } + }; + }, + components: { + MatchDetail, + MatchArch, + MatchProgress, + notice, + MatchSignup + }, + mounted () { + Setting.dynamicRoute && this.initTabs() + }, + methods: { + initTabs () { + const btns = this.$store.state.btns + const tab1 = btns.includes('/match:管理:大赛详情') + const tab2 = btns.includes('/match:管理:大赛成绩管理') + const tab3 = btns.includes('/match:管理:竞赛进展') + const tab4 = btns.includes('/match:管理:公告通知') + const tab5 = btns.includes('/match:管理:报名人员') + + tab1 || this.$delete(this.tabs, 'tab1') + tab2 || this.$delete(this.tabs, 'tab2') + tab3 || this.$delete(this.tabs, 'tab3') + tab4 || this.$delete(this.tabs, 'tab4') + tab5 || this.$delete(this.tabs, 'tab5') + + const type = this.$route.query.tab + const keys = Object.keys(this.tabs) + if (keys.length) this.active = keys.includes(type) ? type : keys[0] }, - mounted() { - Setting.dynamicRoute && this.initTabs() + back () { + this.handleSave(0) && this.backPage() }, - methods: { - initTabs() { - const btns = this.$store.state.btns - const tab1 = btns.includes('/match:管理:大赛详情') - const tab2 = btns.includes('/match:管理:大赛成绩管理') - const tab3 = btns.includes('/match:管理:竞赛进展') - const tab4 = btns.includes('/match:管理:公告通知') - const tab5 = btns.includes('/match:管理:报名人员') - - tab1 || this.$delete(this.tabs, 'tab1') - tab2 || this.$delete(this.tabs, 'tab2') - tab3 || this.$delete(this.tabs, 'tab3') - tab4 || this.$delete(this.tabs, 'tab4') - tab5 || this.$delete(this.tabs, 'tab5') - - const type = this.$route.query.tab - const keys = Object.keys(this.tabs) - this.active = keys.includes(type) ? type : keys[0] - }, - back() { - this.handleSave(0) && this.backPage() - }, - // 判断是否需要confirm - handleSave(i) { - // 如果是赛事详情,则要判断是否已经保存,未保存则提示是否保存 - if (this.active === 'tab1') { - const { detail } = this.$refs - if (detail) { - const step = detail.$refs['step' + detail.step] - if (detail.step < 4 && step && step.updateTime) { - this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', { - type: 'warning' - }).then(() => { - detail.save(1, 1) - this.backOrTab(i) - }).catch(() => { - this.backOrTab(i) - }) - } else { - this.backOrTab(i) - } - } else { + // 判断是否需要confirm + handleSave (i) { + // 如果是赛事详情,则要判断是否已经保存,未保存则提示是否保存 + if (this.active === 'tab1') { + const { detail } = this.$refs + if (detail) { + const step = detail.$refs['step' + detail.step] + if (detail.step < 4 && step && step.updateTime) { + this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', { + type: 'warning' + }).then(() => { + detail.save(1, 1) + this.backOrTab(i) + }).catch(() => { this.backOrTab(i) - } - return false + }) } else { - return true + this.backOrTab(i) } - }, - // 返回列表 - backPage(){ - this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`) - }, - // tab切换 - tabSwitch(i) { - this.active = i - this.$router.push(`/matchManage?id=${this.$route.query.id}&tab=${i}&name=${this.name}`) - }, - // 判断返回还是tab - backOrTab(i) { - i ? this.tabSwitch(i) : this.backPage() - }, - // tab回调 - tabChange(i) { - this.handleSave(i) && this.tabSwitch(i) + } else { + this.backOrTab(i) } + return false + } else { + return true + } + }, + // 返回列表 + backPage () { + this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`) + }, + // tab切换 + tabSwitch (i) { + this.active = i + this.$router.push(`/matchManage?id=${this.$route.query.id}&tab=${i}&name=${this.name}`) + }, + // 判断返回还是tab + backOrTab (i) { + i ? this.tabSwitch(i) : this.backPage() + }, + // tab回调 + tabChange (i) { + this.handleSave(i) && this.tabSwitch(i) } + } }; \ No newline at end of file diff --git a/src/views/match/manage/matchInfo.vue b/src/views/match/manage/matchInfo.vue index 3f6c1c9..70beaca 100644 --- a/src/views/match/manage/matchInfo.vue +++ b/src/views/match/manage/matchInfo.vue @@ -500,17 +500,7 @@ export default { }, // 显示转让队长 transfer () { - // 取每个阶段的开始结束时间,有任何阶段开始了都不能转让队长和踢出队员 - const now = new Date() - let start = 0 - for (const e of this.form.competitionStage) { - if (now >= new Date(e.startTime) && now <= new Date(e.endTime)) { - util.errorMsg('比赛已经开始,无法转让队长!') - start = 1 - break - } - } - if (!start) this.transferVisible = true + this.transferVisible = true }, // 转让队长提交 transferSubmit () { diff --git a/src/views/match/preview/index.vue b/src/views/match/preview/index.vue index fe7cbf4..0d4e722 100644 --- a/src/views/match/preview/index.vue +++ b/src/views/match/preview/index.vue @@ -69,16 +69,16 @@

线上地点:{{ rule.onlineAddress }}

线下地点:{{ rule.offlineAddress }}

-

阶段比赛结束后{{ rule.resultAnnouncementTime }}小时,公布阶段比赛成绩。

+

阶段比赛结束后{{ rule.resultAnnouncementTime }}小时,公布阶段比赛成绩。

晋级规则: