|
|
|
@ -356,7 +356,7 @@ export default { |
|
|
|
|
publicationType: this.type, |
|
|
|
|
locationStageId: this.stageId, |
|
|
|
|
stageIds: ids.splice(0, ids.length - 1) |
|
|
|
|
}).then(({ page, publishStatus }) => { |
|
|
|
|
}).then(({ page, publishStatus, total }) => { |
|
|
|
|
this.published = publishStatus |
|
|
|
|
this.list = page |
|
|
|
|
this.total = total |
|
|
|
@ -392,13 +392,7 @@ export default { |
|
|
|
|
// 排序类型切换回调 |
|
|
|
|
typeChange (val) { |
|
|
|
|
this.$post(`${this.api.toggleTheSortingMode}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => { }).catch(res => { }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => { |
|
|
|
|
// if (whetherToPublish && !val) this.sourceType = '0' |
|
|
|
|
this.getRank() |
|
|
|
|
// this.published = whetherToPublish |
|
|
|
|
// }).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
initData () { |
|
|
|
|
this.page = 1 |
|
|
|
@ -499,12 +493,10 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 发布排名 |
|
|
|
|
publishSubmit () { |
|
|
|
|
const { startTime, endTime } = this.grades[this.index] |
|
|
|
|
if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!') |
|
|
|
|
if (this.type) { // 手动发布 |
|
|
|
|
this.$post(this.api.batchRelease, this.list.map(e => e.id)).then(res => { |
|
|
|
|
this.getData() |
|
|
|
|
util.successMsg('发布成功!') |
|
|
|
|
// this.getData() |
|
|
|
|
// util.successMsg('发布成功!') |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
} else { |
|
|
|
|
let data = [] // 手动上传后发布排名,数据直接取批量上传后返回的data |
|
|
|
@ -533,27 +525,14 @@ export default { |
|
|
|
|
// 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('发布成功!') |
|
|
|
|
// this.getData() |
|
|
|
|
// util.successMsg('发布成功!') |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
// }).catch(res => {}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 发布排名确认 |
|
|
|
|
publish () { |
|
|
|
|
// 如果已发布,并且上次发布的类型跟这次发布的类型不一致,则要提示确认 |
|
|
|
|
// if (this.published && this.sourceType != this.type) { |
|
|
|
|
// this.$confirm(this.sourceType == 1 && !this.type ? |
|
|
|
|
// '手动排名已发布,是否要取消手动排名的内容,改为系统排名的内容?' : |
|
|
|
|
// '默认系统排名已发布,是否要取消系统排名的内容,改为手动发布的内容?', '提示', { |
|
|
|
|
// type: 'success' |
|
|
|
|
// }).then(() => { |
|
|
|
|
// this.publishSubmit() |
|
|
|
|
// }).catch(() => {}) |
|
|
|
|
// } else { |
|
|
|
|
// this.publishSubmit() |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => { |
|
|
|
|
whetherToPublish ? |
|
|
|
|
this.$confirm('排名已经发布,是否直接覆盖?', '提示', { |
|
|
|
@ -563,7 +542,6 @@ export default { |
|
|
|
|
}).catch(() => { }) : |
|
|
|
|
this.publishSubmit() |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
// this.publishSubmit() |
|
|
|
|
}, |
|
|
|
|
// 获取定时发布排名 |
|
|
|
|
async getPublishTime () { |
|
|
|
@ -585,13 +563,18 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 定时发布排名 |
|
|
|
|
async publishTimeSubmit () { |
|
|
|
|
this.$post(this.api.addCompetitionStageRankingTime, { |
|
|
|
|
const { startTime, endTime } = this.grades[this.index] |
|
|
|
|
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) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
util.successMsg('发布成功') |
|
|
|
|
this.getData() |
|
|
|
|
this.uploaded = 0 |
|
|
|
@ -609,7 +592,7 @@ export default { |
|
|
|
|
// 如果是取消发布,则直接调取消发布的接口 |
|
|
|
|
if (publish) { |
|
|
|
|
// 如果是手动发布,并且没有上传排名,则提示 |
|
|
|
|
if (this.type && !this.uploaded) { |
|
|
|
|
if (this.type && !this.uploaded && !this.list.length) { |
|
|
|
|
return util.errorMsg('请先上传数据!') |
|
|
|
|
} else { |
|
|
|
|
this.publishTime = new Date() |
|
|
|
@ -619,9 +602,9 @@ export default { |
|
|
|
|
try { |
|
|
|
|
// 取消定时发布的接口跟取消普通发布的接口不一样 |
|
|
|
|
// 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 { |
|
|
|
|
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`) |
|
|
|
|
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}&releaseId=${this.timeId}`) |
|
|
|
|
// } |
|
|
|
|
this.sourceType = '' |
|
|
|
|
this.type = 0 |
|
|
|
|