|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div style="padding: 0 100px;"> |
|
|
|
<el-card shadow="hover" class="m-b-20 head-card"> |
|
|
|
<el-card shadow="hover" class="m-b-20 head-card"> |
|
|
|
<div class="flex-between"> |
|
|
|
<div class="flex-between"> |
|
|
|
<el-page-header @back="$router.back()" content="参赛信息与成绩"></el-page-header> |
|
|
|
<el-page-header @back="$router.back()" content="参赛信息与成绩"></el-page-header> |
|
|
@ -7,20 +7,22 @@ |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<table v-if="form.completeCompetitionSetup.competitionType" class="table m-b-20"> |
|
|
|
<div style="display: flex;align-items: center"> |
|
|
|
<tr> |
|
|
|
<table v-if="form.completeCompetitionSetup.competitionType" class="table m-b-20 m-r-10"> |
|
|
|
<th width="150">团队名称:</th> |
|
|
|
<tr> |
|
|
|
<td> |
|
|
|
<th width="150">团队名称:</th> |
|
|
|
<el-input :disabled="!editing" v-model="info.team.teamName"></el-input> |
|
|
|
<td> |
|
|
|
</td> |
|
|
|
<el-input :disabled="!editing" v-model="info.team.teamName"></el-input> |
|
|
|
<th width="150">团队邀请码:</th> |
|
|
|
</td> |
|
|
|
<td> |
|
|
|
<th width="150">团队邀请码:</th> |
|
|
|
<el-input :disabled="!editing" v-model="info.team.invitationCode"></el-input> |
|
|
|
<td> |
|
|
|
</td> |
|
|
|
<el-input :disabled="!editing" v-model="info.team.invitationCode"></el-input> |
|
|
|
</tr> |
|
|
|
</td> |
|
|
|
</table> |
|
|
|
</tr> |
|
|
|
<div v-if="form.completeCompetitionSetup.competitionType && status < 4" class="m-b-20 text-center"> |
|
|
|
</table> |
|
|
|
<el-button type="primary" @click="edit(1)">{{ editing ? '保存' : '编辑' }}</el-button> |
|
|
|
<div v-if="form.completeCompetitionSetup.competitionType && status < 4" class="m-b-20 text-center"> |
|
|
|
|
|
|
|
<el-button type="primary" @click="edit(1)">{{ editing ? '保存' : '编辑' }}</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<table class="table"> |
|
|
|
<table class="table"> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
@ -77,7 +79,7 @@ |
|
|
|
<template v-if="form.completeCompetitionSetup.competitionType"> |
|
|
|
<template v-if="form.completeCompetitionSetup.competitionType"> |
|
|
|
<th width="110">参赛人数限制</th> |
|
|
|
<th width="110">参赛人数限制</th> |
|
|
|
<th>允许参赛人员</th> |
|
|
|
<th>允许参赛人员</th> |
|
|
|
<th v-if="info.team.captain === 0 && form.rule === 0">总分</th> |
|
|
|
<th v-if="form.rule === 0">总分</th> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<th>竞赛成绩</th> |
|
|
|
<th>竞赛成绩</th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
@ -87,11 +89,24 @@ |
|
|
|
<td>{{ item.stageName }}</td> |
|
|
|
<td>{{ item.stageName }}</td> |
|
|
|
<template v-if="form.completeCompetitionSetup.competitionType"> |
|
|
|
<template v-if="form.completeCompetitionSetup.competitionType"> |
|
|
|
<td>{{ item.teamNumLimit || '不限制' }}</td> |
|
|
|
<td>{{ item.teamNumLimit || '不限制' }}</td> |
|
|
|
<td>{{ item.teamParticipantIds || '无' }}</td> |
|
|
|
<td> |
|
|
|
<td v-if="info.team.captain === 0 && form.rule === 0 && !i" :rowspan="info.stages.length">{{ info.totalScore }}</td> |
|
|
|
<template v-if="item.participants"> |
|
|
|
|
|
|
|
<el-tag |
|
|
|
|
|
|
|
v-for="tag in item.participants" |
|
|
|
|
|
|
|
:key="tag.name" |
|
|
|
|
|
|
|
class="m-r-5" |
|
|
|
|
|
|
|
closable |
|
|
|
|
|
|
|
@close="removePar(tag, item)"> |
|
|
|
|
|
|
|
{{tag.name}} |
|
|
|
|
|
|
|
</el-tag> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<span v-else class="m-r-5">无</span> |
|
|
|
|
|
|
|
<i class="el-icon-edit icon" @click="selectPar(item)"></i> |
|
|
|
|
|
|
|
</td> |
|
|
|
|
|
|
|
<td v-if="form.rule === 0 && !i" :rowspan="info.stages.length">{{ info.totalScore }}</td> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<span v-if="item.score" class="m-r-10">分数{{item.score}}</span> |
|
|
|
<span v-if="item.score > 0" class="m-r-10">分数{{item.score}}</span> |
|
|
|
<el-button type="text" :disabled="item.resultsDetails === 1 || (form.completeCompetitionSetup.competitionType && !item.reportId) || (form.completeCompetitionSetup.competitionType === 0 && !item.reportId)" @click="show(item)">查看成绩详情</el-button> |
|
|
|
<el-button type="text" :disabled="item.resultsDetails === 1 || (form.completeCompetitionSetup.competitionType && !item.reportId) || (form.completeCompetitionSetup.competitionType === 0 && !item.reportId)" @click="show(item)">查看成绩详情</el-button> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
@ -144,7 +159,7 @@ |
|
|
|
<el-checkbox-group v-model="checkedMembers"> |
|
|
|
<el-checkbox-group v-model="checkedMembers"> |
|
|
|
<el-checkbox v-for="(item, i) in chooses" :key="i" :label="item.accountId">{{ item.userName }}</el-checkbox> |
|
|
|
<el-checkbox v-for="(item, i) in chooses" :key="i" :label="item.accountId">{{ item.userName }}</el-checkbox> |
|
|
|
</el-checkbox-group> |
|
|
|
</el-checkbox-group> |
|
|
|
<p v-if="info.teamLimit" style="margin-top: 15px;font-size: 12px;">注:当前阶段限制1人参赛,且此竞赛每个成员只能参加一个阶段赛项。</p> |
|
|
|
<p v-if="info.teamLimit && curRow.teamNumLimit" style="margin-top: 15px;font-size: 12px;">注:当前阶段限制{{ curRow.teamNumLimit }}人参赛,且此竞赛每个成员只能参加一个阶段赛项。</p> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button size="small" type="primary" @click="chooseSubmit">确定</el-button> |
|
|
|
<el-button size="small" type="primary" @click="chooseSubmit">确定</el-button> |
|
|
|
<el-button size="small" @click="chooseVisible = false">取消</el-button> |
|
|
|
<el-button size="small" @click="chooseVisible = false">取消</el-button> |
|
|
@ -280,6 +295,21 @@ export default { |
|
|
|
info.caption = caption ? caption : {} |
|
|
|
info.caption = caption ? caption : {} |
|
|
|
info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId) |
|
|
|
info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId) |
|
|
|
this.originInfo = JSON.parse(JSON.stringify(info)) |
|
|
|
this.originInfo = JSON.parse(JSON.stringify(info)) |
|
|
|
|
|
|
|
// 把参赛人员的名字和accountId处理成一个数组 |
|
|
|
|
|
|
|
info.stages && info.stages.map(e => { |
|
|
|
|
|
|
|
if (e.participantAccountIds && e.teamParticipantIds) { |
|
|
|
|
|
|
|
const accountIds = e.participantAccountIds.split(',').map(n => +n) |
|
|
|
|
|
|
|
const names = e.teamParticipantIds.split(',') |
|
|
|
|
|
|
|
const participants = [] |
|
|
|
|
|
|
|
accountIds.map((n, i) => { |
|
|
|
|
|
|
|
participants.push({ |
|
|
|
|
|
|
|
id: n, |
|
|
|
|
|
|
|
name: names[i] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
e.participants = participants |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
// 设置定时器,阶段比赛结束后公布成绩,到时间后调本接口 |
|
|
|
// 设置定时器,阶段比赛结束后公布成绩,到时间后调本接口 |
|
|
|
const now = Date.now() |
|
|
|
const now = Date.now() |
|
|
|
this.form.competitionStage.map(e => { |
|
|
|
this.form.competitionStage.map(e => { |
|
|
@ -329,8 +359,9 @@ export default { |
|
|
|
teamId, |
|
|
|
teamId, |
|
|
|
teamName, |
|
|
|
teamName, |
|
|
|
invitationCode, |
|
|
|
invitationCode, |
|
|
|
whetherSignUp: 1 |
|
|
|
whetherSignUp: 0 |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
this.editing = false |
|
|
|
this.getInfo() |
|
|
|
this.getInfo() |
|
|
|
showMsg && util.successMsg('保存成功') |
|
|
|
showMsg && util.successMsg('保存成功') |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
@ -419,55 +450,81 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!start) { |
|
|
|
if (!start) { |
|
|
|
this.$confirm('确定要踢出该成员吗?', '提示', { |
|
|
|
let include |
|
|
|
|
|
|
|
for (const e of this.info.stages) { |
|
|
|
|
|
|
|
if (e.participantAccountIds) { |
|
|
|
|
|
|
|
const ids = e.participantAccountIds.split(',').map(n => +n) |
|
|
|
|
|
|
|
if (ids.includes(row.accountId)) { |
|
|
|
|
|
|
|
include = e.stageName |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$confirm(include ? `该成员已被指定参加${include},踢出后需重新指定成员参加,是否确认踢出团队?` : '确定要踢出该成员吗?', '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.$post(`${this.api.removeTheLine}?teamId=${this.info.teamId}&competitionId=${this.id}&accountId=${row.accountId}`).then(res => { |
|
|
|
this.$post(`${this.api.removeTheLine}?teamId=${this.info.teamId}&competitionId=${this.id}&accountId=${row.accountId}`).then(res => { |
|
|
|
util.successMsg('移除成功') |
|
|
|
util.successMsg('移除成功') |
|
|
|
this.getInfo() |
|
|
|
this.getInfo() |
|
|
|
if (row.accountId == this.accountId) this.$router.back() |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 选择参赛人员 |
|
|
|
// 移除参赛人员 |
|
|
|
selectPar(row) { |
|
|
|
removePar(e, stage) { |
|
|
|
const item = this.form.competitionStage.find(e => e.stageId == row.stageId) |
|
|
|
this.$confirm('确定要移除该成员吗?', '提示', { |
|
|
|
if (item) { |
|
|
|
type: 'warning' |
|
|
|
// 该阶段已经开始比赛则不能修改 |
|
|
|
}).then(() => { |
|
|
|
const now = new Date() |
|
|
|
this.$post(this.api.cancelParticipant, { |
|
|
|
if (now >= new Date(item.startTime) && now <= new Date(item.endTime)) { |
|
|
|
accountId: e.id, |
|
|
|
return util.errorMsg('该阶段比赛已经开始,无法修改允许参赛人员!') |
|
|
|
competitionId: this.id, |
|
|
|
} else { |
|
|
|
stageId: stage.stageId, |
|
|
|
const { teamLimit, stages, teamDetail } = this.info |
|
|
|
teamId: this.info.teamId |
|
|
|
// teamLimit=true,则每个成员只能参加一个阶段的比赛,要获取stages里返回的所有participantAccountIds(参赛人员的accountId),然后不显示这些参赛人员 |
|
|
|
}).then(res => { |
|
|
|
if (teamLimit) { |
|
|
|
util.successMsg('移除成功') |
|
|
|
const chooses = [] |
|
|
|
this.getInfo() |
|
|
|
let ids = [] |
|
|
|
}).catch(res => {}) |
|
|
|
// 获取已经允许参赛的人员accountId |
|
|
|
}).catch(() => {}) |
|
|
|
stages.map(e => { |
|
|
|
}, |
|
|
|
const id = e.participantAccountIds |
|
|
|
// 选择参赛人员 |
|
|
|
id && ids.push(...id.split(',').map(n => +n)) |
|
|
|
selectPar(row) { |
|
|
|
}) |
|
|
|
const item = this.form.competitionStage.find(e => e.stageId == row.stageId) |
|
|
|
ids = [...new Set(ids)] |
|
|
|
if (item) { |
|
|
|
teamDetail.map(e => { |
|
|
|
// 该阶段已经开始比赛则不能修改 |
|
|
|
ids.includes(e.accountId) || chooses.push(e) // 没有参赛的人员则显示出来 |
|
|
|
const now = new Date() |
|
|
|
}) |
|
|
|
if (now >= new Date(item.startTime) && now <= new Date(item.endTime)) { |
|
|
|
this.chooses = chooses |
|
|
|
return util.errorMsg('该阶段比赛已经开始,无法修改允许参赛人员!') |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.chooses = this.info.teamDetail |
|
|
|
const { teamLimit, stages, teamDetail } = this.info |
|
|
|
|
|
|
|
// teamLimit=true,则每个成员只能参加一个阶段的比赛,要获取stages里返回的所有participantAccountIds(参赛人员的accountId),然后不显示这些参赛人员 |
|
|
|
|
|
|
|
if (teamLimit) { |
|
|
|
|
|
|
|
const chooses = [] |
|
|
|
|
|
|
|
let ids = [] |
|
|
|
|
|
|
|
// 获取已经允许参赛的人员accountId |
|
|
|
|
|
|
|
stages.map(e => { |
|
|
|
|
|
|
|
let id = e.participantAccountIds |
|
|
|
|
|
|
|
if (e.stageId != row.stageId && id) ids.push(...id.split(',').map(n => +n)) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
ids = [...new Set(ids)] |
|
|
|
|
|
|
|
teamDetail.map(e => { |
|
|
|
|
|
|
|
ids.includes(e.accountId) || chooses.push(e) // 没有参赛的人员则显示出来 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.chooses = chooses |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.chooses = this.info.teamDetail |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.curRow = row |
|
|
|
|
|
|
|
this.checkedMembers = [] |
|
|
|
|
|
|
|
this.chooseVisible = true |
|
|
|
} |
|
|
|
} |
|
|
|
this.curRow = row |
|
|
|
|
|
|
|
this.chooseVisible = true |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 选择参赛人员提交 |
|
|
|
// 选择参赛人员提交 |
|
|
|
chooseSubmit() { |
|
|
|
chooseSubmit() { |
|
|
|
const accountIds = this.checkedMembers |
|
|
|
const accountIds = this.checkedMembers |
|
|
|
if (!accountIds.length) return util.errorMsg('请选择参赛成员!') |
|
|
|
if (!accountIds.length) return util.errorMsg('请选择参赛成员!') |
|
|
|
const limit = this.curRow.teamNumLimit // 参赛人数限制 |
|
|
|
const limit = this.curRow.teamNumLimit // 参赛人数限制 |
|
|
|
if (accountIds.length > limit) return util.errorMsg(`请选择${limit}个以下参赛成员!`) // 选择的参赛人员个数不能大于参赛人数限制 |
|
|
|
if (limit && accountIds.length > limit) return util.errorMsg(`请选择${limit}个以下参赛成员!`) // 选择的参赛人员个数不能大于参赛人数限制 |
|
|
|
this.$post(this.api.stageSelectParticipants, { |
|
|
|
this.$post(this.api.stageSelectParticipants, { |
|
|
|
accountIds, |
|
|
|
accountIds, |
|
|
|
competitionId: this.id, |
|
|
|
competitionId: this.id, |
|
|
@ -483,7 +540,7 @@ export default { |
|
|
|
// 查看成绩详情 |
|
|
|
// 查看成绩详情 |
|
|
|
show(row) { |
|
|
|
show(row) { |
|
|
|
// 团队展示弹框,个人跳转实验报告 |
|
|
|
// 团队展示弹框,个人跳转实验报告 |
|
|
|
if (this.form.completeCompetitionSetup.competitionType && this.info.team.captain === 0) { // 团队比赛并且是队长,则展示团队成员成绩详情 |
|
|
|
if (this.form.completeCompetitionSetup.competitionType) { // 团队比赛并且是队长,则展示团队成员成绩详情 |
|
|
|
this.curRow = row |
|
|
|
this.curRow = row |
|
|
|
this.memberVisible = true |
|
|
|
this.memberVisible = true |
|
|
|
const teamId = this.form.competitionRegistration.teamId |
|
|
|
const teamId = this.form.competitionRegistration.teamId |
|
|
@ -513,6 +570,9 @@ export default { |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
|
|
|
|
.m-r-5 { |
|
|
|
|
|
|
|
margin-right: 5px; |
|
|
|
|
|
|
|
} |
|
|
|
.l-title { |
|
|
|
.l-title { |
|
|
|
margin-top: 20px; |
|
|
|
margin-top: 20px; |
|
|
|
font-size: 18px; |
|
|
|
font-size: 18px; |
|
|
@ -536,6 +596,9 @@ export default { |
|
|
|
font-size: 16px; |
|
|
|
font-size: 16px; |
|
|
|
color: #7a7a7a; |
|
|
|
color: #7a7a7a; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
&:hover { |
|
|
|
|
|
|
|
color: #007EFF; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.plus { |
|
|
|
.plus { |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-bottom: 10px; |
|
|
|