|
|
@ -79,14 +79,14 @@ |
|
|
|
class="line"> |
|
|
|
class="line"> |
|
|
|
<span class="req">*</span> |
|
|
|
<span class="req">*</span> |
|
|
|
团队参赛人数限制: |
|
|
|
团队参赛人数限制: |
|
|
|
<el-radio v-model="item.teamNumLimitOpt" |
|
|
|
<el-radio v-model="item.teamNumLimit" |
|
|
|
:label="0">不限制</el-radio> |
|
|
|
:label="0">不限制</el-radio> |
|
|
|
<el-radio v-model="item.teamNumLimitOpt" |
|
|
|
<el-radio v-model="item.teamNumLimit" |
|
|
|
:label="1">自定义</el-radio> |
|
|
|
:label="1">自定义</el-radio> |
|
|
|
<el-input v-model.number="item.teamNumLimit" |
|
|
|
<el-input v-model.number="item.customNumber" |
|
|
|
type="number" |
|
|
|
type="number" |
|
|
|
style="width: 150px;" |
|
|
|
style="width: 150px;" |
|
|
|
:disabled="item.teamNumLimitOpt === 0"></el-input> 人 |
|
|
|
:disabled="item.teamNumLimit === 0"></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 +243,8 @@ export default { |
|
|
|
scoreLimit: '', |
|
|
|
scoreLimit: '', |
|
|
|
operator: '>', |
|
|
|
operator: '>', |
|
|
|
score: '', |
|
|
|
score: '', |
|
|
|
teamNumLimit: '', |
|
|
|
customNumber: '', |
|
|
|
teamNumLimitOpt: 0, |
|
|
|
teamNumLimit: 0, |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultsDetails: '', |
|
|
|
resultsDetails: '', |
|
|
|
}, |
|
|
|
}, |
|
|
@ -259,8 +259,8 @@ export default { |
|
|
|
scoreLimit: '', |
|
|
|
scoreLimit: '', |
|
|
|
operator: '>', |
|
|
|
operator: '>', |
|
|
|
score: '', |
|
|
|
score: '', |
|
|
|
teamNumLimit: '', |
|
|
|
customNumber: '', |
|
|
|
teamNumLimitOpt: 0, |
|
|
|
teamNumLimit: 0, |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultsDetails: '', |
|
|
|
resultsDetails: '', |
|
|
|
}, |
|
|
|
}, |
|
|
@ -275,8 +275,8 @@ export default { |
|
|
|
scoreLimit: '', |
|
|
|
scoreLimit: '', |
|
|
|
operator: '>', |
|
|
|
operator: '>', |
|
|
|
score: '', |
|
|
|
score: '', |
|
|
|
teamNumLimit: '', |
|
|
|
customNumber: '', |
|
|
|
teamNumLimitOpt: 0, |
|
|
|
teamNumLimit: 0, |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultsDetails: '', |
|
|
|
resultsDetails: '', |
|
|
|
} |
|
|
|
} |
|
|
@ -339,7 +339,6 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
if (!e.peopleLimit) e.peopleLimit = '' |
|
|
|
if (!e.peopleLimit) e.peopleLimit = '' |
|
|
|
if (!e.percentageLimit) e.percentageLimit = '' |
|
|
|
if (!e.percentageLimit) e.percentageLimit = '' |
|
|
|
e.teamNumLimitOpt = e.teamNumLimit ? 1 : 0 |
|
|
|
|
|
|
|
e.teamCalculationMethod = +e.teamCalculationMethod |
|
|
|
e.teamCalculationMethod = +e.teamCalculationMethod |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.form = rule |
|
|
|
this.form = rule |
|
|
@ -397,7 +396,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
form.competitionStageList = stages.slice(0, 1) // 单项赛只需要存第一个阶段的数据 |
|
|
|
form.competitionStageList = stages.slice(0, 1) // 单项赛只需要存第一个阶段的数据 |
|
|
|
} else { // 非积分赛则全部字段校验 |
|
|
|
} else { // 非积分赛则全部字段校验 |
|
|
|
let teamNumLimit = 0 |
|
|
|
let customNumber = 0 |
|
|
|
const { competitionType, minTeamSize, maxTeamSize } = step1.completeCompetitionSetup // 0为个人赛,1为团队赛 |
|
|
|
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] |
|
|
@ -425,16 +424,16 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
if (e.score !== '') e.scoreLimit = e.operator + e.score |
|
|
|
if (e.score !== '') e.scoreLimit = e.operator + e.score |
|
|
|
} |
|
|
|
} |
|
|
|
if (rule !== 2 && competitionType && e.teamNumLimitOpt) { |
|
|
|
if (rule !== 2 && competitionType && e.teamNumLimit) { |
|
|
|
if (e.teamNumLimit === '') { |
|
|
|
if (e.customNumber === '') { |
|
|
|
invalid = 1 |
|
|
|
invalid = 1 |
|
|
|
util.errorMsg('请输入团队参数人数限制') |
|
|
|
util.errorMsg('请输入团队参数人数限制') |
|
|
|
break |
|
|
|
break |
|
|
|
} else if (e.teamNumLimit < 0) { |
|
|
|
} else if (e.customNumber < 0) { |
|
|
|
invalid = 1 |
|
|
|
invalid = 1 |
|
|
|
util.errorMsg('团队参数人数不得小于0') |
|
|
|
util.errorMsg('团队参数人数不得小于0') |
|
|
|
break |
|
|
|
break |
|
|
|
} else if (maxTeamSize !== '' && e.teamNumLimit > maxTeamSize) { |
|
|
|
} else if (maxTeamSize !== '' && e.customNumber > maxTeamSize) { |
|
|
|
invalid = 1 |
|
|
|
invalid = 1 |
|
|
|
util.errorMsg('团队参数人数不得大于团队人数上限') |
|
|
|
util.errorMsg('团队参数人数不得大于团队人数上限') |
|
|
|
break |
|
|
|
break |
|
|
@ -453,12 +452,12 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
e.resultAnnouncementTime = +e.resultAnnouncementTime |
|
|
|
e.resultAnnouncementTime = +e.resultAnnouncementTime |
|
|
|
} |
|
|
|
} |
|
|
|
if (e.teamNumLimitOpt && e.teamNumLimit) teamNumLimit += e.teamNumLimit // 各阶段自定义的人数之和 |
|
|
|
if (e.teamNumLimit && e.customNumber) customNumber += e.customNumber // 各阶段自定义的人数之和 |
|
|
|
} |
|
|
|
} |
|
|
|
if (invalid) return |
|
|
|
if (invalid) return |
|
|
|
if (form.teamLimit && competitionType) { |
|
|
|
if (form.teamLimit && competitionType) { |
|
|
|
if (stages.length > minTeamSize) return util.errorMsg('阶段数不得大于团队人数下限') |
|
|
|
if (stages.length > minTeamSize) return util.errorMsg('阶段数不得大于团队人数下限') |
|
|
|
if (teamNumLimit > minTeamSize) return util.errorMsg('各阶段自定义的参赛人数之和不得大于团队人数下限') |
|
|
|
if (customNumber > 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,请重新输入') |
|
|
|
} |
|
|
|
} |
|
|
@ -466,7 +465,7 @@ export default { |
|
|
|
form.competitionStageList = form.competitionStageList.filter(e => e.stageName) |
|
|
|
form.competitionStageList = form.competitionStageList.filter(e => e.stageName) |
|
|
|
} |
|
|
|
} |
|
|
|
for (const e of form.competitionStageList) { |
|
|
|
for (const e of form.competitionStageList) { |
|
|
|
if (!e.teamNumLimitOpt) e.teamNumLimit = 0 |
|
|
|
if (!e.teamNumLimit) e.customNumber = 0 |
|
|
|
} |
|
|
|
} |
|
|
|
this.$parent.showLoad() |
|
|
|
this.$parent.showLoad() |
|
|
|
if (form.ruleId) { |
|
|
|
if (form.ruleId) { |
|
|
|