|
|
@ -46,7 +46,7 @@ |
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
|
@click="cancelPublish(1)">发布排名</el-button> |
|
|
|
@click="cancelPublish(1)">发布排名</el-button> |
|
|
|
<template v-else> |
|
|
|
<template v-else> |
|
|
|
<span style="margin-right: 10px">{{ publishTime }}发布排名</span> |
|
|
|
<span style="margin-right: 10px;white-space: nowrap;">{{ publishTime }}发布排名</span> |
|
|
|
<el-button type="primary" |
|
|
|
<el-button type="primary" |
|
|
|
@click="cancelPublish(0)">取消发布</el-button> |
|
|
|
@click="cancelPublish(0)">取消发布</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -606,42 +606,15 @@ export default { |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 发布排名 |
|
|
|
// 发布排名 |
|
|
|
publishSubmit () { |
|
|
|
async publishSubmit () { |
|
|
|
if (this.type) { // 手动发布 |
|
|
|
await this.$post(this.api.publishRanking, { |
|
|
|
this.$post(this.api.batchRelease, this.list.map(e => e.id)).then(res => { |
|
|
|
competitionId: this.id, |
|
|
|
// this.getData() |
|
|
|
isOverallRanking: this.active ? 0 : 1, |
|
|
|
// util.successMsg('发布成功!') |
|
|
|
publicationType: this.type, |
|
|
|
}).catch(res => { }) |
|
|
|
releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime), |
|
|
|
} else { |
|
|
|
stageId: this.active || this.stageId, |
|
|
|
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 |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
const ids = this.grades.map(e => e.stageId) |
|
|
|
|
|
|
|
ids.pop() |
|
|
|
|
|
|
|
// 发布前校验 |
|
|
|
|
|
|
|
this.$post(this.api.publishRanking, data).then(res => { |
|
|
|
|
|
|
|
this.uploadData = [] |
|
|
|
this.uploadData = [] |
|
|
|
// this.getData() |
|
|
|
|
|
|
|
// util.successMsg('发布成功!') |
|
|
|
|
|
|
|
}).catch(res => { }) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 发布排名确认 |
|
|
|
// 发布排名确认 |
|
|
|
publish () { |
|
|
|
publish () { |
|
|
@ -680,13 +653,13 @@ export default { |
|
|
|
if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!') |
|
|
|
if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!') |
|
|
|
|
|
|
|
|
|
|
|
this.publishSubmit() |
|
|
|
this.publishSubmit() |
|
|
|
await this.$post(this.api.addCompetitionStageRankingTime, { |
|
|
|
// await this.$post(this.api.addCompetitionStageRankingTime, { |
|
|
|
competitionId: this.id, |
|
|
|
// competitionId: this.id, |
|
|
|
isOverallRanking: this.active ? 0 : 1, |
|
|
|
// isOverallRanking: this.active ? 0 : 1, |
|
|
|
publicationType: this.type, |
|
|
|
// publicationType: this.type, |
|
|
|
stageId: this.active || this.stageId, |
|
|
|
// stageId: this.active || this.stageId, |
|
|
|
releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime) |
|
|
|
// releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime) |
|
|
|
}) |
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
util.successMsg('发布成功') |
|
|
|
util.successMsg('发布成功') |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
@ -717,7 +690,7 @@ export default { |
|
|
|
// if (this.timeId) { |
|
|
|
// 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}`) |
|
|
|
// await this.$post(`${this.api.cancelCompetitionStageRankingTime}?competitionId=${this.id}&releaseId=${this.timeId}&isOverallRanking=${this.active ? 0 : 1}&stageId=${this.active || this.stageId}`) |
|
|
|
// } else { |
|
|
|
// } 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.publishTime = '' |
|
|
|
this.publishTime = '' |
|
|
|
this.sourceType = '' |
|
|
|
this.sourceType = '' |
|
|
@ -782,7 +755,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
async beforeUpload (file) { |
|
|
|
async beforeUpload (file) { |
|
|
|
this.uploading = true |
|
|
|
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}`) |
|
|
|
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}&publicationType=${this.type}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeRemove (file, fileList) { |
|
|
|
beforeRemove (file, fileList) { |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`) |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`) |
|
|
|