赛事修复

dev_review
yujialong 8 months ago
parent 88a040c68a
commit 6ba5f44a33
  1. 2
      src/setting.js
  2. 37
      src/views/match/add/step2.vue
  3. 6
      src/views/match/manage/matchInfo.vue
  4. 7
      src/views/match/manage/matchSignup.vue

@ -14,7 +14,7 @@ if (isDev) {
sandPath = `http://${location.hostname}:9520`
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
host = 'http://192.168.31.51:9000/'
host = 'http://192.168.31.217:9000/'
} else if (isPro) {
jumpPath = 'https://judgment.huorantech.cn/'
}

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

@ -465,7 +465,7 @@ export default {
}).then(() => {
this.$post(`${this.api.deleteAnAdvisor}?id=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getInfo()
this.info.teamInstructors.splice(i, 1)
}).catch(res => { })
}).catch(() => { })
} else {
@ -475,7 +475,9 @@ export default {
//
addAdvisor () {
if (this.info.teamInstructors.length > 4) return util.errorMsg('指导老师仅限添加5个!')
this.info.teamInstructors.push(JSON.parse(JSON.stringify(this.originIns)))
const line = JSON.parse(JSON.stringify(this.originIns))
line.edit = 1
this.info.teamInstructors.push(line)
},
//
editAdvisor (row) {

@ -192,7 +192,7 @@
:label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
<p style="margin-top: 10px;line-height: 1.4;font-size: 12px;">学生所属院校为学生实际院校若为空则默认与学生账号归属院校一致</p>
<p style="margin-top: 10px;line-height: 1.4;font-size: 12px;">学生所属院校为学生实际院校</p>
</el-form-item>
<el-form-item prop="workNumber"
label="学生学号">
@ -585,7 +585,7 @@ export default {
}).then(() => {
this.$post(this.api.batchDeleteApplicants, { registrationVOS: [row] }).then(res => {
util.successMsg("删除成功");
this.getData();
this.init()
}).catch(res => { });
}).catch(() => { });
},
@ -757,6 +757,7 @@ export default {
if (!form.teamName) return util.errorMsg('请输入团队名称')
if (form.invitationCode.length !== 6) return util.errorMsg('请输入6位数团队邀请码')
form.accountId = this.form.id
form.schoolId = this.form.schoolId
form.studentAffiliatedInstitutionId = this.form.studentAffiliatedInstitutionId
this.$post(this.api.addCompetitionTeam, form).then(res => {
this.teamVisible = false
@ -802,7 +803,7 @@ export default {
type: "warning"
}).then(() => {
this.$post(this.api.batchDeleteApplicants, { registrationVOS: list }).then(res => {
this.getData();
this.init()
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => {

Loading…
Cancel
Save