竞赛修改

dev_review
yujialong 1 year ago
parent 2f2e521494
commit 2ba3b6e75d
  1. 2
      src/const/match.js
  2. 211
      src/views/match/manage/index.vue
  3. 12
      src/views/match/manage/matchInfo.vue
  4. 6
      src/views/match/preview/index.vue

@ -28,7 +28,7 @@
},
{
id: 2,
name: '线下'
name: '其它'
}
],
teamCalculationMethods: [

@ -1,22 +1,30 @@
<template>
<!-- 赛事管理 -->
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="back" :content="name + '/管理'"></el-page-header>
</div>
</el-card>
<div class="page" style="margin-bottom: 24px">
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
</div>
<MatchDetail v-if="active == 'tab1'" ref="detail" />
<MatchArch v-if="active == 'tab2'" />
<MatchProgress v-else-if="active == 'tab3'" />
<notice v-else-if="active == 'tab4'" />
<MatchSignup v-else-if="active == 'tab5'" />
</div>
<!-- 赛事管理 -->
<div>
<el-card shadow="hover"
class="m-b-20">
<div class="flex-between">
<el-page-header @back="back"
:content="name + '/管理'"></el-page-header>
</div>
</el-card>
<div class="page"
style="margin-bottom: 24px">
<div class="tabs">
<a class="item"
v-for="(item,index) in tabs"
:key="index"
:class="{active: index == active}"
@click="tabChange(index)">{{ item }}</a>
</div>
<MatchDetail v-if="active == 'tab1'"
ref="detail" />
<MatchArch v-if="active == 'tab2'" />
<MatchProgress v-else-if="active == 'tab3'" />
<notice v-else-if="active == 'tab4'" />
<MatchSignup v-else-if="active == 'tab5'" />
</div>
</div>
</template>
@ -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)
}
}
};
</script>
<style scoped>
</style>

@ -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 () {

@ -69,16 +69,16 @@
<p v-if="rule.onlineButton">线上地点{{ rule.onlineAddress }}</p>
<p v-if="rule.offlineButton">线下地点{{ rule.offlineAddress }}</p>
<template v-if="rule.method === 2">
<p>线下地点{{ rule.offlineAddress }}</p>
<p>比赛地点{{ rule.offlineAddress }}</p>
<p>比赛内容{{ rule.contentDescription }}</p>
<p>评分规则{{ rule.scoreRule }}</p>
</template>
<template v-if="form.completeCompetitionSetup.competitionType">
<p>团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p>
<p>每个团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p>
<p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p>
</template>
<p>阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p>
<p v-if="rule.resultAnnouncementTime != 0">阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p>
<div v-if="form.rule === 1"
class="flex">
<p>晋级规则</p>

Loading…
Cancel
Save