From ec2eac17279a83a58f0e458e8c8c9fc865c7516d Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Wed, 3 Apr 2024 13:43:54 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E4=BA=8B=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/match/add/step2.vue | 35 +++++++++++++-------------
src/pages/match/manage/matchInfo.vue | 6 +++--
src/pages/match/manage/matchSignup.vue | 25 ++++++++----------
src/setting.js | 2 +-
4 files changed, 33 insertions(+), 35 deletions(-)
diff --git a/src/pages/match/add/step2.vue b/src/pages/match/add/step2.vue
index 1e3f908..c5aa71c 100644
--- a/src/pages/match/add/step2.vue
+++ b/src/pages/match/add/step2.vue
@@ -79,14 +79,14 @@
class="line">
*
团队参赛人数限制:
- 不限制
- 自定义
- 人
+ :disabled="item.teamNumLimit === 0"> 人
(可限制本阶段单个团队的出战人数)
',
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: '',
}
@@ -334,7 +334,6 @@ export default {
const num = limit.replace(/\D+/, '')
if (num) e.score = num
}
- e.teamNumLimitOpt = e.teamNumLimit ? 1 : 0
e.teamCalculationMethod = +e.teamCalculationMethod
})
this.form = rule
@@ -392,7 +391,7 @@ export default {
}
form.competitionStageList = stages.slice(0, 1) // 单项赛只需要存第一个阶段的数据
} else { // 非积分赛则全部字段校验
- let teamNumLimit = 0
+ let customNumber = 0
const { competitionType, minTeamSize, maxTeamSize } = step1.completeCompetitionSetup // 0为个人赛,1为团队赛
for (const i in stages) {
const e = stages[i]
@@ -420,16 +419,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
@@ -448,12 +447,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,请重新输入')
}
diff --git a/src/pages/match/manage/matchInfo.vue b/src/pages/match/manage/matchInfo.vue
index 099ba36..bac3def 100644
--- a/src/pages/match/manage/matchInfo.vue
+++ b/src/pages/match/manage/matchInfo.vue
@@ -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) {
diff --git a/src/pages/match/manage/matchSignup.vue b/src/pages/match/manage/matchSignup.vue
index e722a3a..bc742b4 100644
--- a/src/pages/match/manage/matchSignup.vue
+++ b/src/pages/match/manage/matchSignup.vue
@@ -127,13 +127,10 @@
align="center"
width="270">
- 编辑
- 查看
删除
@@ -160,7 +157,7 @@
-
- 学生所属院校为学生实际院校,若为空,则默认与学生账号归属院校一致
+ 学生所属院校为学生实际院校
+ :disabled="isAdd || diffSchool">
学生
@@ -219,7 +215,7 @@
label="所属团队">
+ :disabled="isAdd || diffSchool">
+ :disabled="isAdd || diffSchool">
{
this.$post(this.api.batchDeleteApplicants, { registrationVOS: [row] }).then(res => {
util.successMsg("删除成功");
- this.getData();
+ this.init()
}).catch(res => {
});
})
@@ -773,6 +769,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
@@ -818,7 +815,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 => {
diff --git a/src/setting.js b/src/setting.js
index 0b96562..d81d1f1 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -31,7 +31,7 @@ if (isPro) {
uploadURL = `http://121.37.12.51/`
host = "http://121.37.12.51/"; // 中台测试服
// host = 'https://www.occupationlab.com/' // 正式服
- host = "http://192.168.31.51:9000/";
+ host = "http://192.168.31.217:9000/";
} else if (isSq) {
zcPath = `10.20.100.204:8883`
}