|
|
@ -1,143 +1,217 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<div class="page"> |
|
|
|
<div class="page"> |
|
|
|
<div class="page-content"> |
|
|
|
<div class="page-content"> |
|
|
|
<div class="p-title">赛程与规则设置</div> |
|
|
|
<div class="p-title">赛程与规则设置</div> |
|
|
|
<el-form :model="form" :rules="validRules" label-width="170px" label-suffix=":" size="small" :disabled="!editing && id"> |
|
|
|
<el-form :model="form" |
|
|
|
<el-form-item label="竞赛类型"> |
|
|
|
:rules="validRules" |
|
|
|
{{ step1.completeCompetitionSetup.competitionType ? '团队赛(' + step1.completeCompetitionSetup.minTeamSize + '-' + step1.completeCompetitionSetup.maxTeamSize + '人/队)' : '个人赛' }} <span class="tips">(如需修改,请返回上一步。)</span> |
|
|
|
label-width="170px" |
|
|
|
</el-form-item> |
|
|
|
label-suffix=":" |
|
|
|
<el-form-item prop="rule" label="赛制"> |
|
|
|
size="small" |
|
|
|
<el-radio v-for="(rule, i) in rules" :key="i" v-model="form.rule" :label="rule.id">{{ rule.name }}</el-radio> |
|
|
|
:disabled="!editing && id"> |
|
|
|
<p class="tips">积分赛——包含多个竞赛阶段,每个阶段的成绩都包含在最终总成绩里,最后一轮结束后总成绩排名靠前的参赛者得到获奖资格。</p> |
|
|
|
<el-form-item label="竞赛类型"> |
|
|
|
<p class="tips">淘汰赛——包含多个竞赛阶段,每个阶段结束后之后只有部分参赛者能晋级下一阶段,晋级最后一轮且在最后一轮排名靠前的参赛者得到获奖资格。</p> |
|
|
|
{{ step1.completeCompetitionSetup.competitionType ? '团队赛(' + step1.completeCompetitionSetup.minTeamSize + '-' + step1.completeCompetitionSetup.maxTeamSize + '人/队)' : '个人赛' }} <span class="tips">(如需修改,请返回上一步。)</span> |
|
|
|
<p class="tips">单项赛——仅包含一个竞赛阶段,单项的成绩排名即为最终排名,排名靠前的参赛者得到获奖资格。</p> |
|
|
|
</el-form-item> |
|
|
|
<p class="tips">注:系统默认排名规则,优先按分数排名(分数高则排名靠前),分数相同则按用时排名(用时短则排名靠前)。</p> |
|
|
|
<el-form-item prop="rule" |
|
|
|
</el-form-item> |
|
|
|
label="赛制"> |
|
|
|
<template v-if="form.rule !== 2"> |
|
|
|
<el-radio v-for="(rule, i) in rules" |
|
|
|
<el-form-item prop="stageNum" label="阶段数量"> |
|
|
|
:key="i" |
|
|
|
<div class="input-center"> |
|
|
|
v-model="form.rule" |
|
|
|
<el-select v-model="form.stageNum" @change="stageChange"> |
|
|
|
:label="rule.id">{{ rule.name }}</el-radio> |
|
|
|
<el-option v-for="i in 10" :key="i" :label="i" :value="i"></el-option> |
|
|
|
<p class="tips">积分赛——包含多个竞赛阶段,每个阶段的成绩都包含在最终总成绩里,最后一轮结束后总成绩排名靠前的参赛者得到获奖资格。</p> |
|
|
|
</el-select> |
|
|
|
<p class="tips">淘汰赛——包含多个竞赛阶段,每个阶段结束后之后只有部分参赛者能晋级下一阶段,晋级最后一轮且在最后一轮排名靠前的参赛者得到获奖资格。</p> |
|
|
|
</div> |
|
|
|
<p class="tips">单项赛——仅包含一个竞赛阶段,单项的成绩排名即为最终排名,排名靠前的参赛者得到获奖资格。</p> |
|
|
|
<div v-if="step1.completeCompetitionSetup.competitionType" class="tips"> |
|
|
|
<p class="tips">注:系统默认排名规则,优先按分数排名(分数高则排名靠前),分数相同则按用时排名(用时短则排名靠前)。</p> |
|
|
|
(团队赛是否限制队内每个成员只能参加一个阶段赛项? |
|
|
|
</el-form-item> |
|
|
|
<el-radio v-model="form.teamLimit" :label="1">是</el-radio> |
|
|
|
<template v-if="form.rule !== 2"> |
|
|
|
<el-radio v-model="form.teamLimit" :label="0">否</el-radio> |
|
|
|
<el-form-item prop="stageNum" |
|
|
|
) |
|
|
|
label="阶段数量"> |
|
|
|
</div> |
|
|
|
<div class="input-center"> |
|
|
|
</el-form-item> |
|
|
|
<el-select v-model="form.stageNum" |
|
|
|
<el-form-item v-if="!form.rule" prop="resultCalculationMethod" label="总成绩计算方式"> |
|
|
|
@change="stageChange"> |
|
|
|
<el-radio v-model="form.resultCalculationMethod" :label="0">各阶段成绩加权求和</el-radio> |
|
|
|
<el-option v-for="i in 10" |
|
|
|
<el-radio v-model="form.resultCalculationMethod" :label="1">各阶段成绩直接求和</el-radio> |
|
|
|
:key="i" |
|
|
|
<el-radio v-model="form.resultCalculationMethod" :label="2">各阶段成绩取平均值</el-radio> |
|
|
|
:label="i" |
|
|
|
<p class="tips">(若选择加权求和,则需要设置每个阶段成绩所占权重,且权重总和须为100%)</p> |
|
|
|
:value="i"></el-option> |
|
|
|
</el-form-item> |
|
|
|
</el-select> |
|
|
|
<el-form-item prop="stageNum" label="阶段设置"> |
|
|
|
</div> |
|
|
|
<div v-for="(item, i) in form.competitionStageList" :key="i" class="step-set"> |
|
|
|
<div v-if="step1.completeCompetitionSetup.competitionType" |
|
|
|
<div class="line"> |
|
|
|
class="tips"> |
|
|
|
第{{ serials[i] }}阶段 <el-input v-model="item.stageName" clearable placeholder="请输入阶段名称,如“初赛”" style="width: 200px"></el-input> |
|
|
|
(团队赛是否限制队内每个成员只能参加一个阶段赛项? |
|
|
|
</div> |
|
|
|
<el-radio v-model="form.teamLimit" |
|
|
|
<div class="line"> |
|
|
|
:label="1">是</el-radio> |
|
|
|
<span class="req">*</span> |
|
|
|
<el-radio v-model="form.teamLimit" |
|
|
|
比赛方式: |
|
|
|
:label="0">否</el-radio> |
|
|
|
<el-radio v-for="(method, i) in methods" :key="i" v-model="item.method" :label="method.id">{{ method.name }}</el-radio> |
|
|
|
) |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="step1.completeCompetitionSetup.competitionType" class="line"> |
|
|
|
</el-form-item> |
|
|
|
<span class="req">*</span> |
|
|
|
<el-form-item v-if="!form.rule" |
|
|
|
团队参赛人数限制: |
|
|
|
prop="resultCalculationMethod" |
|
|
|
<el-radio v-model="item.teamNumLimitOpt" :label="0">不限制</el-radio> |
|
|
|
label="总成绩计算方式"> |
|
|
|
<el-radio v-model="item.teamNumLimitOpt" :label="1">自定义</el-radio> |
|
|
|
<el-radio v-model="form.resultCalculationMethod" |
|
|
|
<el-input v-model.number="item.teamNumLimit" type="number" style="width: 150px;" :disabled="item.teamNumLimitOpt === 0"></el-input> 人 |
|
|
|
:label="0">各阶段成绩加权求和</el-radio> |
|
|
|
<span class="tips">(可限制本阶段单个团队的出战人数)</span> |
|
|
|
<el-radio v-model="form.resultCalculationMethod" |
|
|
|
</div> |
|
|
|
:label="1">各阶段成绩直接求和</el-radio> |
|
|
|
<div v-if="step1.completeCompetitionSetup.competitionType" class="line"> |
|
|
|
<el-radio v-model="form.resultCalculationMethod" |
|
|
|
<span class="req">*</span> |
|
|
|
:label="2">各阶段成绩取平均值</el-radio> |
|
|
|
团队成绩计算方式: |
|
|
|
<p class="tips">(若选择加权求和,则需要设置每个阶段成绩所占权重,且权重总和须为100%)</p> |
|
|
|
<el-radio v-for="(j, i) in teamCalculationMethods" :key="i" v-model="item.teamCalculationMethod" :label="j.id">{{ j.name }}</el-radio> |
|
|
|
</el-form-item> |
|
|
|
<span class="tips">(可设置本阶段的团队取分规则)</span> |
|
|
|
<el-form-item prop="stageNum" |
|
|
|
</div> |
|
|
|
label="阶段设置"> |
|
|
|
<div v-if="form.rule === 1 && i !== form.competitionStageList.length - 1" class="line" style="display: flex;"> |
|
|
|
<div v-for="(item, i) in form.competitionStageList" |
|
|
|
<p> |
|
|
|
:key="i" |
|
|
|
<span class="req">*</span>晋级规则: |
|
|
|
class="step-set"> |
|
|
|
</p> |
|
|
|
<div class="line"> |
|
|
|
<div> |
|
|
|
第{{ serials[i] }}阶段 <el-input v-model="item.stageName" |
|
|
|
<div class="line"> |
|
|
|
clearable |
|
|
|
本阶段成绩排名前 |
|
|
|
placeholder="请输入阶段名称,如“初赛”" |
|
|
|
<el-input v-model.number="item.peopleLimit" type="number" style="width: 100px"></el-input> |
|
|
|
style="width: 200px"></el-input> |
|
|
|
队,可晋级下一阶段比赛 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="line"> |
|
|
|
<div class="line"> |
|
|
|
<span class="req">*</span> |
|
|
|
本阶段成绩排名前 |
|
|
|
比赛方式: |
|
|
|
<el-input v-model.number="item.percentageLimit" type="number" style="width: 100px"></el-input> |
|
|
|
<el-radio v-for="(method, i) in methods" |
|
|
|
%,可晋级下一阶段比赛 |
|
|
|
:key="i" |
|
|
|
</div> |
|
|
|
v-model="item.method" |
|
|
|
<div> |
|
|
|
:label="method.id">{{ method.name }}</el-radio> |
|
|
|
本阶段成绩 |
|
|
|
</div> |
|
|
|
<el-select v-model="item.operator" style="width: 80px;margin-right: 10px"> |
|
|
|
<div v-if="step1.completeCompetitionSetup.competitionType" |
|
|
|
<el-option v-for="i in operators" :key="i" :label="i" :value="i"></el-option> |
|
|
|
class="line"> |
|
|
|
</el-select> |
|
|
|
<span class="req">*</span> |
|
|
|
<el-input v-model="item.score" type="number" style="width: 100px"></el-input> |
|
|
|
团队参赛人数限制: |
|
|
|
分,可晋级下一阶段比赛 |
|
|
|
<el-radio v-model="item.teamNumLimitOpt" |
|
|
|
</div> |
|
|
|
:label="0">不限制</el-radio> |
|
|
|
</div> |
|
|
|
<el-radio v-model="item.teamNumLimitOpt" |
|
|
|
</div> |
|
|
|
:label="1">自定义</el-radio> |
|
|
|
<div v-if="!form.rule" class="line"> |
|
|
|
<el-input v-model.number="item.teamNumLimit" |
|
|
|
<span class="req">*</span> |
|
|
|
type="number" |
|
|
|
占总成绩权重: |
|
|
|
style="width: 150px;" |
|
|
|
<el-input v-model.number="item.pointWeight" type="number" :disabled="form.resultCalculationMethod != 0" style="width: 150px;"></el-input> % |
|
|
|
:disabled="item.teamNumLimitOpt === 0"></el-input> 人 |
|
|
|
</div> |
|
|
|
<span class="tips">(可限制本阶段单个团队的出战人数)</span> |
|
|
|
<div class="line"> |
|
|
|
</div> |
|
|
|
<span class="req">*</span> |
|
|
|
<div v-if="step1.completeCompetitionSetup.competitionType" |
|
|
|
成绩公布时间: |
|
|
|
class="line"> |
|
|
|
(阶段)比赛结束后 |
|
|
|
<span class="req">*</span> |
|
|
|
<el-input v-model.number="item.resultAnnouncementTime" type="number" style="width: 120px"></el-input> |
|
|
|
团队成绩计算方式: |
|
|
|
小时,公布(阶段)比赛成绩。 |
|
|
|
<el-radio v-for="(j, i) in teamCalculationMethods" |
|
|
|
</div> |
|
|
|
:key="i" |
|
|
|
<div class="line"> |
|
|
|
v-model="item.teamCalculationMethod" |
|
|
|
<span class="req">*</span> |
|
|
|
:label="j.id">{{ j.name }}</el-radio> |
|
|
|
是否公布成绩详情: |
|
|
|
<span class="tips">(可设置本阶段的团队取分规则)</span> |
|
|
|
<el-radio v-model="item.resultsDetails" :label="0">是</el-radio> |
|
|
|
</div> |
|
|
|
<el-radio v-model="item.resultsDetails" :label="1">否</el-radio> |
|
|
|
<div v-if="form.rule === 1 && i !== form.competitionStageList.length - 1" |
|
|
|
<p class="tips">若选择“是”,则公布成绩详情,竞赛结束后参赛者可查看自己的比赛成绩得分详情;</p> |
|
|
|
class="line" |
|
|
|
<p class="tips">若选择“否”,则不公布成绩详情,参赛者只能知晓自己的分数及排名,不能查看得分详情。</p> |
|
|
|
style="display: flex;"> |
|
|
|
</div> |
|
|
|
<p> |
|
|
|
|
|
|
|
<span class="req">*</span>晋级规则: |
|
|
|
|
|
|
|
</p> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<div class="line"> |
|
|
|
|
|
|
|
本阶段成绩排名前 |
|
|
|
|
|
|
|
<el-input v-model.number="item.peopleLimit" |
|
|
|
|
|
|
|
type="number" |
|
|
|
|
|
|
|
style="width: 100px"></el-input> |
|
|
|
|
|
|
|
队,可晋级下一阶段比赛 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
<div class="line"> |
|
|
|
</template> |
|
|
|
本阶段成绩排名前 |
|
|
|
<template v-else> |
|
|
|
<el-input v-model.number="item.percentageLimit" |
|
|
|
<el-form-item prop="stageNum" label="规则设置"> |
|
|
|
type="number" |
|
|
|
<div class="step-set"> |
|
|
|
style="width: 100px"></el-input> |
|
|
|
<div class="line"> |
|
|
|
%,可晋级下一阶段比赛 |
|
|
|
<span class="req">*</span> |
|
|
|
|
|
|
|
比赛方式: |
|
|
|
|
|
|
|
<el-radio v-for="(method, i) in methods" :key="i" v-model="form.competitionStageList[0].method" :label="method.id">{{ method.name }}</el-radio> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="step1.completeCompetitionSetup.competitionType" class="line"> |
|
|
|
|
|
|
|
<span class="req">*</span> |
|
|
|
|
|
|
|
团队成绩计算方式: |
|
|
|
|
|
|
|
<el-radio v-for="(j, i) in teamCalculationMethods" :key="i" v-model="form.competitionStageList[0].teamCalculationMethod" :label="j.id">{{ j.name }}</el-radio> |
|
|
|
|
|
|
|
<span class="tips">(可设置本阶段的团队取分规则)</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
<div> |
|
|
|
<el-form-item prop="rule" label="成绩公布时间"> |
|
|
|
本阶段成绩 |
|
|
|
(阶段)比赛结束后 |
|
|
|
<el-select v-model="item.operator" |
|
|
|
<el-input v-model.number="form.competitionStageList[0].resultAnnouncementTime" type="number" style="width: 120px"></el-input> |
|
|
|
style="width: 80px;margin-right: 10px"> |
|
|
|
小时,公布(阶段)比赛成绩。 |
|
|
|
<el-option v-for="i in operators" |
|
|
|
</el-form-item> |
|
|
|
:key="i" |
|
|
|
<el-form-item prop="resultsDetails" label="是否公布成绩详情"> |
|
|
|
:label="i" |
|
|
|
<el-radio v-model="form.competitionStageList[0].resultsDetails" :label="0">是</el-radio> |
|
|
|
:value="i"></el-option> |
|
|
|
<el-radio v-model="form.competitionStageList[0].resultsDetails" :label="1">否</el-radio> |
|
|
|
</el-select> |
|
|
|
<p class="tips">若选择“是”,则公布成绩详情,竞赛结束后参赛者可查看自己的比赛成绩得分详情;</p> |
|
|
|
<el-input v-model="item.score" |
|
|
|
<p class="tips">若选择“否”,则不公布成绩详情,参赛者只能知晓自己的分数及排名,不能查看得分详情。</p> |
|
|
|
type="number" |
|
|
|
</el-form-item> |
|
|
|
style="width: 100px"></el-input> |
|
|
|
</template> |
|
|
|
分,可晋级下一阶段比赛 |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="!form.rule" |
|
|
|
|
|
|
|
class="line"> |
|
|
|
|
|
|
|
<span class="req">*</span> |
|
|
|
|
|
|
|
占总成绩权重: |
|
|
|
|
|
|
|
<el-input v-model.number="item.pointWeight" |
|
|
|
|
|
|
|
type="number" |
|
|
|
|
|
|
|
:disabled="form.resultCalculationMethod != 0" |
|
|
|
|
|
|
|
style="width: 150px;"></el-input> % |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="line"> |
|
|
|
|
|
|
|
成绩公布时间: |
|
|
|
|
|
|
|
(阶段)比赛结束后 |
|
|
|
|
|
|
|
<el-input v-model.number="item.resultAnnouncementTime" |
|
|
|
|
|
|
|
type="number" |
|
|
|
|
|
|
|
style="width: 120px"></el-input> |
|
|
|
|
|
|
|
小时,公布(阶段)比赛成绩。 |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="item.resultAnnouncementTime != 0" |
|
|
|
|
|
|
|
class="line"> |
|
|
|
|
|
|
|
是否公布成绩详情: |
|
|
|
|
|
|
|
<el-radio v-model="item.resultsDetails" |
|
|
|
|
|
|
|
:label="0">是</el-radio> |
|
|
|
|
|
|
|
<el-radio v-model="item.resultsDetails" |
|
|
|
|
|
|
|
:label="1">否</el-radio> |
|
|
|
|
|
|
|
<p class="tips">若选择“是”,则公布成绩详情,竞赛结束后参赛者可查看自己的比赛成绩得分详情;</p> |
|
|
|
|
|
|
|
<p class="tips">若选择“否”,则不公布成绩详情,参赛者只能知晓自己的分数及排名,不能查看得分详情。</p> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<template v-else> |
|
|
|
|
|
|
|
<el-form-item prop="stageNum" |
|
|
|
|
|
|
|
label="规则设置"> |
|
|
|
|
|
|
|
<div class="step-set"> |
|
|
|
|
|
|
|
<div class="line"> |
|
|
|
|
|
|
|
<span class="req">*</span> |
|
|
|
|
|
|
|
比赛方式: |
|
|
|
|
|
|
|
<el-radio v-for="(method, i) in methods" |
|
|
|
|
|
|
|
:key="i" |
|
|
|
|
|
|
|
v-model="form.competitionStageList[0].method" |
|
|
|
|
|
|
|
:label="method.id">{{ method.name }}</el-radio> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="step1.completeCompetitionSetup.competitionType" |
|
|
|
|
|
|
|
class="line"> |
|
|
|
|
|
|
|
<span class="req">*</span> |
|
|
|
|
|
|
|
团队成绩计算方式: |
|
|
|
|
|
|
|
<el-radio v-for="(j, i) in teamCalculationMethods" |
|
|
|
|
|
|
|
:key="i" |
|
|
|
|
|
|
|
v-model="form.competitionStageList[0].teamCalculationMethod" |
|
|
|
|
|
|
|
:label="j.id">{{ j.name }}</el-radio> |
|
|
|
|
|
|
|
<span class="tips">(可设置本阶段的团队取分规则)</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item prop="rule" |
|
|
|
|
|
|
|
label="成绩公布时间"> |
|
|
|
|
|
|
|
(阶段)比赛结束后 |
|
|
|
|
|
|
|
<el-input v-model.number="form.competitionStageList[0].resultAnnouncementTime" |
|
|
|
|
|
|
|
type="number" |
|
|
|
|
|
|
|
style="width: 120px"></el-input> |
|
|
|
|
|
|
|
小时,公布(阶段)比赛成绩。 |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item prop="resultsDetails" |
|
|
|
|
|
|
|
label="是否公布成绩详情"> |
|
|
|
|
|
|
|
<el-radio v-model="form.competitionStageList[0].resultsDetails" |
|
|
|
|
|
|
|
:label="0">是</el-radio> |
|
|
|
|
|
|
|
<el-radio v-model="form.competitionStageList[0].resultsDetails" |
|
|
|
|
|
|
|
:label="1">否</el-radio> |
|
|
|
|
|
|
|
<p class="tips">若选择“是”,则公布成绩详情,竞赛结束后参赛者可查看自己的比赛成绩得分详情;</p> |
|
|
|
|
|
|
|
<p class="tips">若选择“否”,则不公布成绩详情,参赛者只能知晓自己的分数及排名,不能查看得分详情。</p> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
@ -145,285 +219,278 @@ import util from "@/libs/util"; |
|
|
|
import quill from "@/components/quill"; |
|
|
|
import quill from "@/components/quill"; |
|
|
|
import Const from '@/const/match' |
|
|
|
import Const from '@/const/match' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
props: ['setupId', 'editing'], |
|
|
|
props: ['setupId', 'editing'], |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
id: this.$route.query.id, |
|
|
|
id: this.$route.query.id, |
|
|
|
updateTime: 0, |
|
|
|
updateTime: 0, |
|
|
|
step1: this.$parent.$refs.step1.form, |
|
|
|
step1: this.$parent.$refs.step1.form, |
|
|
|
serials: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'], |
|
|
|
serials: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'], |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
resultCalculationMethod: 0, |
|
|
|
resultCalculationMethod: 0, |
|
|
|
rule: 0, |
|
|
|
rule: 0, |
|
|
|
stageNum: 3, |
|
|
|
stageNum: 3, |
|
|
|
teamLimit: 1, |
|
|
|
teamLimit: 1, |
|
|
|
competitionStageList: [ |
|
|
|
competitionStageList: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
method: 0, |
|
|
|
method: 0, |
|
|
|
number: 1, |
|
|
|
number: 1, |
|
|
|
pointWeight: '', |
|
|
|
pointWeight: '', |
|
|
|
stageName: '', |
|
|
|
stageName: '', |
|
|
|
teamCalculationMethod: 0, |
|
|
|
teamCalculationMethod: 0, |
|
|
|
peopleLimit: '', |
|
|
|
peopleLimit: '', |
|
|
|
percentageLimit: '', |
|
|
|
percentageLimit: '', |
|
|
|
scoreLimit: '', |
|
|
|
scoreLimit: '', |
|
|
|
operator: '>', |
|
|
|
operator: '>', |
|
|
|
score: '', |
|
|
|
score: '', |
|
|
|
teamNumLimit: '', |
|
|
|
teamNumLimit: '', |
|
|
|
teamNumLimitOpt: 0, |
|
|
|
teamNumLimitOpt: 0, |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultAnnouncementTime: '', |
|
|
|
resultsDetails: 0, |
|
|
|
resultsDetails: '', |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
method: 0, |
|
|
|
|
|
|
|
number: 2, |
|
|
|
|
|
|
|
pointWeight: '', |
|
|
|
|
|
|
|
stageName: '', |
|
|
|
|
|
|
|
teamCalculationMethod: 0, |
|
|
|
|
|
|
|
peopleLimit: '', |
|
|
|
|
|
|
|
percentageLimit: '', |
|
|
|
|
|
|
|
scoreLimit: '', |
|
|
|
|
|
|
|
operator: '>', |
|
|
|
|
|
|
|
score: '', |
|
|
|
|
|
|
|
teamNumLimit: '', |
|
|
|
|
|
|
|
teamNumLimitOpt: 0, |
|
|
|
|
|
|
|
resultAnnouncementTime: '', |
|
|
|
|
|
|
|
resultsDetails: 0, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
method: 0, |
|
|
|
|
|
|
|
number: 3, |
|
|
|
|
|
|
|
pointWeight: '', |
|
|
|
|
|
|
|
stageName: '', |
|
|
|
|
|
|
|
teamCalculationMethod: 0, |
|
|
|
|
|
|
|
peopleLimit: '', |
|
|
|
|
|
|
|
percentageLimit: '', |
|
|
|
|
|
|
|
scoreLimit: '', |
|
|
|
|
|
|
|
operator: '>', |
|
|
|
|
|
|
|
score: '', |
|
|
|
|
|
|
|
teamNumLimit: '', |
|
|
|
|
|
|
|
teamNumLimitOpt: 0, |
|
|
|
|
|
|
|
resultAnnouncementTime: '', |
|
|
|
|
|
|
|
resultsDetails: 0, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
validRules: { |
|
|
|
{ |
|
|
|
rule: [ |
|
|
|
method: 0, |
|
|
|
{ required: true, trigger: 'change' } |
|
|
|
number: 2, |
|
|
|
], |
|
|
|
pointWeight: '', |
|
|
|
stageNum: [ |
|
|
|
stageName: '', |
|
|
|
{ required: true, trigger: 'change' } |
|
|
|
teamCalculationMethod: 0, |
|
|
|
], |
|
|
|
peopleLimit: '', |
|
|
|
resultCalculationMethod: [ |
|
|
|
percentageLimit: '', |
|
|
|
{ required: true, trigger: 'change' } |
|
|
|
scoreLimit: '', |
|
|
|
], |
|
|
|
operator: '>', |
|
|
|
resultAnnouncementTime: [ |
|
|
|
score: '', |
|
|
|
{ required: true, message: '请输入成绩公布时间', trigger: 'change' } |
|
|
|
teamNumLimit: '', |
|
|
|
], |
|
|
|
teamNumLimitOpt: 0, |
|
|
|
resultsDetails: [ |
|
|
|
resultAnnouncementTime: '', |
|
|
|
{ required: true, trigger: 'change' } |
|
|
|
resultsDetails: '', |
|
|
|
], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
ruleForm: {}, |
|
|
|
|
|
|
|
rules: Const.rules, |
|
|
|
|
|
|
|
methods: Const.methods, |
|
|
|
|
|
|
|
teamCalculationMethods: Const.teamCalculationMethods, |
|
|
|
|
|
|
|
operators: ['>', '>=', '=', '<', '<='] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
|
|
|
|
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
|
|
|
|
|
|
|
form: { |
|
|
|
|
|
|
|
handler(){ |
|
|
|
|
|
|
|
this.updateTime++ |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
deep:true |
|
|
|
{ |
|
|
|
}, |
|
|
|
method: 0, |
|
|
|
}, |
|
|
|
number: 3, |
|
|
|
mounted() { |
|
|
|
pointWeight: '', |
|
|
|
this.ruleForm = JSON.parse(JSON.stringify(this.form.competitionStageList[0])) |
|
|
|
stageName: '', |
|
|
|
this.id && this.getData() |
|
|
|
teamCalculationMethod: 0, |
|
|
|
this.step1 || this.getStep1() // 如果没有第一步的数据,则直接接口获取 |
|
|
|
peopleLimit: '', |
|
|
|
}, |
|
|
|
percentageLimit: '', |
|
|
|
methods: { |
|
|
|
scoreLimit: '', |
|
|
|
getData() { |
|
|
|
operator: '>', |
|
|
|
this.$get(this.api.getCompetitionRule, { |
|
|
|
score: '', |
|
|
|
competitionId: this.id |
|
|
|
teamNumLimit: '', |
|
|
|
}).then(res => { |
|
|
|
teamNumLimitOpt: 0, |
|
|
|
const rule = res.competitionRule |
|
|
|
resultAnnouncementTime: '', |
|
|
|
if (rule) { |
|
|
|
resultsDetails: '', |
|
|
|
rule.competitionStageList.map(e => { |
|
|
|
|
|
|
|
const limit = e.scoreLimit |
|
|
|
|
|
|
|
if (limit) { |
|
|
|
|
|
|
|
e.operator = limit.replace(/\d+/, '') |
|
|
|
|
|
|
|
const num = limit.replace(/\D+/, '') |
|
|
|
|
|
|
|
if (num) e.score = num |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
e.operator = '>' |
|
|
|
|
|
|
|
e.score = '' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!e.peopleLimit) e.peopleLimit = '' |
|
|
|
|
|
|
|
if (!e.percentageLimit) e.percentageLimit = '' |
|
|
|
|
|
|
|
e.teamNumLimitOpt = e.teamNumLimit ? 1 : 0 |
|
|
|
|
|
|
|
e.teamCalculationMethod = +e.teamCalculationMethod |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.form = rule |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
this.$nextTick(() => { |
|
|
|
] |
|
|
|
this.updateTime = 0 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取第二部的数据 |
|
|
|
validRules: { |
|
|
|
getStep1() { |
|
|
|
rule: [ |
|
|
|
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { |
|
|
|
{ required: true, trigger: 'change' } |
|
|
|
this.step1 = competition |
|
|
|
], |
|
|
|
const { minTeamSize, maxTeamSize, competitionType } = this.step1.completeCompetitionSetup |
|
|
|
stageNum: [ |
|
|
|
competitionType && minTeamSize !== '' && maxTeamSize !== '' && minTeamSize == maxTeamSize && this.teamCalculationMethods.pop() // 团队上下限人数相等,则不显示求和 |
|
|
|
{ required: true, trigger: 'change' } |
|
|
|
}).catch(err => {}) |
|
|
|
], |
|
|
|
|
|
|
|
resultCalculationMethod: [ |
|
|
|
|
|
|
|
{ required: true, trigger: 'change' } |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
resultAnnouncementTime: [ |
|
|
|
|
|
|
|
{ required: true, message: '请输入成绩公布时间', trigger: 'change' } |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
resultsDetails: [ |
|
|
|
|
|
|
|
{ required: true, trigger: 'change' } |
|
|
|
|
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 阶段数量选择回调 |
|
|
|
ruleForm: {}, |
|
|
|
stageChange(val) { |
|
|
|
rules: Const.rules, |
|
|
|
const stages = this.form.competitionStageList |
|
|
|
methods: Const.methods, |
|
|
|
const { ruleId } = this.form |
|
|
|
teamCalculationMethods: Const.teamCalculationMethods, |
|
|
|
if (stages.length < val) { |
|
|
|
operators: ['>', '>=', '=', '<', '<='] |
|
|
|
const list = [] |
|
|
|
}; |
|
|
|
for (let i = 1; i <= val - stages.length; i++) { |
|
|
|
}, |
|
|
|
const form = JSON.parse(JSON.stringify(this.ruleForm)) |
|
|
|
watch: { |
|
|
|
form.number = stages.length + i |
|
|
|
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
|
|
|
if (ruleId) form.ruleId = ruleId |
|
|
|
form: { |
|
|
|
this.form.competitionStageList.push(form) |
|
|
|
handler () { |
|
|
|
} |
|
|
|
this.updateTime++ |
|
|
|
} else { |
|
|
|
|
|
|
|
this.form.competitionStageList = stages.slice(0, val) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
deep: true |
|
|
|
save(status, next = 0) { |
|
|
|
}, |
|
|
|
let { form } = this |
|
|
|
}, |
|
|
|
const { rule } = form |
|
|
|
mounted () { |
|
|
|
let invalid = 0 |
|
|
|
this.ruleForm = JSON.parse(JSON.stringify(this.form.competitionStageList[0])) |
|
|
|
let pointWeight = 0 |
|
|
|
this.id && this.getData() |
|
|
|
const { step1 } = this |
|
|
|
this.step1 || this.getStep1() // 如果没有第一步的数据,则直接接口获取 |
|
|
|
// 下一步需要校验 |
|
|
|
}, |
|
|
|
if (next === 2) { |
|
|
|
methods: { |
|
|
|
let stages = form.competitionStageList |
|
|
|
getData () { |
|
|
|
if (form.rule === 2) { // 单项赛只需要输入成绩公布时间 |
|
|
|
this.$get(this.api.getCompetitionRule, { |
|
|
|
const e = stages[0] |
|
|
|
competitionId: this.id |
|
|
|
e.stageName = step1.name |
|
|
|
}).then(res => { |
|
|
|
if (!e.resultsDetails) { |
|
|
|
const rule = res.competitionRule |
|
|
|
if (e.resultAnnouncementTime === '') { |
|
|
|
if (rule) { |
|
|
|
return util.errorMsg('请填写成绩公布时间') |
|
|
|
rule.competitionStageList.map(e => { |
|
|
|
} |
|
|
|
const limit = e.scoreLimit |
|
|
|
if (e.resultAnnouncementTime < 0) { |
|
|
|
if (limit) { |
|
|
|
return util.errorMsg('成绩公布时间不得小于0') |
|
|
|
e.operator = limit.replace(/\d+/, '') |
|
|
|
|
|
|
|
const num = limit.replace(/\D+/, '') |
|
|
|
|
|
|
|
if (num) e.score = num |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
e.operator = '>' |
|
|
|
|
|
|
|
e.score = '' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!e.peopleLimit) e.peopleLimit = '' |
|
|
|
|
|
|
|
if (!e.percentageLimit) e.percentageLimit = '' |
|
|
|
|
|
|
|
e.teamNumLimitOpt = e.teamNumLimit ? 1 : 0 |
|
|
|
|
|
|
|
e.teamCalculationMethod = +e.teamCalculationMethod |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.form = rule |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.updateTime = 0 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}).catch(res => { }) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取第二部的数据 |
|
|
|
|
|
|
|
getStep1 () { |
|
|
|
|
|
|
|
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { |
|
|
|
|
|
|
|
this.step1 = competition |
|
|
|
|
|
|
|
const { minTeamSize, maxTeamSize, competitionType } = this.step1.completeCompetitionSetup |
|
|
|
|
|
|
|
competitionType && minTeamSize !== '' && maxTeamSize !== '' && minTeamSize == maxTeamSize && this.teamCalculationMethods.pop() // 团队上下限人数相等,则不显示求和 |
|
|
|
|
|
|
|
}).catch(err => { }) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 阶段数量选择回调 |
|
|
|
|
|
|
|
stageChange (val) { |
|
|
|
|
|
|
|
const stages = this.form.competitionStageList |
|
|
|
|
|
|
|
const { ruleId } = this.form |
|
|
|
|
|
|
|
if (stages.length < val) { |
|
|
|
|
|
|
|
const list = [] |
|
|
|
|
|
|
|
for (let i = 1; i <= val - stages.length; i++) { |
|
|
|
|
|
|
|
const form = JSON.parse(JSON.stringify(this.ruleForm)) |
|
|
|
|
|
|
|
form.number = stages.length + i |
|
|
|
|
|
|
|
if (ruleId) form.ruleId = ruleId |
|
|
|
|
|
|
|
this.form.competitionStageList.push(form) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.form.competitionStageList = stages.slice(0, val) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 提交 |
|
|
|
|
|
|
|
save (status, next = 0) { |
|
|
|
|
|
|
|
let { form } = this |
|
|
|
|
|
|
|
const { rule } = form |
|
|
|
|
|
|
|
let invalid = 0 |
|
|
|
|
|
|
|
let pointWeight = 0 |
|
|
|
|
|
|
|
const { step1 } = this |
|
|
|
|
|
|
|
// 下一步需要校验 |
|
|
|
|
|
|
|
if (next === 2) { |
|
|
|
|
|
|
|
let stages = form.competitionStageList |
|
|
|
|
|
|
|
if (form.rule === 2) { // 单项赛只需要输入成绩公布时间 |
|
|
|
|
|
|
|
const e = stages[0] |
|
|
|
|
|
|
|
e.stageName = step1.name |
|
|
|
|
|
|
|
if (e.resultsDetails === 0 && e.resultAnnouncementTime !== '') { |
|
|
|
|
|
|
|
if (e.resultAnnouncementTime < 0) { |
|
|
|
|
|
|
|
return util.errorMsg('成绩公布时间不得小于0') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (e.resultAnnouncementTime % 1) { |
|
|
|
|
|
|
|
return util.errorMsg('成绩公布时间须为整数') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
e.resultAnnouncementTime = +e.resultAnnouncementTime |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
form.competitionStageList = stages.slice(0, 1) // 单项赛只需要存第一个阶段的数据 |
|
|
|
|
|
|
|
} else { // 非积分赛则全部字段校验 |
|
|
|
|
|
|
|
for (const i in stages) { |
|
|
|
|
|
|
|
const e = stages[i] |
|
|
|
|
|
|
|
if (rule !== 2 && !e.stageName) { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('请输入阶段名称') |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 0为个人赛,1为团队赛 |
|
|
|
|
|
|
|
// rule: 0为积分赛,1为淘汰赛,2为单项赛 |
|
|
|
|
|
|
|
// 积分赛 |
|
|
|
|
|
|
|
if (!rule) { |
|
|
|
|
|
|
|
// 个人 |
|
|
|
|
|
|
|
if (form.resultCalculationMethod == 0 && e.pointWeight === '') { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('请输入权重') |
|
|
|
|
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
if (e.resultAnnouncementTime % 1) { |
|
|
|
pointWeight += e.pointWeight // 权重求和 |
|
|
|
return util.errorMsg('成绩公布时间须为整数') |
|
|
|
} else if (rule === 1) { // 淘汰赛 |
|
|
|
|
|
|
|
// 晋级规则必须至少填一个(最后一个阶段不用填写) |
|
|
|
|
|
|
|
if (i != stages.length - 1 && e.peopleLimit === '' && e.percentageLimit === '' && e.score === '') { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('请至少填写一条晋级规则') |
|
|
|
|
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
e.resultAnnouncementTime = +e.resultAnnouncementTime |
|
|
|
if (e.score !== '') e.scoreLimit = e.operator + e.score |
|
|
|
} |
|
|
|
} |
|
|
|
form.competitionStageList = stages.slice(0, 1) // 单项赛只需要存第一个阶段的数据 |
|
|
|
if (rule !== 2 && competitionType && e.teamNumLimitOpt) { |
|
|
|
} else { // 非积分赛则全部字段校验 |
|
|
|
if (e.teamNumLimit === '') { |
|
|
|
for (const i in stages) { |
|
|
|
|
|
|
|
const e = stages[i] |
|
|
|
|
|
|
|
if (rule !== 2 && !e.stageName) { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
invalid = 1 |
|
|
|
util.errorMsg('请输入阶段名称') |
|
|
|
util.errorMsg('请输入团队参数人数限制') |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} else if (e.teamNumLimit < 0) { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('团队参数人数不得小于0') |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} else if (maxTeamSize !== '' && e.teamNumLimit > maxTeamSize) { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('团队参数人数不得大于团队人数上限') |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 0为个人赛,1为团队赛 |
|
|
|
} |
|
|
|
// rule: 0为积分赛,1为淘汰赛,2为单项赛 |
|
|
|
if (e.resultsDetails === 0 && e.resultAnnouncementTime !== '') { |
|
|
|
// 积分赛 |
|
|
|
if (e.resultAnnouncementTime < 0) { |
|
|
|
if (!rule) { |
|
|
|
invalid = 1 |
|
|
|
// 个人 |
|
|
|
util.errorMsg('成绩公布时间不得小于0') |
|
|
|
if (form.resultCalculationMethod == 0 && e.pointWeight === '') { |
|
|
|
break |
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('请输入权重') |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pointWeight += e.pointWeight // 权重求和 |
|
|
|
|
|
|
|
} else if (rule === 1) { // 淘汰赛 |
|
|
|
|
|
|
|
// 晋级规则必须至少填一个(最后一个阶段不用填写) |
|
|
|
|
|
|
|
if (i != stages.length - 1 && e.peopleLimit === '' && e.percentageLimit === '' && e.score === '') { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('请至少填写一条晋级规则') |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (e.score !== '') e.scoreLimit = e.operator + e.score |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (rule !== 2 && competitionType && e.teamNumLimitOpt) { |
|
|
|
|
|
|
|
if (e.teamNumLimit === '') { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('请输入团队参数人数限制') |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} else if (e.teamNumLimit < 0) { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('团队参数人数不得小于0') |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} else if (maxTeamSize !== '' && e.teamNumLimit > maxTeamSize) { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('团队参数人数不得大于团队人数上限') |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (!e.resultsDetails) { |
|
|
|
if (e.resultAnnouncementTime % 1) { |
|
|
|
if (e.resultAnnouncementTime === '') { |
|
|
|
invalid = 1 |
|
|
|
invalid = 1 |
|
|
|
util.errorMsg('成绩公布时间须为整数') |
|
|
|
util.errorMsg('请填写成绩公布时间') |
|
|
|
break |
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (e.resultAnnouncementTime < 0) { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('成绩公布时间不得小于0') |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (e.resultAnnouncementTime % 1) { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
util.errorMsg('成绩公布时间须为整数') |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
e.resultAnnouncementTime = +e.resultAnnouncementTime |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
e.resultAnnouncementTime = +e.resultAnnouncementTime |
|
|
|
} |
|
|
|
} |
|
|
|
if (invalid) return |
|
|
|
|
|
|
|
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入') |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { // 保存草稿的情况下,只保存输入了阶段名称的阶段 |
|
|
|
if (invalid) return |
|
|
|
form.competitionStageList = form.competitionStageList.filter(e => e.stageName) |
|
|
|
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入') |
|
|
|
} |
|
|
|
} |
|
|
|
for (const e of form.competitionStageList) { |
|
|
|
} else { // 保存草稿的情况下,只保存输入了阶段名称的阶段 |
|
|
|
if (!e.teamNumLimitOpt) e.teamNumLimit = 0 |
|
|
|
form.competitionStageList = form.competitionStageList.filter(e => e.stageName) |
|
|
|
} |
|
|
|
} |
|
|
|
this.$parent.showLoad() |
|
|
|
for (const e of form.competitionStageList) { |
|
|
|
if (form.ruleId) { |
|
|
|
if (!e.teamNumLimitOpt) e.teamNumLimit = 0 |
|
|
|
this.$post(this.api.editCompetitionRule, form).then(res => { |
|
|
|
} |
|
|
|
this.$parent.hideLoad() |
|
|
|
this.$parent.showLoad() |
|
|
|
util.successMsg("修改成功"); |
|
|
|
if (form.ruleId) { |
|
|
|
this.$emit('next', next) |
|
|
|
this.$post(this.api.editCompetitionRule, form).then(res => { |
|
|
|
}).catch(err => { |
|
|
|
this.$parent.hideLoad() |
|
|
|
this.$parent.hideLoad() |
|
|
|
util.successMsg("修改成功"); |
|
|
|
}) |
|
|
|
this.$emit('next', next) |
|
|
|
} else { |
|
|
|
}).catch(err => { |
|
|
|
form.setupId = this.setupId |
|
|
|
this.$parent.hideLoad() |
|
|
|
this.$post(this.api.addCompetitionRule, form).then(res => { |
|
|
|
}) |
|
|
|
this.$parent.hideLoad() |
|
|
|
} else { |
|
|
|
util.successMsg("创建成功"); |
|
|
|
form.setupId = this.setupId |
|
|
|
this.$emit('next', next) |
|
|
|
this.$post(this.api.addCompetitionRule, form).then(res => { |
|
|
|
}).catch(err => { |
|
|
|
this.$parent.hideLoad() |
|
|
|
this.$parent.hideLoad() |
|
|
|
util.successMsg("创建成功"); |
|
|
|
}) |
|
|
|
this.$emit('next', next) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
}, |
|
|
|
this.$parent.hideLoad() |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
<style scoped lang="scss"> |
|
|
|
/deep/ .d-inline-block { |
|
|
|
/deep/ .d-inline-block { |
|
|
|
width: 216px; |
|
|
|
width: 216px; |
|
|
|
.el-select, .el-input { |
|
|
|
.el-select, |
|
|
|
|
|
|
|
.el-input { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -442,7 +509,7 @@ export default { |
|
|
|
.remove { |
|
|
|
.remove { |
|
|
|
width: 16px; |
|
|
|
width: 16px; |
|
|
|
height: 16px; |
|
|
|
height: 16px; |
|
|
|
background: url("../../../assets/img/close.png") 0 0/cover no-repeat; |
|
|
|
background: url('../../../assets/img/close.png') 0 0 / cover no-repeat; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -452,26 +519,26 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.input-center { |
|
|
|
.input-center { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
|
width: 216px; |
|
|
|
width: 216px; |
|
|
|
white-space: nowrap; |
|
|
|
white-space: nowrap; |
|
|
|
.el-input { |
|
|
|
.el-input { |
|
|
|
margin-right: 5px; |
|
|
|
margin-right: 5px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.step-set { |
|
|
|
.step-set { |
|
|
|
padding: 15px; |
|
|
|
padding: 15px; |
|
|
|
background-color: #fbfbfb; |
|
|
|
background-color: #fbfbfb; |
|
|
|
} |
|
|
|
} |
|
|
|
.tips { |
|
|
|
.tips { |
|
|
|
font-size: 13px; |
|
|
|
font-size: 13px; |
|
|
|
color: #959595; |
|
|
|
color: #959595; |
|
|
|
} |
|
|
|
} |
|
|
|
.req { |
|
|
|
.req { |
|
|
|
color: #f00; |
|
|
|
color: #f00; |
|
|
|
} |
|
|
|
} |
|
|
|
.line { |
|
|
|
.line { |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-bottom: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |