|
|
|
@ -46,7 +46,7 @@ |
|
|
|
|
type="primary" |
|
|
|
|
@click="cancelPublish(1)">发布排名</el-button> |
|
|
|
|
<template v-else> |
|
|
|
|
<span style="margin-right: 10px">{{ publishTime }}发布排名</span> |
|
|
|
|
<span style="margin-right: 10px;white-space: nowrap;">{{ publishTime }}发布排名</span> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="cancelPublish(0)">取消发布</el-button> |
|
|
|
|
</template> |
|
|
|
@ -606,44 +606,15 @@ export default { |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
// 发布排名 |
|
|
|
|
publishSubmit () { |
|
|
|
|
if (this.type) { // 手动发布 |
|
|
|
|
this.$post(this.api.batchRelease, this.list.map(e => e.id)).then(res => { |
|
|
|
|
// this.getData() |
|
|
|
|
// util.successMsg('发布成功!') |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
} else { |
|
|
|
|
let data = [] // 手动上传后发布排名,数据直接取批量上传后返回的data |
|
|
|
|
if (!this.type) { // 默认排序 |
|
|
|
|
// 处理默认排序的数据 |
|
|
|
|
const { list, id } = this |
|
|
|
|
const isOverall = this.active ? 0 : 1 |
|
|
|
|
if (list.length) { |
|
|
|
|
const isPerson = this.competitionType == 0 |
|
|
|
|
list.map(e => { |
|
|
|
|
e.competitionId = id |
|
|
|
|
e.isOverallRanking = isOverall |
|
|
|
|
e.stageId = this.stageId |
|
|
|
|
// if (isOverall) delete e.stageId |
|
|
|
|
if (isPerson) e.teamId = null // 个人赛则teamId传null |
|
|
|
|
}) |
|
|
|
|
data = list |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
data.forEach(e => { |
|
|
|
|
e.publicationType = this.type |
|
|
|
|
async publishSubmit () { |
|
|
|
|
await this.$post(this.api.publishRanking, { |
|
|
|
|
competitionId: this.id, |
|
|
|
|
isOverallRanking: this.active ? 0 : 1, |
|
|
|
|
publicationType: this.type, |
|
|
|
|
releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime), |
|
|
|
|
stageId: this.active || this.stageId, |
|
|
|
|
}) |
|
|
|
|
const ids = this.grades.map(e => e.stageId) |
|
|
|
|
ids.pop() |
|
|
|
|
// 发布前校验 |
|
|
|
|
// this.$post(`${this.api.releaseVerification}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => { |
|
|
|
|
this.$post(this.api.publishRanking, data).then(res => { |
|
|
|
|
this.uploadData = [] |
|
|
|
|
// this.getData() |
|
|
|
|
// util.successMsg('发布成功!') |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
// }).catch(res => {}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 发布排名确认 |
|
|
|
|
publish () { |
|
|
|
@ -682,13 +653,13 @@ export default { |
|
|
|
|
if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!') |
|
|
|
|
|
|
|
|
|
this.publishSubmit() |
|
|
|
|
await this.$post(this.api.addCompetitionStageRankingTime, { |
|
|
|
|
competitionId: this.id, |
|
|
|
|
isOverallRanking: this.active ? 0 : 1, |
|
|
|
|
publicationType: this.type, |
|
|
|
|
stageId: this.active || this.stageId, |
|
|
|
|
releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime) |
|
|
|
|
}) |
|
|
|
|
// await this.$post(this.api.addCompetitionStageRankingTime, { |
|
|
|
|
// competitionId: this.id, |
|
|
|
|
// isOverallRanking: this.active ? 0 : 1, |
|
|
|
|
// publicationType: this.type, |
|
|
|
|
// stageId: this.active || this.stageId, |
|
|
|
|
// releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime) |
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
util.successMsg('发布成功') |
|
|
|
|
this.getData() |
|
|
|
@ -719,7 +690,7 @@ export default { |
|
|
|
|
// if (this.timeId) { |
|
|
|
|
// await this.$post(`${this.api.cancelCompetitionStageRankingTime}?competitionId=${this.id}&releaseId=${this.timeId}&isOverallRanking=${this.active ? 0 : 1}&stageId=${this.active || this.stageId}`) |
|
|
|
|
// } else { |
|
|
|
|
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}&releaseId=${this.timeId}`) |
|
|
|
|
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}&releaseId=${this.timeId}&publicationType=${this.type}`) |
|
|
|
|
// } |
|
|
|
|
this.sourceType = '' |
|
|
|
|
this.type = 0 |
|
|
|
@ -784,7 +755,7 @@ export default { |
|
|
|
|
async beforeUpload (file) { |
|
|
|
|
this.uploading = true |
|
|
|
|
if (this.list.length) { |
|
|
|
|
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}&releaseId=${this.timeId}`) |
|
|
|
|
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}&releaseId=${this.timeId}&publicationType=${this.type}`) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
beforeRemove (file, fileList) { |
|
|
|
|