|
|
|
@ -1,21 +1,53 @@ |
|
|
|
|
<template> |
|
|
|
|
<!-- 报名人员 --> |
|
|
|
|
<div class="page-content" style="padding: 24px"> |
|
|
|
|
<el-collapse v-model="curStep"> |
|
|
|
|
<el-collapse-item v-for="(item, i) in list" :key="i" :title="item.stageName" :name="item.stageId"> |
|
|
|
|
<div class="line"> |
|
|
|
|
<span>比赛方式:{{ item.methodName }}</span> |
|
|
|
|
<span>比赛形式:{{ item.competitionType ? '团队赛' : '个人赛' }}</span> |
|
|
|
|
<span>赛制:{{ item.ruleName }}</span> |
|
|
|
|
<span>状态:{{ item.status }}</span> |
|
|
|
|
<span>竞赛起止时间:{{ item.startTime + ' ~ ' + item.endTime }}</span> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" @click="toRank(item, i)">排名</el-button> |
|
|
|
|
<el-button @click="toArch(item)">成绩管理</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-collapse-item> |
|
|
|
|
</el-collapse> |
|
|
|
|
<div class="page-content" |
|
|
|
|
style="padding: 24px"> |
|
|
|
|
<el-table ref="table" |
|
|
|
|
:data="list" |
|
|
|
|
class="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center" |
|
|
|
|
row-key="stageId"> |
|
|
|
|
<el-table-column type="index" |
|
|
|
|
width="60" |
|
|
|
|
label="序号" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.$index + 1 }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="methodName" |
|
|
|
|
label="比赛方式" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="founderName" |
|
|
|
|
label="比赛形式" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.competitionType ? '团队赛' : '个人赛' }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="ruleName" |
|
|
|
|
label="赛制" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="status" |
|
|
|
|
label="状态" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column label="竞赛起止时间" |
|
|
|
|
align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
align="center" |
|
|
|
|
width="260"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="toRank(scope.row, scope.$index)">排名</el-button> |
|
|
|
|
<el-button @click="toArch(scope.row)">成绩管理</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -24,7 +56,7 @@ import util from "@/libs/util"; |
|
|
|
|
import Const from '@/const/match' |
|
|
|
|
export default { |
|
|
|
|
name: "matchArch", |
|
|
|
|
data() { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
id: +this.$route.query.id, |
|
|
|
|
list: [], |
|
|
|
@ -33,21 +65,21 @@ export default { |
|
|
|
|
curStep: [], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.$once('hook:beforeDestroy', function() { |
|
|
|
|
mounted () { |
|
|
|
|
this.$once('hook:beforeDestroy', function () { |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
}) |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getData() { |
|
|
|
|
getData () { |
|
|
|
|
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { |
|
|
|
|
this.form = competition |
|
|
|
|
this.timer = setInterval(this.handleStatus, 1000) |
|
|
|
|
this.getArch() |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}, |
|
|
|
|
getArch() { |
|
|
|
|
getArch () { |
|
|
|
|
this.$post(this.api.detailsOfCompetitionStage, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 100, |
|
|
|
@ -60,10 +92,10 @@ export default { |
|
|
|
|
}) |
|
|
|
|
this.curStep = list.map(e => e.stageId) |
|
|
|
|
this.list = list |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}).catch(res => { }); |
|
|
|
|
}, |
|
|
|
|
// 报名时间、比赛时间、状态处理 |
|
|
|
|
handleStatus() { |
|
|
|
|
handleStatus () { |
|
|
|
|
const now = new Date() |
|
|
|
|
this.form.competitionStage.map(e => { |
|
|
|
|
const startTime = new Date(e.startTime) |
|
|
|
@ -82,11 +114,11 @@ export default { |
|
|
|
|
console.log("🚀 ~ file: matchArch.vue:87 ~ handleStatus ~ this.status", this.list) |
|
|
|
|
}, |
|
|
|
|
// 排名 |
|
|
|
|
toRank(row, i) { |
|
|
|
|
toRank (row, i) { |
|
|
|
|
this.$router.push(`/matchRank?id=${this.id}&stageId=${row.stageId}&index=${i}&method=${row.method}&competitionType=${row.competitionType}&rule=${row.rule}`) |
|
|
|
|
}, |
|
|
|
|
// 成绩管理 |
|
|
|
|
toArch(row) { |
|
|
|
|
toArch (row) { |
|
|
|
|
this.$router.push(`/matchArchList?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}`) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|