|
|
@ -1,16 +1,24 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<!-- 赛事管理 --> |
|
|
|
<!-- 赛事管理 --> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<el-card shadow="hover" |
|
|
|
|
|
|
|
class="m-b-20"> |
|
|
|
<div class="flex-between"> |
|
|
|
<div class="flex-between"> |
|
|
|
<el-page-header @back="back" :content="name + '/管理'"></el-page-header> |
|
|
|
<el-page-header @back="back" |
|
|
|
|
|
|
|
:content="name + '/管理'"></el-page-header> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
<div class="page" style="margin-bottom: 24px"> |
|
|
|
<div class="page" |
|
|
|
|
|
|
|
style="margin-bottom: 24px"> |
|
|
|
<div class="tabs"> |
|
|
|
<div class="tabs"> |
|
|
|
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a> |
|
|
|
<a class="item" |
|
|
|
|
|
|
|
v-for="(item,index) in tabs" |
|
|
|
|
|
|
|
:key="index" |
|
|
|
|
|
|
|
:class="{active: index == active}" |
|
|
|
|
|
|
|
@click="tabChange(index)">{{ item }}</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<MatchDetail v-if="active == 'tab1'" ref="detail" /> |
|
|
|
<MatchDetail v-if="active == 'tab1'" |
|
|
|
|
|
|
|
ref="detail" /> |
|
|
|
<MatchArch v-if="active == 'tab2'" /> |
|
|
|
<MatchArch v-if="active == 'tab2'" /> |
|
|
|
<MatchProgress v-else-if="active == 'tab3'" /> |
|
|
|
<MatchProgress v-else-if="active == 'tab3'" /> |
|
|
|
<notice v-else-if="active == 'tab4'" /> |
|
|
|
<notice v-else-if="active == 'tab4'" /> |
|
|
@ -29,10 +37,10 @@ import notice from "./notice"; |
|
|
|
import MatchSignup from "./matchSignup"; |
|
|
|
import MatchSignup from "./matchSignup"; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "matchManage", |
|
|
|
name: "matchManage", |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
name: this.$route.query.name, |
|
|
|
name: this.$route.query.name, |
|
|
|
active: this.$route.query.tab || "tab1", |
|
|
|
active: this.$route.query.tab || '', |
|
|
|
tabs: { |
|
|
|
tabs: { |
|
|
|
tab1: "大赛详情", |
|
|
|
tab1: "大赛详情", |
|
|
|
tab2: "大赛成绩管理", |
|
|
|
tab2: "大赛成绩管理", |
|
|
@ -49,11 +57,11 @@ export default { |
|
|
|
notice, |
|
|
|
notice, |
|
|
|
MatchSignup |
|
|
|
MatchSignup |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
Setting.dynamicRoute && this.initTabs() |
|
|
|
Setting.dynamicRoute && this.initTabs() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
initTabs() { |
|
|
|
initTabs () { |
|
|
|
const btns = this.$store.state.btns |
|
|
|
const btns = this.$store.state.btns |
|
|
|
const tab1 = btns.includes('/match:管理:大赛详情') |
|
|
|
const tab1 = btns.includes('/match:管理:大赛详情') |
|
|
|
const tab2 = btns.includes('/match:管理:大赛成绩管理') |
|
|
|
const tab2 = btns.includes('/match:管理:大赛成绩管理') |
|
|
@ -69,13 +77,13 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
const type = this.$route.query.tab |
|
|
|
const type = this.$route.query.tab |
|
|
|
const keys = Object.keys(this.tabs) |
|
|
|
const keys = Object.keys(this.tabs) |
|
|
|
this.active = keys.includes(type) ? type : keys[0] |
|
|
|
if (keys.length) this.active = keys.includes(type) ? type : keys[0] |
|
|
|
}, |
|
|
|
}, |
|
|
|
back() { |
|
|
|
back () { |
|
|
|
this.handleSave(0) && this.backPage() |
|
|
|
this.handleSave(0) && this.backPage() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 判断是否需要confirm |
|
|
|
// 判断是否需要confirm |
|
|
|
handleSave(i) { |
|
|
|
handleSave (i) { |
|
|
|
// 如果是赛事详情,则要判断是否已经保存,未保存则提示是否保存 |
|
|
|
// 如果是赛事详情,则要判断是否已经保存,未保存则提示是否保存 |
|
|
|
if (this.active === 'tab1') { |
|
|
|
if (this.active === 'tab1') { |
|
|
|
const { detail } = this.$refs |
|
|
|
const { detail } = this.$refs |
|
|
@ -102,20 +110,20 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 返回列表 |
|
|
|
// 返回列表 |
|
|
|
backPage(){ |
|
|
|
backPage () { |
|
|
|
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`) |
|
|
|
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// tab切换 |
|
|
|
// tab切换 |
|
|
|
tabSwitch(i) { |
|
|
|
tabSwitch (i) { |
|
|
|
this.active = i |
|
|
|
this.active = i |
|
|
|
this.$router.push(`/matchManage?id=${this.$route.query.id}&tab=${i}&name=${this.name}`) |
|
|
|
this.$router.push(`/matchManage?id=${this.$route.query.id}&tab=${i}&name=${this.name}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 判断返回还是tab |
|
|
|
// 判断返回还是tab |
|
|
|
backOrTab(i) { |
|
|
|
backOrTab (i) { |
|
|
|
i ? this.tabSwitch(i) : this.backPage() |
|
|
|
i ? this.tabSwitch(i) : this.backPage() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// tab回调 |
|
|
|
// tab回调 |
|
|
|
tabChange(i) { |
|
|
|
tabChange (i) { |
|
|
|
this.handleSave(i) && this.tabSwitch(i) |
|
|
|
this.handleSave(i) && this.tabSwitch(i) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -123,5 +131,4 @@ export default { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
<style scoped> |
|
|
|
|
|
|
|
|
|
|
|
</style> |
|
|
|
</style> |