|
|
|
@ -186,12 +186,19 @@ |
|
|
|
|
<tr> |
|
|
|
|
<th>学校:</th> |
|
|
|
|
<td> |
|
|
|
|
<div v-if="fromOffical" class="flex"> |
|
|
|
|
<el-select class="m-r-10" v-model="curRealSchoolId" filterable> |
|
|
|
|
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName" |
|
|
|
|
:value="item.schoolId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<el-button type="primary" size="mini" @click="saveSchoolId">保存</el-button> |
|
|
|
|
<div v-if="fromOffical" class="flex a-center"> |
|
|
|
|
<template v-if="schoolEdit"> |
|
|
|
|
<el-select class="m-r-10" v-model="curRealSchoolId" filterable> |
|
|
|
|
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName" |
|
|
|
|
:value="item.schoolId"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<i class="el-icon-check icon" @click="saveSchoolId"></i> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<span class="m-r-10">{{ info.person.realSchool }}</span> |
|
|
|
|
<i class="el-icon-edit icon" @click="schoolEdit = 1"></i> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
<span v-else>{{ info.person.realSchool }}</span> |
|
|
|
|
</td> |
|
|
|
@ -217,7 +224,7 @@ |
|
|
|
|
}}</el-tag> |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
<tr v-if="info.team.captain"> |
|
|
|
|
<tr> |
|
|
|
|
<th>团队邀请码:</th> |
|
|
|
|
<td> |
|
|
|
|
<span>{{ info.team.invitationCode }}</span> |
|
|
|
@ -676,6 +683,7 @@ export default { |
|
|
|
|
schools: [], |
|
|
|
|
agreeCheck: false, |
|
|
|
|
curRealSchoolId: '', |
|
|
|
|
schoolEdit: 0, |
|
|
|
|
|
|
|
|
|
teamVisible: false, |
|
|
|
|
teams: [], |
|
|
|
@ -767,72 +775,71 @@ export default { |
|
|
|
|
this.getTeam() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getData () { // 获取竞赛信息 |
|
|
|
|
async getData () { // 获取竞赛信息 |
|
|
|
|
clearInterval(this.timer) |
|
|
|
|
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(async ({ competition }) => { |
|
|
|
|
const list = competition.competitionAnnexList |
|
|
|
|
// 附件 |
|
|
|
|
if (list) { |
|
|
|
|
list.map(e => { |
|
|
|
|
const { filePath } = e |
|
|
|
|
e.canPreview = Util.canPreview(filePath.substr(filePath.lastIndexOf('.') + 1)) |
|
|
|
|
const { competition } = await this.$post(`${this.api.getCompetition}?competitionId=${this.id}`) |
|
|
|
|
const list = competition.competitionAnnexList |
|
|
|
|
// 附件 |
|
|
|
|
if (list) { |
|
|
|
|
list.map(e => { |
|
|
|
|
const { filePath } = e |
|
|
|
|
e.canPreview = Util.canPreview(filePath.substr(filePath.lastIndexOf('.') + 1)) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.form = competition |
|
|
|
|
const reg = competition.competitionRegistration |
|
|
|
|
// 选择的赛事类型为设置完整比赛的才展示竞赛排名和参赛信息 |
|
|
|
|
if (competition.releaseType) { |
|
|
|
|
const arches = [] |
|
|
|
|
// 积分赛才有总分排名 |
|
|
|
|
competition.rule === 0 ? |
|
|
|
|
arches.push({ |
|
|
|
|
stageId: '0', |
|
|
|
|
stageName: '总分' |
|
|
|
|
}) : |
|
|
|
|
(this.curArch = competition.competitionStage[0].stageId + '') |
|
|
|
|
arches.push(...competition.competitionStage) |
|
|
|
|
arches.map(e => e.stageId = e.stageId + '') |
|
|
|
|
this.arches = arches |
|
|
|
|
|
|
|
|
|
// 报名后才显示参赛信息 |
|
|
|
|
if (reg && !this.typeList.find(e => e.id == 5)) { |
|
|
|
|
this.typeList.push({ |
|
|
|
|
id: '5', |
|
|
|
|
name: '参赛信息' |
|
|
|
|
}) |
|
|
|
|
await this.getInfo() |
|
|
|
|
this.initOss() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.form = competition |
|
|
|
|
const reg = competition.competitionRegistration |
|
|
|
|
// 选择的赛事类型为设置完整比赛的才展示竞赛排名和参赛信息 |
|
|
|
|
if (competition.releaseType) { |
|
|
|
|
const arches = [] |
|
|
|
|
// 积分赛才有总分排名 |
|
|
|
|
competition.rule === 0 ? |
|
|
|
|
arches.push({ |
|
|
|
|
stageId: '0', |
|
|
|
|
stageName: '总分' |
|
|
|
|
}) : |
|
|
|
|
(this.curArch = competition.competitionStage[0].stageId + '') |
|
|
|
|
arches.push(...competition.competitionStage) |
|
|
|
|
arches.map(e => e.stageId = e.stageId + '') |
|
|
|
|
this.arches = arches |
|
|
|
|
|
|
|
|
|
// 报名后才显示参赛信息 |
|
|
|
|
if (reg && !this.typeList.find(e => e.id == 5)) { |
|
|
|
|
this.typeList.push({ |
|
|
|
|
id: '5', |
|
|
|
|
name: '参赛信息' |
|
|
|
|
}) |
|
|
|
|
this.getInfo() |
|
|
|
|
this.getAutomaticAllocation() |
|
|
|
|
this.initOss() |
|
|
|
|
if (this.token) { |
|
|
|
|
if (this.fromOffical) { |
|
|
|
|
this.getCurSchool() |
|
|
|
|
this.getSchool() |
|
|
|
|
} |
|
|
|
|
if (this.token) { |
|
|
|
|
if (this.fromOffical) { |
|
|
|
|
this.getCurSchool() |
|
|
|
|
this.getSchool() |
|
|
|
|
} |
|
|
|
|
this.intervalRank() |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.typeList = this.typeList.slice(0, 3) |
|
|
|
|
this.intervalRank() |
|
|
|
|
competition.completeCompetitionSetup.competitionType && this.getAutomaticAllocation() // 团队赛需要查询该赛事的分配状态 |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.typeList = this.typeList.slice(0, 3) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.routes = [ |
|
|
|
|
{ |
|
|
|
|
name: '全部赛事', |
|
|
|
|
path: this.$store.state.match.referrer |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: competition.name |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
this.routes = [ |
|
|
|
|
{ |
|
|
|
|
name: '全部赛事', |
|
|
|
|
path: this.$store.state.match.referrer |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
name: competition.name |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
this.now = await Util.getNow() |
|
|
|
|
this.now = await Util.getNow() |
|
|
|
|
this.handleStatus() |
|
|
|
|
this.timer = setInterval(() => { |
|
|
|
|
this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1)) |
|
|
|
|
this.handleStatus() |
|
|
|
|
this.timer = setInterval(() => { |
|
|
|
|
this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1)) |
|
|
|
|
this.handleStatus() |
|
|
|
|
}, 1000) |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}, 1000) |
|
|
|
|
}, |
|
|
|
|
// 定时处理时间及状态 |
|
|
|
|
handleStatus () { |
|
|
|
@ -955,7 +962,7 @@ export default { |
|
|
|
|
const caption = info.teamDetail.find(e => !e.caption) |
|
|
|
|
info.caption = caption ? caption : {} |
|
|
|
|
info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId) |
|
|
|
|
this.curRealSchoolId = info.person.realSchoolId |
|
|
|
|
if (info.person) this.curRealSchoolId = info.person.realSchoolId |
|
|
|
|
this.originInfo = _.cloneDeep(info) |
|
|
|
|
// 把参赛人员的名字和accountId处理成一个数组 |
|
|
|
|
info.stages && info.stages.map(e => { |
|
|
|
@ -979,7 +986,6 @@ export default { |
|
|
|
|
const time = e.resultAnnouncementTime |
|
|
|
|
if (time >= 0) { |
|
|
|
|
const endTime = new Date(e.endTime).getTime() + time * 3600000 // 阶段结束时间+成绩公布时间(成绩公布时间单位是小时,所以要转化为毫秒) |
|
|
|
|
console.log("🚀 ~ this.$post ~ endTime:", time, endTime - now) |
|
|
|
|
if (now > endTime) { // 如果到了公布时间 |
|
|
|
|
info.stages.find(n => n.stageId == e.stageId).showDetail = 1 |
|
|
|
|
} else if (endTime - now < 86400000) { // 没有到公布时间,则加定时器,到点后调用 |
|
|
|
@ -988,6 +994,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.info = info |
|
|
|
|
this.schoolEdit = 0 |
|
|
|
|
if (this.form.completeCompetitionSetup.competitionType) { |
|
|
|
|
this.getErrorInfo() |
|
|
|
|
this.getTeamAssign() |
|
|
|
@ -1369,7 +1376,7 @@ export default { |
|
|
|
|
// 获取当前学校 |
|
|
|
|
async getCurSchool () { |
|
|
|
|
const res = await this.$post(this.api.getSchoolIdByToken) |
|
|
|
|
this.curRealSchoolId = res.schoolId |
|
|
|
|
if (!this.curRealSchoolId) this.curRealSchoolId = res.schoolId |
|
|
|
|
}, |
|
|
|
|
// 获取学校 |
|
|
|
|
async getSchool () { |
|
|
|
@ -1387,6 +1394,7 @@ export default { |
|
|
|
|
realSchoolId: this.curRealSchoolId, |
|
|
|
|
teamId: this.form.completeCompetitionSetup.competitionType ? this.info.teamId : '', |
|
|
|
|
}) |
|
|
|
|
await this.getInfo() |
|
|
|
|
Util.successMsg('保存成功') |
|
|
|
|
}, |
|
|
|
|
// 团队报名提交 |
|
|
|
@ -1438,6 +1446,7 @@ export default { |
|
|
|
|
|
|
|
|
|
// 创建团队 |
|
|
|
|
toTeam () { |
|
|
|
|
if (this.fromOffical && !this.agreeCheck) return Util.errorMsg('请勾选同意,才可创建团队!') |
|
|
|
|
this.teamVisible = true |
|
|
|
|
}, |
|
|
|
|
// 获取团队列表 |
|
|
|
@ -1461,6 +1470,7 @@ export default { |
|
|
|
|
this.teamVisible = false |
|
|
|
|
this.enterVisible = false |
|
|
|
|
await this.getData() |
|
|
|
|
await this.getInfo() |
|
|
|
|
Util.successMsg('报名成功!') |
|
|
|
|
this.afterCreateTeam() |
|
|
|
|
}, |
|
|
|
|