|
|
@ -73,7 +73,12 @@ |
|
|
|
<tr v-for="(item, i) in teams" :key="i"> |
|
|
|
<tr v-for="(item, i) in teams" :key="i"> |
|
|
|
<template v-if="!active && item.rowspan"> |
|
|
|
<template v-if="!active && item.rowspan"> |
|
|
|
<td :rowspan="item.rowspan">{{ item.stageName }}</td> |
|
|
|
<td :rowspan="item.rowspan">{{ item.stageName }}</td> |
|
|
|
<td :rowspan="item.rowspan">{{ item.teamScore }}</td> |
|
|
|
<td class="scores" :rowspan="item.rowspan"> |
|
|
|
|
|
|
|
<p class="score">{{ item.teamScore }}</p> |
|
|
|
|
|
|
|
<p>{{ item.teamCalculationMethodName }}</p> |
|
|
|
|
|
|
|
<p>权重:</p> |
|
|
|
|
|
|
|
<p>{{ item.pointWeight }}%</p> |
|
|
|
|
|
|
|
</td> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<td>{{ i + 1 }}</td> |
|
|
|
<td>{{ i + 1 }}</td> |
|
|
|
<td>{{ item.userName }}</td> |
|
|
|
<td>{{ item.userName }}</td> |
|
|
@ -90,7 +95,7 @@ |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<tr v-if="!active && teams.length"> |
|
|
|
<tr v-if="!active && teams.length"> |
|
|
|
<td>综合得分</td> |
|
|
|
<td>综合得分</td> |
|
|
|
<td>{{ totalScore }}</td> |
|
|
|
<td>{{ curRow.score }}</td> |
|
|
|
<td colspan="6">总排名:第{{ curRow.index }}名</td> |
|
|
|
<td colspan="6">总排名:第{{ curRow.index }}名</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
</table> |
|
|
@ -149,6 +154,20 @@ export default { |
|
|
|
method: this.$route.query.method, |
|
|
|
method: this.$route.query.method, |
|
|
|
competitionType: +this.$route.query.competitionType, |
|
|
|
competitionType: +this.$route.query.competitionType, |
|
|
|
rule: +this.$route.query.rule, |
|
|
|
rule: +this.$route.query.rule, |
|
|
|
|
|
|
|
teamCalculationMethods: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 0, |
|
|
|
|
|
|
|
name: '最高分' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
name: '平均分' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 2, |
|
|
|
|
|
|
|
name: '求和' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
|
token: sessionStorage.getItem("token") |
|
|
|
token: sessionStorage.getItem("token") |
|
|
|
}, |
|
|
|
}, |
|
|
@ -279,8 +298,13 @@ export default { |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const ids = this.grades.map(e => e.stageId) |
|
|
|
const ids = this.grades.map(e => e.stageId) |
|
|
|
data.stageIds = ids.splice(0, ids.length - 1) |
|
|
|
ids.pop() |
|
|
|
this.$post(this.api.detailsOfTotalTeamScores, data).then(({ data, resultCalculationMethod }) => { |
|
|
|
data.stageIds = ids.splice(0, this.index + 1) |
|
|
|
|
|
|
|
// 发布跟没发布调不同的接口 |
|
|
|
|
|
|
|
// if (this.published) { |
|
|
|
|
|
|
|
this.$post(this.api.totalRankingScoreDetails, data).then(({ data }) => { |
|
|
|
|
|
|
|
if (data.length && data[0].stageTeamInformation.length) { |
|
|
|
|
|
|
|
const resultCalculationMethod = data[0].stageTeamInformation[0].resultCalculationMethod |
|
|
|
const result = [] |
|
|
|
const result = [] |
|
|
|
let totalScore = 0 |
|
|
|
let totalScore = 0 |
|
|
|
// 合并数据 |
|
|
|
// 合并数据 |
|
|
@ -300,10 +324,14 @@ export default { |
|
|
|
score = scores.reduce((prev, next) => prev + next) |
|
|
|
score = scores.reduce((prev, next) => prev + next) |
|
|
|
} |
|
|
|
} |
|
|
|
team[0].teamScore = score |
|
|
|
team[0].teamScore = score |
|
|
|
|
|
|
|
const teamCItem = this.teamCalculationMethods.find(n => n.id == e.teamCalculationMethod) |
|
|
|
|
|
|
|
if (teamCItem) team[0].teamCalculationMethodName = teamCItem.name |
|
|
|
team[0].rowspan = team.length |
|
|
|
team[0].rowspan = team.length |
|
|
|
team.map(n => { |
|
|
|
team.map(n => { |
|
|
|
n = Object.assign(n, e) |
|
|
|
n = Object.assign(n, e) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
console.log("🚀 ~ file: matchRank.vue:334 ~ this.$post ~ resultCalculationMethod", resultCalculationMethod, score) |
|
|
|
|
|
|
|
|
|
|
|
// 计算权重(权重为0则不计入总成绩) 团队得分*权重/100 总成绩计算方式选的是加权求和才需要计算 |
|
|
|
// 计算权重(权重为0则不计入总成绩) 团队得分*权重/100 总成绩计算方式选的是加权求和才需要计算 |
|
|
|
if (e.pointWeight && !resultCalculationMethod) totalScore += score * e.pointWeight / 100 |
|
|
|
if (e.pointWeight && !resultCalculationMethod) totalScore += score * e.pointWeight / 100 |
|
|
|
result.push(...team) |
|
|
|
result.push(...team) |
|
|
@ -311,6 +339,7 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
// 根据总成绩计算方式计算总分 |
|
|
|
// 根据总成绩计算方式计算总分 |
|
|
|
const teamScores = data.map(e => e.teamScore) |
|
|
|
const teamScores = data.map(e => e.teamScore) |
|
|
|
|
|
|
|
console.log("🚀 ~ file: matchRank.vue:339 ~ this.$post ~ teamScores", teamScores, totalScore) |
|
|
|
if (resultCalculationMethod === 1) { // 求和 |
|
|
|
if (resultCalculationMethod === 1) { // 求和 |
|
|
|
totalScore = teamScores.reduce((prev, next) => prev + next) |
|
|
|
totalScore = teamScores.reduce((prev, next) => prev + next) |
|
|
|
} else if (resultCalculationMethod === 2) { // 平均分 |
|
|
|
} else if (resultCalculationMethod === 2) { // 平均分 |
|
|
@ -318,7 +347,33 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
this.totalScore = totalScore |
|
|
|
this.totalScore = totalScore |
|
|
|
this.teams = result |
|
|
|
this.teams = result |
|
|
|
|
|
|
|
} |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
// } else { // 没发布 |
|
|
|
|
|
|
|
// this.$post(this.api.totalRankingScoreDetails, data).then(({ page }) => { |
|
|
|
|
|
|
|
// const list = page.records |
|
|
|
|
|
|
|
// page.records.map((e, i) => { |
|
|
|
|
|
|
|
// if (!list.find(n => n.stageId == e.stageId && n.rowspan)) { |
|
|
|
|
|
|
|
// e.rowspan = list.filter(n => n.stageId == e.stageId).length |
|
|
|
|
|
|
|
// this.$post(this.api.stageTeamScoreDetails, { |
|
|
|
|
|
|
|
// pageNum: 1, |
|
|
|
|
|
|
|
// pageSize: 100, |
|
|
|
|
|
|
|
// competitionId: this.id, |
|
|
|
|
|
|
|
// teamId: row.teamId, |
|
|
|
|
|
|
|
// stageId: e.stageId |
|
|
|
|
|
|
|
// }).then(({ page }) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }).catch(res => {}) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// let totalScore = 0 |
|
|
|
|
|
|
|
// this.totalScore = totalScore |
|
|
|
|
|
|
|
// this.teams = list |
|
|
|
|
|
|
|
// console.log("🚀 ~ file: matchRank.vue:346 ~ this.$post ~ list", list) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }).catch(res => {}) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.toReport(row) |
|
|
|
this.toReport(row) |
|
|
@ -477,5 +532,13 @@ export default { |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
background-color: #f8faff; |
|
|
|
background-color: #f8faff; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.scores { |
|
|
|
|
|
|
|
line-height: 1.6; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.score { |
|
|
|
|
|
|
|
font-size: 16px; |
|
|
|
|
|
|
|
font-weight: 600; |
|
|
|
|
|
|
|
color: #9076FF; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |