赛事修复

dev_202412
yujialong 6 months ago
parent 8c085f63eb
commit 5018ac5e0b
  1. 146
      src/pages/match/details/index.vue
  2. 1
      src/pages/match/list/index.vue
  3. 32
      src/pages/touristMatch/list/index.vue

@ -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()
},

@ -736,6 +736,7 @@ export default {
//
toTeam () {
if (this.fromOffical && !this.agreeCheck) return Util.errorMsg('请勾选同意,才可创建团队!')
this.teamForm = {
competitionId: this.curItem.id,
teamName: '',

@ -628,6 +628,7 @@ export default {
//
toTeam () {
if (this.fromOffical && !this.agreeCheck) return Util.errorMsg('请勾选同意,才可创建团队!')
this.teamForm = {
competitionId: this.curItem.id,
teamName: '',
@ -658,8 +659,39 @@ export default {
this.enterVisible = false
this.getData()
Util.successMsg('报名成功!')
this.afterCreateTeam(res.teamId)
}).catch(res => { })
},
//
async afterCreateTeam (id) {
//
const res = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.teamForm.competitionId}`)
//
if (res.data && res.data.assignOrNot) {
Util.successMsg('团队创建成功,系统将在报名结束后自动帮您分配阶段参赛成员,您也可以到参数信息进行指定')
} else {
//
this.$confirm('<p style="color: #007EFF;">报名成功!</p>您是否要启用自动分配阶段参赛人员功能?启用后,报名截止时系统将清空已有分配,并为团队所有成员重新自动分配。', '提示', {
cancelButtonText: '否',
confirmButtonText: '是',
type: 'success',
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
}).then(() => {
this.automaticAllocation(id)
}).catch(() => { })
}
},
//
async automaticAllocation (teamId) {
await this.$post(this.api.competitionTeamAutomaticAllocationRecordSave, {
assignOrNot: 1,
competitionId: this.teamForm.competitionId,
teamId
})
},
//
chooseStage (e, item) {
item.curStage = e

Loading…
Cancel
Save