|
|
@ -39,9 +39,11 @@ |
|
|
|
class="tips"> |
|
|
|
class="tips"> |
|
|
|
(团队赛是否限制队内每个成员只能参加一个阶段赛项? |
|
|
|
(团队赛是否限制队内每个成员只能参加一个阶段赛项? |
|
|
|
<el-radio v-model="form.teamLimit" |
|
|
|
<el-radio v-model="form.teamLimit" |
|
|
|
:label="1">是</el-radio> |
|
|
|
:label="1" |
|
|
|
|
|
|
|
@change="teamLimitChange">是</el-radio> |
|
|
|
<el-radio v-model="form.teamLimit" |
|
|
|
<el-radio v-model="form.teamLimit" |
|
|
|
:label="0">否</el-radio> |
|
|
|
:label="0" |
|
|
|
|
|
|
|
@change="teamLimitChange">否</el-radio> |
|
|
|
) |
|
|
|
) |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
@ -80,13 +82,14 @@ |
|
|
|
<span class="req">*</span> |
|
|
|
<span class="req">*</span> |
|
|
|
团队参赛人数限制: |
|
|
|
团队参赛人数限制: |
|
|
|
<el-radio v-model="item.teamNumLimitOpt" |
|
|
|
<el-radio v-model="item.teamNumLimitOpt" |
|
|
|
:label="0">不限制</el-radio> |
|
|
|
:label="0" |
|
|
|
|
|
|
|
@change="item.teamNumLimit = 0">不限制</el-radio> |
|
|
|
<el-radio v-model="item.teamNumLimitOpt" |
|
|
|
<el-radio v-model="item.teamNumLimitOpt" |
|
|
|
:label="1">自定义</el-radio> |
|
|
|
:label="1">自定义</el-radio> |
|
|
|
<el-input v-model.number="item.teamNumLimit" |
|
|
|
<el-input v-model.number="item.teamNumLimit" |
|
|
|
type="number" |
|
|
|
type="number" |
|
|
|
style="width: 150px;" |
|
|
|
style="width: 150px;" |
|
|
|
:disabled="item.teamNumLimitOpt === 0"></el-input> 人 |
|
|
|
:disabled="item.teamNumLimitOpt === 0 || form.teamLimit === 1"></el-input> 人 |
|
|
|
<span class="tips">(可限制本阶段单个团队的出战人数)</span> |
|
|
|
<span class="tips">(可限制本阶段单个团队的出战人数)</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="step1.completeCompetitionSetup.competitionType" |
|
|
|
<div v-if="step1.completeCompetitionSetup.competitionType" |
|
|
@ -243,8 +246,8 @@ export default { |
|
|
|
scoreLimit: '', |
|
|
|
scoreLimit: '', |
|
|
|
operator: '>', |
|
|
|
operator: '>', |
|
|
|
score: '', |
|
|
|
score: '', |
|
|
|
teamNumLimit: '', |
|
|
|
teamNumLimit: 1, |
|
|
|
teamNumLimitOpt: 0, |
|
|
|
teamNumLimitOpt: 1, |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultsDetails: '', |
|
|
|
resultsDetails: '', |
|
|
|
}, |
|
|
|
}, |
|
|
@ -259,8 +262,8 @@ export default { |
|
|
|
scoreLimit: '', |
|
|
|
scoreLimit: '', |
|
|
|
operator: '>', |
|
|
|
operator: '>', |
|
|
|
score: '', |
|
|
|
score: '', |
|
|
|
teamNumLimit: '', |
|
|
|
teamNumLimit: 1, |
|
|
|
teamNumLimitOpt: 0, |
|
|
|
teamNumLimitOpt: 1, |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultsDetails: '', |
|
|
|
resultsDetails: '', |
|
|
|
}, |
|
|
|
}, |
|
|
@ -275,8 +278,8 @@ export default { |
|
|
|
scoreLimit: '', |
|
|
|
scoreLimit: '', |
|
|
|
operator: '>', |
|
|
|
operator: '>', |
|
|
|
score: '', |
|
|
|
score: '', |
|
|
|
teamNumLimit: '', |
|
|
|
teamNumLimit: 1, |
|
|
|
teamNumLimitOpt: 0, |
|
|
|
teamNumLimitOpt: 1, |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultsDetails: '', |
|
|
|
resultsDetails: '', |
|
|
|
} |
|
|
|
} |
|
|
@ -368,6 +371,14 @@ export default { |
|
|
|
this.form.competitionStageList = stages.slice(0, val) |
|
|
|
this.form.competitionStageList = stages.slice(0, val) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
teamLimitChange (e) { |
|
|
|
|
|
|
|
if (e === 1) { |
|
|
|
|
|
|
|
this.form.competitionStageList.forEach(e => { |
|
|
|
|
|
|
|
e.teamNumLimitOpt = 1 |
|
|
|
|
|
|
|
e.teamNumLimit = 1 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
save (status, next = 0, releaseType, cb) { |
|
|
|
save (status, next = 0, releaseType, cb) { |
|
|
|
let { form } = this |
|
|
|
let { form } = this |
|
|
@ -392,6 +403,8 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
form.competitionStageList = stages.slice(0, 1) // 单项赛只需要存第一个阶段的数据 |
|
|
|
form.competitionStageList = stages.slice(0, 1) // 单项赛只需要存第一个阶段的数据 |
|
|
|
} else { // 非积分赛则全部字段校验 |
|
|
|
} else { // 非积分赛则全部字段校验 |
|
|
|
|
|
|
|
let teamNumLimit = 0 |
|
|
|
|
|
|
|
const { competitionType, minTeamSize, maxTeamSize } = step1.completeCompetitionSetup // 0为个人赛,1为团队赛 |
|
|
|
for (const i in stages) { |
|
|
|
for (const i in stages) { |
|
|
|
const e = stages[i] |
|
|
|
const e = stages[i] |
|
|
|
if (rule !== 2 && !e.stageName) { |
|
|
|
if (rule !== 2 && !e.stageName) { |
|
|
@ -399,7 +412,6 @@ export default { |
|
|
|
util.errorMsg('请输入阶段名称') |
|
|
|
util.errorMsg('请输入阶段名称') |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 0为个人赛,1为团队赛 |
|
|
|
|
|
|
|
// rule: 0为积分赛,1为淘汰赛,2为单项赛 |
|
|
|
// rule: 0为积分赛,1为淘汰赛,2为单项赛 |
|
|
|
// 积分赛 |
|
|
|
// 积分赛 |
|
|
|
if (!rule) { |
|
|
|
if (!rule) { |
|
|
@ -447,8 +459,13 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
e.resultAnnouncementTime = +e.resultAnnouncementTime |
|
|
|
e.resultAnnouncementTime = +e.resultAnnouncementTime |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (e.teamNumLimit) teamNumLimit += e.teamNumLimit // 各阶段自定义的人数之和 |
|
|
|
} |
|
|
|
} |
|
|
|
if (invalid) return |
|
|
|
if (invalid) return |
|
|
|
|
|
|
|
if (form.teamLimit) { |
|
|
|
|
|
|
|
if (stages.length > minTeamSize) return util.errorMsg('阶段数不得大于团队人数下限') |
|
|
|
|
|
|
|
if (teamNumLimit > minTeamSize) return util.errorMsg('各阶段自定义的参赛人数之和不得大于团队人数下限') |
|
|
|
|
|
|
|
} |
|
|
|
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入') |
|
|
|
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入') |
|
|
|
} |
|
|
|
} |
|
|
|
} else { // 保存草稿的情况下,只保存输入了阶段名称的阶段 |
|
|
|
} else { // 保存草稿的情况下,只保存输入了阶段名称的阶段 |
|
|
|