大赛修复

Branch_d40a2540
yujialong 2 years ago
parent 7f861789d1
commit 23f779cfa0
  1. 55
      src/api/index.js
  2. 6
      src/const/match.js
  3. 124
      src/pages/match/add/index.vue
  4. 16
      src/pages/match/add/step1.vue
  5. 113
      src/pages/match/add/step2.vue
  6. 89
      src/pages/match/add/step3.vue
  7. 132
      src/pages/match/list/index.vue
  8. 39
      src/pages/match/manage/index.vue
  9. 5
      src/pages/match/manage/matchArch.vue
  10. 28
      src/pages/match/manage/matchArchList.vue
  11. 171
      src/pages/match/manage/matchInfo.vue
  12. 13
      src/pages/match/manage/matchRank.vue
  13. 4
      src/pages/match/manage/matchReport.vue
  14. 43
      src/pages/match/manage/matchSignup.vue
  15. 58
      src/pages/match/preview/index.vue
  16. 22
      src/router/modules/match.js
  17. 2
      src/setting.js

@ -76,7 +76,7 @@ export default {
// 成绩管理
deleteExperimentalReport: `occupationlab/occupationlab/achievement/deleteExperimentalReport`, // 单个、批量删除实验报告
exportAssessmentInfo: `${host}occupationlab/occupationlab/achievement/exportAssessmentInfo`, // 批量导出考核成绩
exportPracticeInfo: `${host}occupationlab/occupationlab/achievement/exportPracticeInfo`, // 批量导出练习成绩
exportPracticeInfo: `${host2}occupationlab/occupationlab/achievement/exportPracticeInfo`, // 批量导出练习成绩
getAchievementInfo: `occupationlab/occupationlab/achievement/getAchievementInfo`, // 管理端成绩管理
getAssessmentDetail: `occupationlab/occupationlab/achievement/getAssessmentDetail`, // 管理端考核成绩详情
getPracticeDetail: `occupationlab/occupationlab/achievement/getPracticeDetail`, // 管理端练习成绩详情
@ -122,7 +122,7 @@ export default {
getCompetition: `competition/competition/management/getCompetition`,
getProjectAssessmentByCompetition: `occupationlab/occupationlab/projectManage/getProjectAssessmentByCompetition`,
publishCompetition: `competition/competition/management/publishCompetition`,
detailsOfCompetitionStage: `${host1}competition/competition/management/detailsOfCompetitionStage`,
detailsOfCompetitionStage: `competition/competition/management/detailsOfCompetitionStage`,
entryInformation: `competition/competition/team/entryInformation`,
getCustomerOrder: `nakadai/nakadai/valueModuleManagement/getCustomerOrder`,
curriculumList: `nakadai/nakadai/curriculum/schoolCourse`,
@ -133,6 +133,10 @@ export default {
editCompetitionContent: `competition/competition/content/editCompetitionContent`,
getCompetitionContent: `competition/competition/content/getCompetitionContent`,
// 赛事附件
delComAnnex: `competition/competition/annex/delete`,
saveComAnnex: `competition/competition/annex/save`,
updateComAnnex: `competition/competition/annex/update`,
// 赛事公告附件
delAnnex: `competition/competition/announcementAnnex/delete`,
saveAnnex: `competition/competition/announcementAnnex/save`,
updateAnnex: `competition/competition/announcementAnnex/update`,
@ -168,6 +172,7 @@ export default {
stageSelectParticipants: `competition/competition/teamParticipant/stageSelectParticipants`,
updateUser: `users/users/userInfo/updateUser`,
enquireAboutSchoolStudents: `users/users/userAccount/enquireAboutSchoolStudents`,
cancelParticipant: `competition/competition/teamParticipant/cancelParticipant`,
// 赛事公告
addAnnouncement: `competition/competition/announcement/addAnnouncement`,
amendmentAnnouncement: `competition/competition/announcement/amendmentAnnouncement`,
@ -177,26 +182,26 @@ export default {
queryAnnouncementDetails: `competition/competition/announcement/queryAnnouncementDetails`,
saveAnnouncementAnnex: `competition/competition/announcementAnnex/save`,
// 赛事成绩
batchDeleteContestGrade: `${host1}competition/competition/performance/batchDeleteContestGrade`,
batchImportGrades: `${host1}competition/competition/performance/batchImportGrades`,
exportExperimentalResultsInBatch: `${host1}competition/competition/performance/exportExperimentalResultsInBatch`,
performanceExportFailure: `${host1}competition/competition/performance/exportFailure`,
rankExportFailure: `${host1}competition/competition/rank/exportFailure`,
stageGradeManagementList: `${host1}competition/competition/performance/stageGradeManagementList`,
stageRaceRanking: `${host1}competition/competition/rank/stageRaceRanking`,
overallStandingsInThePointsRace: `${host1}competition/competition/rank/overallStandingsInThePointsRace`,
batchImportRanking: `${host1}competition/competition/rank/batchImportRanking`,
publishRanking: `${host1}competition/competition/rank/publishRanking`,
stageTeamScoreDetails: `${host1}competition/competition/rank/stageTeamScoreDetails`,
multipleStageTeamScoreDetails: `${host1}competition/competition/rank/multipleStageTeamScoreDetails`,
detailsOfTotalTeamScores: `${host1}competition/competition/rank/detailsOfTotalTeamScores`,
cancelRanking: `${host1}competition/competition/rank/cancelRanking`,
reportDetail: `${host1}occupationlab/occupationlab/achievement/reportDetail`,
deleteLastPublication: `${host1}competition/competition/rank/deleteLastPublication`,
whetherToPublish: `${host1}competition/competition/rank/whetherToPublish`,
manuallyRankTheUploadList: `${host1}competition/competition/rank/manuallyRankTheUploadList`,
queryPublicationSource: `${host1}competition/competition/rank/queryPublicationSource`,
releaseVerification: `${host1}competition/competition/rank/releaseVerification`,
batchDeleteContestGrade: `competition/competition/performance/batchDeleteContestGrade`,
batchImportGrades: `competition/competition/performance/batchImportGrades`,
exportExperimentalResultsInBatch: `competition/competition/performance/exportExperimentalResultsInBatch`,
performanceExportFailure: `competition/competition/performance/exportFailure`,
rankExportFailure: `competition/competition/rank/exportFailure`,
stageGradeManagementList: `competition/competition/performance/stageGradeManagementList`,
stageRaceRanking: `competition/competition/rank/stageRaceRanking`,
overallStandingsInThePointsRace: `competition/competition/rank/overallStandingsInThePointsRace`,
batchImportRanking: `competition/competition/rank/batchImportRanking`,
publishRanking: `competition/competition/rank/publishRanking`,
stageTeamScoreDetails: `competition/competition/rank/stageTeamScoreDetails`,
multipleStageTeamScoreDetails: `competition/competition/rank/multipleStageTeamScoreDetails`,
detailsOfTotalTeamScores: `competition/competition/rank/detailsOfTotalTeamScores`,
cancelRanking: `competition/competition/rank/cancelRanking`,
reportDetail: `occupationlab/occupationlab/achievement/reportDetail`,
deleteLastPublication: `competition/competition/rank/deleteLastPublication`,
whetherToPublish: `competition/competition/rank/whetherToPublish`,
manuallyRankTheUploadList: `competition/competition/rank/manuallyRankTheUploadList`,
queryPublicationSource: `competition/competition/rank/queryPublicationSource`,
releaseVerification: `competition/competition/rank/releaseVerification`,
gradeImport: `${host2}template/赛事成绩导入模板.xlsx`,
rankImportTeam: `${host2}template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `${host2}template/赛事排名导入模板(个人赛).xlsx`,
@ -329,8 +334,8 @@ export default {
querySubject: `kdSys/querySubject`,
queryItem: `kdSys/queryItem`,
// 川大
firstLevel: `${host1}sichuan/point/firstLevel`,
secondaryLevel: `${host1}sichuan/point/secondaryLevel`,
thirdLevel: `${host1}sichuan/point/thirdLevel`
firstLevel: `sichuan/point/firstLevel`,
secondaryLevel: `sichuan/point/secondaryLevel`,
thirdLevel: `sichuan/point/thirdLevel`
};

@ -34,15 +34,15 @@
teamCalculationMethods: [
{
id: 0,
name: '最高分'
name: '最高分'
},
{
id: 1,
name: '平均分'
name: '平均分'
},
{
id: 2,
name: '总分'
name: '求和'
}
],
}

@ -5,38 +5,40 @@
<el-page-header @back="back" :content="'创建赛事'"></el-page-header>
</div>
</el-card>
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px">
<template v-if="step === 1 || (id && !editing)">
<div v-if="hasPer">
<div v-if="step === 1 || (id && !editing)" :class="['type-wrap', {pd: !id}]">
<div class="p-title">大赛发布类型</div>
<el-form label-width="100px" label-suffix=":" size="small" :disabled="!editing && id != ''">
<el-form-item label="请选择类型">
<el-radio v-model="releaseType" :label="0">仅发布信息</el-radio>
<el-radio v-model="releaseType" :label="1">设置完整比赛</el-radio>
<el-radio v-for="(item, i) in releaseTypes" :key="i" v-model="releaseType" :label="item.id">{{ item.name }}</el-radio>
</el-form-item>
</el-form>
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1">编辑</el-button>
</template>
<ul :class="['steps', {pointer: !editing && id}]">
<li :class="{active: step === 1,done: step > 1}" @click="toStep(1)">
<span class="circle">1</span>
<p class="text">大赛信息填写</p>
</li>
<template v-if="releaseType">
<li :class="{active: step === 2,done: step > 2}" @click="toStep(2)">
<span class="circle circle2">2</span>
<p class="text">赛程与规则设置</p>
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1" v-auth="'/match/list:管理:大赛详情:编辑'">编辑</el-button>
</div>
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px">
<ul :class="['steps', {pointer: !editing && id}]">
<li :class="{active: step === 1,done: step > 1}" @click="toStep(1)">
<span class="circle">1</span>
<p class="text">大赛信息填写</p>
</li>
<li :class="{active: step === 3,done: step > 3}" @click="toStep(3)">
<span class="circle circle3">3</span>
<p class="text">比赛内容设置</p>
<template v-if="releaseType">
<li :class="{active: step === 2,done: step > 2}" @click="toStep(2)">
<span class="circle circle2">2</span>
<p class="text">赛程与规则设置</p>
</li>
<li :class="{active: step === 3,done: step > 3}" @click="toStep(3)">
<span class="circle circle3">3</span>
<p class="text">比赛内容设置</p>
</li>
</template>
<li :class="{done: step > 3}">
<span class="circle circle4">{{ releaseType ? 4 : 2 }}</span>
<p class="text">发布{{ !editing && id ? '成功' : '' }}</p>
</li>
</template>
<li :class="{done: step > 3}">
<span class="circle circle4">{{ releaseType ? 4 : 2 }}</span>
<p class="text">发布{{ !editing && id ? '成功' : '' }}</p>
</li>
</ul>
</el-card>
</ul>
</el-card>
</div>
<el-button v-else-if="!editing && id" class="edit" type="primary" @click="editing = 1" v-auth="'/match/list:管理:大赛详情:编辑'">编辑</el-button>
<div class="page">
<div class="page-content">
<step1 v-show="step === 1" ref="step1" :editing.sync="editing" @next="next" />
@ -46,14 +48,14 @@
<div v-if="step !== 4 && showBtns" class="btns">
<!-- 处于编辑状态(列表点编辑按钮进来默认是查看状态不可编辑点了编辑按钮才可编辑)或者新增才显示这几个按钮 -->
<template v-if="editing || !id">
<div v-if="editing || !id" class="m-r-10">
<el-button v-if="!publishStatus" @click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button>
<el-button v-if="step === 2 || step === 3" type="primary" @click="prev">上一步</el-button>
<el-button v-if="!releaseType || (releaseType && step === 3)" type="primary" @click="save(1)">发布</el-button>
<el-button v-if="releaseType == 0" type="primary" @click="save(1)">发布</el-button>
<el-button v-else type="primary" @click="save(id ? 1 : 0, 2)">保存并下一步</el-button>
</template>
<el-button type="danger" @click="preview">预览</el-button>
<el-button @click="back">取消</el-button>
</div>
<el-button type="danger" @click="preview" v-auth="'/match/list:管理:大赛详情:预览'">预览</el-button>
<el-button @click="cancel">{{ editing ? '取消' : '返回' }}</el-button>
</div>
</div>
</div>
@ -73,6 +75,17 @@ export default {
data() {
return {
id: this.$route.query.id || '',
hasPer: false,
releaseTypes: [
{
id: 0,
name: '仅发布信息'
},
{
id: 1,
name: '设置完整比赛'
}
],
publishStatus: 0,
competitionId: '',
step: 1,
@ -93,9 +106,20 @@ export default {
step4
},
mounted() {
this.getPer()
},
methods: {
// true
getPer() {
this.$get(this.api.isClient).then(({ customerId }) => {
customerId && this.$get(this.api.getCustomerOrder, {
customerId
}).then(({ show }) => {
this.hasPer = show
show || this.$parent.hideArch()
}).catch(err => {})
}).catch(res => {})
},
// loading
showLoad() {
this.loadIns = Loading.service()
@ -112,12 +136,11 @@ export default {
prev() {
//
const { updateTime } = this.$refs['step' + this.step]
console.log("🚀 ~ file: index.vue:142 ~ back ~ updateTime", updateTime)
if (updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0)
this.save(0, 1)
}).catch(() => {
this.step--
})
@ -137,6 +160,8 @@ export default {
this.competitionId = competitionId
}
this.step++
} else if (next === 1) {
this.step--
}
},
//
@ -148,6 +173,27 @@ export default {
util.local.set('match', this.$refs.step1.form)
window.open(this.$router.resolve('/matchPreview').href)
},
//
cancel() {
//
if (this.editing && this.$route.query.name) {
//
const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.save(0, 3)
}).catch(() => {
this.editing = false
})
} else {
this.editing = false
}
} else {
this.$router.push(`/match?page=${this.$store.state.match.page}`)
}
},
back() {
//
const { updateTime } = this.$refs['step' + this.step]
@ -165,13 +211,21 @@ export default {
}
},
backPage() {
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`)
this.$router.push(`/match?page=${this.$store.state.match.page}`)
}
}
};
</script>
<style scoped lang="scss">
.type-wrap {
position: relative;
margin-top: 20px;
background: #fff;
&.pd {
padding: 15px;
}
}
.edit {
position: absolute;
top: 30px;
@ -246,6 +300,8 @@ export default {
}
}
.btns {
display: flex;
justify-content: center;
text-align: center;
}
</style>

@ -369,6 +369,7 @@ export default {
id && this.$post(`${this.api.getCompetition}?competitionId=${id}`).then(({ competition }) => {
this.$parent.publishStatus = competition.publishStatus
this.$parent.releaseType = competition.releaseType
if (!competition.releaseType) this.$parent.editing = 1 //
this.$parent.setupId = competition.completeCompetitionSetup.setupId
if (competition.signUpStartTime) this.signupTime = [competition.signUpStartTime, competition.signUpEndTime]
if (competition.playStartTime) this.playTime = [competition.playStartTime, competition.playEndTime]
@ -522,13 +523,13 @@ export default {
const file = res.data.filesResult
const { id } = this.form
const data = {
contestId: id || '',
competitionId: id || '',
fileName: this.fileName,
filePath: file.fileUrl || file.fileId
}
this.form.competitionAnnexList.push(data)
//
id && this.$post(this.api.saveAnnex, data).then(res => {}).catch(res => {})
id && this.$post(this.api.saveComAnnex, data).then(res => {}).catch(res => {})
},
//
beforeUpload(file) {
@ -565,7 +566,7 @@ export default {
const { url, name } = file
url && this.$del(`${this.api.fileDeletion}?keys=${url}`).then(res => {}).catch(res => {})
const id = this.form.competitionAnnexList.find(e => e.fileName === name).id
id && this.$post(`${this.api.deleteAnnex}?id=${id}`).then(res => {}).catch(res => {})
id && this.$post(`${this.api.delComAnnex}?id=${id}`).then(res => {}).catch(res => {})
},
//
randomInv() {
@ -586,8 +587,8 @@ export default {
form.sponsor = this.sponsorList.filter(d => d).join();
form.undertaker = this.undertakerList.filter(d => d).join();
if (!form.name) return util.warningMsg("请填写竞赛名称");
//
// if (status) {
//
if (next === 2) {
if (form.competitionScope == 2 && !form.competitionRangeList.length) return util.warningMsg('请选择区域、院校')
if (!form.sponsor) return util.warningMsg("请填写主办方");
if (!form.signUpStartTime) return util.warningMsg("请选择报名时间");
@ -613,14 +614,16 @@ export default {
}
if (isNeedCode && (!invitationCode || invitationCode.length !== 4)) return util.warningMsg('请填写四位数邀请码')
if (!form.description) return util.warningMsg("请填写竞赛详情");
// }
}
this.$parent.showLoad()
form.publishStatus = status
form.ztOpen = status ? 0 : 1 //
form.releaseType = releaseType
form.id = this.$route.query.id
if (form.id) {
this.$post(this.api.editCompetition, form).then(res => {
this.updateTime = 0
this.$parent.hideLoad()
util.successMsg("修改成功");
this.$emit('next', next)
@ -629,6 +632,7 @@ export default {
});
} else {
this.$post(this.api.addCompetition, form).then(({ competitionId, setupId }) => {
this.updateTime = 0
this.$parent.hideLoad()
util.successMsg("创建成功");
this.$emit('next', next, setupId, competitionId)

@ -92,7 +92,7 @@
<span class="req">*</span>
成绩公布时间
阶段比赛结束后
<el-input v-model="item.resultAnnouncementTime" type="number" style="width: 120px"></el-input>
<el-input v-model.number="item.resultAnnouncementTime" type="number" style="width: 120px"></el-input>
小时公布阶段比赛成绩
</div>
<div class="line">
@ -124,7 +124,7 @@
</el-form-item>
<el-form-item prop="resultAnnouncementTime" label="成绩公布时间">
阶段比赛结束后
<el-input v-model="form.competitionStageList[0].resultAnnouncementTime" type="number" style="width: 120px"></el-input>
<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="是否公布成绩详情">
@ -290,62 +290,83 @@ export default {
},
//
save(status, next = 0) {
const { form } = this
let { form } = this
const { rule } = form
let invalid = 0
let pointWeight = 0
const { step1 } = this
for (const e of form.competitionStageList) {
if (rule !== 2 && !e.stageName) {
invalid = 1
util.errorMsg('请输入阶段名称')
break
}
const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 01
// rule: 012
//
if (!rule) {
//
if (form.resultCalculationMethod == 0 && e.pointWeight === '') {
//
if (next === 2) {
const stages = form.competitionStageList
for (const i in stages) {
const e = stages[i]
if (rule !== 2 && !e.stageName) {
invalid = 1
util.errorMsg('请输入权重')
util.errorMsg('请输入阶段名称')
break
}
pointWeight += e.pointWeight //
} else if (rule === 1) { //
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
const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 01
// rule: 012
//
if (!rule) {
//
if (form.resultCalculationMethod == 0 && e.pointWeight === '') {
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 (!e.resultsDetails) {
e.resultAnnouncementTime = +e.resultAnnouncementTime
if (e.resultAnnouncementTime === '') {
invalid = 1
util.errorMsg('请填写成绩公布时间')
break
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.resultAnnouncementTime < 0) {
invalid = 1
util.errorMsg('成绩公布时间不得小于0')
break
if (!e.resultsDetails) {
if (e.resultAnnouncementTime === '') {
invalid = 1
util.errorMsg('请填写成绩公布时间')
break
}
if (e.resultAnnouncementTime < 0) {
invalid = 1
util.errorMsg('成绩公布时间不得小于0')
break
}
if (e.resultAnnouncementTime % 1) {
invalid = 1
util.errorMsg('成绩公布时间须为整数')
break
}
e.resultAnnouncementTime = +e.resultAnnouncementTime
}
}
if (invalid) return
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入')
} else { // 稿
form.competitionStageList = form.competitionStageList.filter(e => e.stageName)
}
for (const e of form.competitionStageList) {
if (!e.teamNumLimitOpt) e.teamNumLimit = 0
}
if (invalid) return
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入')
this.$parent.showLoad()
if (form.ruleId) {
this.$post(this.api.editCompetitionRule, form).then(res => {

@ -136,7 +136,11 @@ export default {
this.$post(`${this.api.queryCompetitionStageBySetupId}?setupId=${this.setupId}`).then(res => {
res.competitionStages.map(e => {
const form = e.competitionContent || JSON.parse(JSON.stringify(this.originForm))
if (form.startTime) form.time = [form.startTime, form.endTime]
if (form.startTime) {
form.time = [form.startTime, form.endTime]
} else {
form.time = []
}
form.offlineButton = !!form.offlineButton
form.onlineButton = !!form.onlineButton
form.method = e.method
@ -193,51 +197,60 @@ export default {
//
save(status, next = 0) {
const { form } = this
let invalid = 0
if (this.timeInvalid) return util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
for (const e of form) {
if (!e.time.length) {
invalid = 1
util.errorMsg('请选择比赛时间')
break
}
e.startTime = e.time[0]
e.endTime = e.time[1]
if (e.method !== 2 && !e.cid) {
invalid = 1
util.errorMsg('请选择课程')
break
}
if (e.method === 2) { // 线
if (!e.offlineAddress) {
invalid = 1
util.errorMsg('请输入比赛地点')
break
}
if (!e.contentDescription) {
invalid = 1
util.errorMsg('请输入比赛内容')
break
}
if (!e.scoreRule) {
if (!form.length) {
this.$parent.hideLoad()
util.successMsg('保存成功')
this.$emit('next', next)
return
}
//
if (status) {
let invalid = 0
if (this.timeInvalid) return util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
for (const e of form) {
if (!e.time.length) {
invalid = 1
util.errorMsg('请输入评分规则')
util.errorMsg('请选择比赛时间')
break
}
} else {
if (e.onlineButton && !e.onlineAddress) {
e.startTime = e.time[0]
e.endTime = e.time[1]
if (e.method !== 2 && !e.cid) {
invalid = 1
util.errorMsg('请输入线上地点')
util.errorMsg('请选择课程')
break
}
if (e.offlineButton && !e.offlineAddress) {
invalid = 1
util.errorMsg('请输入线下地点')
break
if (e.method === 2) { // 线
if (!e.offlineAddress) {
invalid = 1
util.errorMsg('请输入比赛地点')
break
}
if (!e.contentDescription) {
invalid = 1
util.errorMsg('请输入比赛内容')
break
}
if (!e.scoreRule) {
invalid = 1
util.errorMsg('请输入评分规则')
break
}
} else {
if (e.onlineButton && !e.onlineAddress) {
invalid = 1
util.errorMsg('请输入线上地点')
break
}
if (e.offlineButton && !e.offlineAddress) {
invalid = 1
util.errorMsg('请输入线下地点')
break
}
}
}
if (invalid) return
}
if (invalid) return
//
for (const e of form) {
e.offlineButton = e.offlineButton ? 1 : 0
@ -247,9 +260,9 @@ export default {
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], {
competitionContents: form
}).then(res => {
this.$parent.hideLoad()
//
!form[0].contentId && status && this.publish(status)
this.$parent.hideLoad()
util.successMsg((status ? '发布' : '保存') + '成功')
this.$emit('next', next)
}).catch(err => {

@ -39,8 +39,8 @@
</li>
</ul>
<div>
<el-button type="primary" round @click="add">创建竞赛</el-button>
<el-button type="primary" round @click="delAllSelection">批量删除</el-button>
<el-button type="primary" round @click="add" v-auth>创建竞赛</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
@ -71,11 +71,13 @@
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<el-button v-if="scope.row.playingStages && scope.row.playingStages.length" type="text" @click="editEndTime(scope.row)" v-auth>修改结束时间</el-button>
<el-button v-auth type="text" @click="manage(scope.row)">管理</el-button>
<el-button v-auth type="text" @click="delData(scope.row)">删除</el-button>
<!-- 列表展示中台的禁启用依据zt_open展示职站的禁启用依据is_open展示 -->
<!-- 中台禁用了这个学校发布的学校这边还能看到但是学校这边不能启用 -->
<el-switch
v-if="scope.row.publishStatus"
v-auth="'禁用'"
v-model="scope.row.isOpen"
:active-value="0"
@ -91,6 +93,32 @@
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination>
</div>
<el-dialog title="修改当前阶段结束时间" :visible.sync="modifyVisible" width="900px" :close-on-click-modal="false">
<el-table :data="curRow.playingStages" class="table" ref="table" stripe header-align="center">
<el-table-column prop="stageName" label="阶段名称" min-width="100" align="center"></el-table-column>
<el-table-column label="竞赛起止时间" width="300" align="center">
<template slot-scope="scope">
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }}
</template>
</el-table-column>
<el-table-column label="结束时间调整为" align="center" width="280">
<template slot-scope="scope">
<el-date-picker
popper-class="no-atTheMoment"
v-model="scope.row.newEndTime"
placeholder="请选择结束时间"
type="datetime"
:picker-options="pickerOptions">
</el-date-picker>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="modifyVisible = false"> </el-button>
<el-button size="small" type="primary" @click="modifySubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
@ -149,7 +177,20 @@ export default {
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
transferPublishStatus: [ "未发布", "已发布"]
transferPublishStatus: [ "未发布", "已发布"],
modifyVisible: false,
curRow: {
playingStages: []
},
timer: null,
pickerOptions: {
shortcuts: [{
text: '此刻',
onClick(picker) {
picker.$emit('pick', new Date(Date.now() + 5000))
}
}]
}
};
},
watch: {
@ -200,11 +241,34 @@ export default {
startTime: form.startTime || null,
publishStatus: form.publishStatus === '' ? null : form.publishStatus
}).then(({ data }) => {
const { records } = data
records.map(e => {
const list = data.records
//
this.timer = setInterval(() => {
const now = new Date()
list.map(e => {
if (!e.playingStages) {
this.$set(e, 'playingStages', [])
} else {
e.playingStages = []
}
//
if (now >= new Date(e.playStartTime) && now <= new Date(e.playEndTime)) {
//
if (e.competitionStageList) {
for (const n of e.competitionStageList) {
//
if (now >= new Date(n.startTime) && now <= new Date(n.endTime)) {
e.playingStages.push(n)
}
}
}
}
})
}, 1000)
list.map(e => {
if (e.ztOpen) e.isOpen = 1
})
this.matchData = records
this.matchData = list
this.total = data.total
this.$refs.table.clearSelection()
if (!this.matchData.length && this.total) {
@ -215,10 +279,6 @@ export default {
},
getData() {
this.getList()
// if (!Setting.isDev) {
// clearInterval(this.timer)
// this.timer = setInterval(this.getList, 1000 * 60)
// }
},
initData() {
this.page = 1;
@ -227,6 +287,29 @@ export default {
add() {
this.$router.push("/match/add");
},
//
editEndTime(row) {
this.modifyVisible = true
row.newEndTime = ''
this.curRow = row
},
//
modifySubmit() {
const row = this.curRow
const data = []
row.competitionStageList.map(e => {
const stage = row.playingStages.find(n => n.contentId === e.contentId && n.newEndTime)
if (stage && stage.newEndTime) stage.endTime = this.formatDate('yyyy-MM-dd hh:mm:ss', stage.newEndTime)
data.push(stage || e)
})
this.$post(this.api.editCompetitionContent, {
competitionContents: data
}).then(res => {
util.successMsg('修改成功')
this.modifyVisible = false
this.getData()
}).catch(err => {})
},
manage(row) {
this.$router.push(`/match/manage?id=${row.id}&name=${row.competitionName}`)
},
@ -281,40 +364,15 @@ export default {
if (date == "0000-00-00 00:00:00") return "---";
return date;
},
disable(val, row) {
switchOff(val, row) {
this.$post(this.api.disabledEventsCompetition, {
competitionId: row.id,
isOpen: val,
type: 1 // (01)
}).then(res => {
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
util.successMsg(val == 1 ? '禁用成功' : '启用成功')
}).catch(err => {})
},
switchOff(val, row, index) {
if (val) {
this.disable(val, row)
} else if (!row.publishStatus) {
this.$confirm('是否发布该大赛?', '提示', {
type: 'success'
}).then(() => {
this.$post(this.api.disabledEventsCompetition, {
competitionId: row.id,
isOpen: val,
type: 1 // (01)
}).then(res => {
row.publishStatus = 1
this.$post(this.api.editContest, row).then(res => {
this.getData()
val == 1 ? util.warningMsg('禁用成功') : util.successMsg('启用成功')
}).catch(err => {})
}).catch(err => {})
}).catch(() => {
row.isOpen = 1
})
} else {
this.disable(val, row)
}
}
}
};
</script>

@ -27,6 +27,7 @@ import MatchArch from "./matchArch";
import MatchProgress from "./matchProgress";
import notice from "./notice";
import MatchSignup from "./matchSignup";
import { mapState } from "vuex";
export default {
name: "matchManage",
data() {
@ -39,7 +40,7 @@ export default {
tab3: "竞赛进展",
tab4: "公告通知",
tab5: "报名人员"
}
},
};
},
components: {
@ -49,25 +50,40 @@ export default {
notice,
MatchSignup
},
computed: {
...mapState("user", [
'page'
]),
...mapState('auth', [
'btns'
])
},
mounted() {
Setting.dynamicRoute && this.initTabs()
},
methods: {
initTabs() {
const btns = this.$store.state.btns
const tab1 = btns.includes('/match:管理:大赛详情')
const tab2 = btns.includes('/match:管理:竞赛进展')
const tab3 = btns.includes('/match:管理:公告通知')
const tab4 = btns.includes('/match:管理:报名人员')
const { btns } = this
console.log("🚀 ~ file: index.vue:67 ~ initTabs ~ btns", btns)
const tab1 = btns.includes('/match/list:管理:大赛详情')
const tab2 = btns.includes('/match/list:管理:大赛成绩管理')
const tab3 = btns.includes('/match/list:管理:竞赛进展')
const tab4 = btns.includes('/match/list:管理:公告通知')
const tab5 = btns.includes('/match/list:管理:报名人员')
tab1 || delete this.tabs.tab1
tab2 || delete this.tabs.tab2
tab3 || delete this.tabs.tab3
tab4 || delete this.tabs.tab4
tab1 || this.$delete(this.tabs, 'tab1')
tab2 || this.$delete(this.tabs, 'tab2')
tab3 || this.$delete(this.tabs, 'tab3')
tab4 || this.$delete(this.tabs, 'tab4')
tab5 || this.$delete(this.tabs, 'tab5')
const type = this.$route.query.tab
const keys = Object.keys(this.tabs)
this.active = keys.includes(type) ? type : keys[0]
},
//
hideArch() {
this.$delete(this.tabs, 'tab2')
},
back() {
this.handleSave(0) && this.backPage()
},
@ -95,7 +111,8 @@ export default {
},
//
backPage(){
this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`)
console.log(444, this.$store.state)
this.$router.push(`/match?page=${this.$store.state.match.page}`)
},
// tab
tabSwitch(i) {

@ -79,15 +79,14 @@ export default {
}
}
})
console.log("🚀 ~ file: matchArch.vue:87 ~ handleStatus ~ this.status", this.list)
},
//
toRank(row, i) {
this.$router.push(`/matchRank?id=${this.id}&stageId=${row.stageId}&index=${i}&method=${row.method}&competitionType=${row.competitionType}&rule=${row.rule}`)
this.$router.push(`rank?id=${this.id}&stageId=${row.stageId}&index=${i}&method=${row.method}&competitionType=${row.competitionType}&rule=${row.rule}`)
},
//
toArch(row) {
this.$router.push(`/matchArchList?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}`)
this.$router.push(`archList?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}`)
}
}
};

@ -61,7 +61,7 @@
</el-table-column>
<el-table-column label="操作" align="center" width="160">
<template slot-scope="scope">
<el-button type="text" @click="show(scope.row)">查看成绩报告</el-button>
<el-button v-if="scope.row.reportId" type="text" @click="show(scope.row)">查看成绩报告</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
@ -87,9 +87,13 @@
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.importStaff"
:action="this.api.batchImportGrades"
:file-list="uploadList"
:headers="headers"
:data="{
competitionId: this.id,
stageId: this.stageId,
}"
>
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
@ -206,9 +210,13 @@ export default {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(item => {
return item.reportId;
return this.method == 2 ? item.scoreId : item.reportId
});
this.$post(this.api.deleteExperimentalReport, ids).then(res => {
this.$post(this.api.batchDeleteContestGrade, {
ids,
competitionId: this.id,
stageId: this.stageId
}).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
@ -276,7 +284,12 @@ export default {
},
//
showFaild() {
location.href = `${this.api.performanceExportFailure}?exportCode=${this.exportCode}`
axios.get(`${this.api.performanceExportFailure}?exportCode=${this.exportCode}`, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => {})
},
uploadSuccess(res, file, fileList) {
this.uploadFaild = false
@ -306,10 +319,7 @@ export default {
},
uploadSure() {
this.importVisible = false
this.studentType = 1
this.keyWord = ''
this.$refs.orgTree.setCurrentKey(null)
this.getOrg()
this.getData()
}
}
};

@ -1,5 +1,5 @@
<template>
<div>
<div style="padding: 0 100px;">
<el-card shadow="hover" class="m-b-20 head-card">
<div class="flex-between">
<el-page-header @back="$router.back()" content="参赛信息与成绩"></el-page-header>
@ -7,20 +7,22 @@
</el-card>
<el-card shadow="hover" class="m-b-20">
<table v-if="form.completeCompetitionSetup.competitionType" class="table m-b-20">
<tr>
<th width="150">团队名称</th>
<td>
<el-input :disabled="!editing" v-model="info.team.teamName"></el-input>
</td>
<th width="150">团队邀请码</th>
<td>
<el-input :disabled="!editing" v-model="info.team.invitationCode"></el-input>
</td>
</tr>
</table>
<div v-if="form.completeCompetitionSetup.competitionType && status < 4" class="m-b-20 text-center">
<el-button type="primary" @click="edit(1)">{{ editing ? '保存' : '编辑' }}</el-button>
<div style="display: flex;align-items: center">
<table v-if="form.completeCompetitionSetup.competitionType" class="table m-b-20 m-r-10">
<tr>
<th width="150">团队名称</th>
<td>
<el-input :disabled="!editing" v-model="info.team.teamName"></el-input>
</td>
<th width="150">团队邀请码</th>
<td>
<el-input :disabled="!editing" v-model="info.team.invitationCode"></el-input>
</td>
</tr>
</table>
<div v-if="form.completeCompetitionSetup.competitionType && status < 4" class="m-b-20 text-center">
<el-button type="primary" @click="edit(1)">{{ editing ? '保存' : '编辑' }}</el-button>
</div>
</div>
<table class="table">
<tr>
@ -77,7 +79,7 @@
<template v-if="form.completeCompetitionSetup.competitionType">
<th width="110">参赛人数限制</th>
<th>允许参赛人员</th>
<th v-if="info.team.captain === 0 && form.rule === 0">总分</th>
<th v-if="form.rule === 0">总分</th>
</template>
<th>竞赛成绩</th>
</tr>
@ -87,11 +89,24 @@
<td>{{ item.stageName }}</td>
<template v-if="form.completeCompetitionSetup.competitionType">
<td>{{ item.teamNumLimit || '不限制' }}</td>
<td>{{ item.teamParticipantIds || '无' }}</td>
<td v-if="info.team.captain === 0 && form.rule === 0 && !i" :rowspan="info.stages.length">{{ info.totalScore }}</td>
<td>
<template v-if="item.participants">
<el-tag
v-for="tag in item.participants"
:key="tag.name"
class="m-r-5"
closable
@close="removePar(tag, item)">
{{tag.name}}
</el-tag>
</template>
<span v-else class="m-r-5"></span>
<i class="el-icon-edit icon" @click="selectPar(item)"></i>
</td>
<td v-if="form.rule === 0 && !i" :rowspan="info.stages.length">{{ info.totalScore }}</td>
</template>
<td>
<span v-if="item.score" class="m-r-10">分数{{item.score}}</span>
<span v-if="item.score > 0" class="m-r-10">分数{{item.score}}</span>
<el-button type="text" :disabled="item.resultsDetails === 1 || (form.completeCompetitionSetup.competitionType && !item.reportId) || (form.completeCompetitionSetup.competitionType === 0 && !item.reportId)" @click="show(item)">查看成绩详情</el-button>
</td>
</tr>
@ -144,7 +159,7 @@
<el-checkbox-group v-model="checkedMembers">
<el-checkbox v-for="(item, i) in chooses" :key="i" :label="item.accountId">{{ item.userName }}</el-checkbox>
</el-checkbox-group>
<p v-if="info.teamLimit" style="margin-top: 15px;font-size: 12px;">当前阶段限制1人参赛且此竞赛每个成员只能参加一个阶段赛项</p>
<p v-if="info.teamLimit && curRow.teamNumLimit" style="margin-top: 15px;font-size: 12px;">当前阶段限制{{ curRow.teamNumLimit }}人参赛且此竞赛每个成员只能参加一个阶段赛项</p>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="chooseSubmit">确定</el-button>
<el-button size="small" @click="chooseVisible = false">取消</el-button>
@ -280,6 +295,21 @@ export default {
info.caption = caption ? caption : {}
info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId)
this.originInfo = JSON.parse(JSON.stringify(info))
// accountId
info.stages && info.stages.map(e => {
if (e.participantAccountIds && e.teamParticipantIds) {
const accountIds = e.participantAccountIds.split(',').map(n => +n)
const names = e.teamParticipantIds.split(',')
const participants = []
accountIds.map((n, i) => {
participants.push({
id: n,
name: names[i]
})
})
e.participants = participants
}
})
//
const now = Date.now()
this.form.competitionStage.map(e => {
@ -329,8 +359,9 @@ export default {
teamId,
teamName,
invitationCode,
whetherSignUp: 1
whetherSignUp: 0
}).then(res => {
this.editing = false
this.getInfo()
showMsg && util.successMsg('保存成功')
}).catch(res => {})
@ -419,55 +450,81 @@ export default {
}
}
if (!start) {
this.$confirm('确定要踢出该成员吗?', '提示', {
let include
for (const e of this.info.stages) {
if (e.participantAccountIds) {
const ids = e.participantAccountIds.split(',').map(n => +n)
if (ids.includes(row.accountId)) {
include = e.stageName
break
}
}
}
this.$confirm(include ? `该成员已被指定参加${include},踢出后需重新指定成员参加,是否确认踢出团队?` : '确定要踢出该成员吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.removeTheLine}?teamId=${this.info.teamId}&competitionId=${this.id}&accountId=${row.accountId}`).then(res => {
util.successMsg('移除成功')
this.getInfo()
if (row.accountId == this.accountId) this.$router.back()
}).catch(res => {})
}).catch(() => {})
}
},
//
selectPar(row) {
const item = this.form.competitionStage.find(e => e.stageId == row.stageId)
if (item) {
//
const now = new Date()
if (now >= new Date(item.startTime) && now <= new Date(item.endTime)) {
return util.errorMsg('该阶段比赛已经开始,无法修改允许参赛人员!')
} else {
const { teamLimit, stages, teamDetail } = this.info
// teamLimit=truestagesparticipantAccountIdsaccountId
if (teamLimit) {
const chooses = []
let ids = []
// accountId
stages.map(e => {
const id = e.participantAccountIds
id && ids.push(...id.split(',').map(n => +n))
})
ids = [...new Set(ids)]
teamDetail.map(e => {
ids.includes(e.accountId) || chooses.push(e) //
})
this.chooses = chooses
//
removePar(e, stage) {
this.$confirm('确定要移除该成员吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.cancelParticipant, {
accountId: e.id,
competitionId: this.id,
stageId: stage.stageId,
teamId: this.info.teamId
}).then(res => {
util.successMsg('移除成功')
this.getInfo()
}).catch(res => {})
}).catch(() => {})
},
//
selectPar(row) {
const item = this.form.competitionStage.find(e => e.stageId == row.stageId)
if (item) {
//
const now = new Date()
if (now >= new Date(item.startTime) && now <= new Date(item.endTime)) {
return util.errorMsg('该阶段比赛已经开始,无法修改允许参赛人员!')
} else {
this.chooses = this.info.teamDetail
const { teamLimit, stages, teamDetail } = this.info
// teamLimit=truestagesparticipantAccountIdsaccountId
if (teamLimit) {
const chooses = []
let ids = []
// accountId
stages.map(e => {
const id = e.participantAccountIds
if (e.stageId != row.stageId && id) ids.push(...id.split(',').map(n => +n))
})
ids = [...new Set(ids)]
teamDetail.map(e => {
ids.includes(e.accountId) || chooses.push(e) //
})
this.chooses = chooses
} else {
this.chooses = this.info.teamDetail
}
this.curRow = row
this.checkedMembers = []
this.chooseVisible = true
}
this.curRow = row
this.chooseVisible = true
}
}
},
},
//
chooseSubmit() {
const accountIds = this.checkedMembers
if (!accountIds.length) return util.errorMsg('请选择参赛成员!')
const limit = this.curRow.teamNumLimit //
if (accountIds.length > limit) return util.errorMsg(`请选择${limit}个以下参赛成员!`) //
if (limit && accountIds.length > limit) return util.errorMsg(`请选择${limit}个以下参赛成员!`) //
this.$post(this.api.stageSelectParticipants, {
accountIds,
competitionId: this.id,
@ -483,7 +540,7 @@ export default {
//
show(row) {
//
if (this.form.completeCompetitionSetup.competitionType && this.info.team.captain === 0) { //
if (this.form.completeCompetitionSetup.competitionType) { //
this.curRow = row
this.memberVisible = true
const teamId = this.form.competitionRegistration.teamId
@ -513,6 +570,9 @@ export default {
</script>
<style lang="scss" scoped>
.m-r-5 {
margin-right: 5px;
}
.l-title {
margin-top: 20px;
font-size: 18px;
@ -536,6 +596,9 @@ export default {
font-size: 16px;
color: #7a7a7a;
cursor: pointer;
&:hover {
color: #007EFF;
}
}
.plus {
margin-bottom: 10px;

@ -20,8 +20,8 @@
<el-button type="primary" :disabled="type === 0" class="ml20" @click="batchImport">上传文件</el-button>
</div>
<div>
<el-button v-if="(type && uploadData.length) || (!type && !published)" type="primary" @click="cancelPublish(1)">发布排名</el-button>
<el-button v-else type="primary" @click="cancelPublish(0)">取消发布</el-button>
<el-button v-if="(type && uploadData.length) || (!type && !published) || (!type && sourceType == 1)" type="primary" @click="cancelPublish(1)">发布排名</el-button>
<el-button v-if="published && ((!type && sourceType === '0') || (type && sourceType == 1))" type="primary" @click="cancelPublish(0)">取消发布</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center">
@ -358,10 +358,10 @@ export default {
//
publish() {
//
if (this.published && this.sourceType != !this.type) {
this.$confirm(this.sourceType && !this.type ?
'手动排名已发布,是否要取消手动排名的内容,改为系统排名的内容?' :
'默认系统排名已发布,是否要取消系统排名的内容,改为手动发布的内容?', '提示', {
if (this.published && this.sourceType != this.type) {
this.$confirm(this.sourceType == 1 && !this.type ?
'手动排名已发布,是否要取消手动排名的内容,改为系统排名的内容?' :
'默认系统排名已发布,是否要取消系统排名的内容,改为手动发布的内容?', '提示', {
type: 'success'
}).then(() => {
this.publishSubmit()
@ -390,6 +390,7 @@ export default {
}).catch(res => {})
} else {
this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}`).then(res => {
this.sourceType = ''
this.getData()
util.successMsg('取消发布成功!')
}).catch(res => {})

@ -40,8 +40,8 @@
</li>
<li>
<label>学生班级</label>
<el-input v-if="editing" v-model="infoData.workNumber"></el-input>
<span v-else>{{ infoData.workNumber }}</span>
<el-input v-if="editing" v-model="infoData.className"></el-input>
<span v-else>{{ infoData.className }}</span>
</li>
<li>
<label>指导老师</label>

@ -15,7 +15,7 @@
</li>
</ul>
<div>
<el-button type="primary" round @click="add" v-auth="'/match:管理:报名人员:新增'">新增</el-button>
<el-button type="primary" round @click="add">新增</el-button>
<el-button type="primary" round @click="exportAll" v-auth="'/match:管理:报名人员:导出'">批量导出</el-button>
</div>
</div>
@ -39,7 +39,7 @@
</el-table-column>
<el-table-column label="操作" align="center" width="320">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-if="scope.row.identification" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="info(scope.row)">参赛信息与成绩</el-button>
<el-switch
v-model="scope.row.isDisable"
@ -58,7 +58,7 @@
</div>
<el-dialog :title="(form.accountId ? '编辑' : '新增') + '参赛人员'" :visible.sync="addVisible" width="400px" class="dialog" :close-on-click-modal="false" @close="closeAdd">
<el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'" :visible.sync="addVisible" width="400px" class="dialog" :close-on-click-modal="false" @close="closeAdd">
<el-form ref="form" :model="form" :rules="rules" label-width="80px" style='margin-right: 10px;'>
<el-form-item prop="schoolId" label="院校">
<el-select v-model="form.schoolId" filterable style="width: 100%">
@ -105,7 +105,7 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="teamSubmit">确定并报名</el-button>
<el-button size="small" type="primary" @click="teamSubmit">确定并使用</el-button>
<el-button size="small" @click="teamVisible = false">取消</el-button>
</span>
</el-dialog>
@ -188,7 +188,8 @@ export default {
whetherSignUp: 1,
identification: 1
},
originForm: {}
originForm: {},
exitMember: 0
};
},
watch: {
@ -252,6 +253,7 @@ export default {
this.isAdd = false
this.addVisible = true
row.userName = row.username
this.exitMember = 0
row.id = row.accountId
this.originForm = JSON.parse(JSON.stringify(row))
this.form = JSON.parse(JSON.stringify(row))
@ -259,18 +261,28 @@ export default {
//
workNumberChange() {
const { form } = this
form.schoolId && form.schoolId && this.$get(`${this.api.enquireAboutSchoolStudents}?schoolId=${form.schoolId}&workNumber=${form.workNumber}`).then(({ account }) => {
if (account) {
account
this.form = account
}
this.formEnable = !account
}).catch(res => {})
if (this.originForm.workNumber !== form.workNumber) {
form.schoolId && form.workNumber && this.$get(`${this.api.enquireAboutSchoolStudents}?schoolId=${form.schoolId}&workNumber=${form.workNumber}${this.isAdd ? '' : '&applyFor=1'}`).then(({ account }) => {
this.exitMember = 0
if (account) {
this.form = account
}
this.formEnable = !account
}).catch(res => {
if (!this.isAdd) this.exitMember = 1
})
} else {
this.exitMember = 0
}
},
//
submitForm() {
const { form } = this
if (!this.isAdd) { //
if (this.exitMember) {
this.submiting = false
return util.errorMsg('学生已存在')
}
this.$post(this.api.updateUser, {
hrUserAccount: {
...form,
@ -335,7 +347,7 @@ export default {
const team = this.teams.find(e => e.teamId == form.teamId)
if (team && team.invitationCode) form.invitationCode = team.invitationCode
// id-id-schoolId-workNumber
form.account = `${Setting.platformId}-0-${form.schoolId}-${form.workNumber}`
form.account = `${Setting.platformId}-3-${form.schoolId}-${form.workNumber}`
const { phone } = form
if (phone && !/^1[3456789]\d{9}$/.test(phone)) {
return util.errorMsg("请输入正确的手机号/邮箱")
@ -376,10 +388,11 @@ export default {
},
//
getClient() {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理')
this.$post(this.api.queryCustomer,{
page: 1,
size: 1000,
supplierId: ''
supplierId: (sid && !sid.all) ? sid.supplierId : ''
}).then(res => {
this.clients = res.message.list
}).catch(res => {})
@ -408,7 +421,7 @@ export default {
},
//
info(row) {
this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`)
this.$router.push(`info?id=${this.id}&accountId=${row.accountId}`)
},
exportAll() {
const data = this.multipleSelection

@ -17,17 +17,17 @@
<div class="l-title" id="part1"><img src="@/assets/img/label.png" alt=""> 竞赛信息</div>
<div v-if="form.description" class="texts ql-editor" v-html="form.description"></div>
<template v-if="form.contestAnnexList && form.contestAnnexList.length">
<template v-if="form.competitionAnnexList && form.competitionAnnexList.length">
<h6 class="p-title">附件下载</h6>
<ul class="files">
<li v-for="(item, i) in form.contestAnnexList" :key="i">
<li v-for="(item, i) in form.competitionAnnexList" :key="i">
<el-link v-if="item.canPreview" class="m-r-10" type="primary" @click="previewFile(item)">{{ item.fileName }}</el-link>
<span v-else class="file-name">{{ item.fileName }}</span>
<el-link type="primary" :underline="false" @click="download(item)">下载</el-link>
</li>
</ul>
</template>
<template v-if="!form.description && (!form.contestAnnexList || !form.contestAnnexList.length )">
<template v-if="!form.description && (!form.competitionAnnexList || !form.competitionAnnexList.length )">
<div class="empty">
<div>
<img src="@/assets/img/none.png" alt="">
@ -36,6 +36,38 @@
</div>
</template>
<template v-if="form.releaseType && form.competitionStage.length">
<div class="l-title"><img src="@/assets/img/label.png" alt=""> 赛程规则与内容</div>
<h6 class="rule-title">{{ form.competitionStage.length }}个竞赛阶段同一个团队每个成员只能参加一个阶段赛项</h6>
<div v-for="(rule, i) in form.competitionStage" :key="i" class="rule">
<p style="font-size: 16px;color: #333;">{{ rule.stageName }}</p>
<p>比赛时间{{ rule.startTime && rule.startTime + ' ~ ' + rule.endTime }}</p>
<p>比赛方式{{ methods.find(e => e.id == rule.method) && methods.find(e => e.id == rule.method).name }}</p>
<p v-if="!rule.method">课程系统{{ rule.systemName }}</p>
<p v-if="rule.onlineButton">线上地点{{ rule.onlineAddress }}</p>
<p v-if="rule.offlineButton">线下地点{{ rule.offlineAddress }}</p>
<template v-if="rule.method === 2">
<p>线下地点{{ rule.offlineAddress }}</p>
<p>比赛内容{{ rule.contentDescription }}</p>
<p>评分规则{{ rule.scoreRule }}</p>
</template>
<template v-if="form.completeCompetitionSetup.competitionType">
<p>团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p>
<p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p>
</template>
<p>阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p>
<div v-if="form.rule === 1" class="flex">
<p>晋级规则</p>
<div>
<p v-if="rule.peopleLimit">本阶段成绩排名前{{ rule.peopleLimit }}可晋级下一阶段比赛</p>
<p v-if="rule.percentageLimit">本阶段成绩排名前{{ rule.percentageLimit }}%可晋级下一阶段比赛</p>
<p v-if="rule.scoreLimit">本阶段成绩{{ rule.scoreLimit }}可晋级下一阶段比赛</p>
</div>
</div>
</div>
</template>
<!-- 进展 -->
<div class="l-title" id="part2"><img src="@/assets/img/label.png" alt=""> 竞赛进展</div>
<ul class="progress" v-if="progress.length">
@ -80,10 +112,14 @@
<script>
import util from "@/libs/util";
import breadcrumb from '@/components/breadcrumb'
import Const from '@/const/match'
export default {
name: "match",
data() {
return {
rules: Const.rules,
methods: Const.methods,
teamCalculationMethods: Const.teamCalculationMethods,
curType: '1',
typeList: [
{
@ -117,7 +153,7 @@ export default {
methods: {
//
handleAnnex() {
const list = this.form.contestAnnexList
const list = this.form.competitionAnnexList
if (list) {
list.map(e => {
const { filePath } = e
@ -481,4 +517,18 @@ export default {
color: rgba(0, 0, 0, 0.25);
}
}
.rule-title {
margin-bottom: 10px;
font-size: 16px;
}
.rule {
padding: 15px;
margin-bottom: 15px;
border: 1px solid #dfdfdf;
p {
font-size: 14px;
line-height: 30px;
color: #6e6e6e;
}
}
</style>

@ -36,6 +36,26 @@ export default {
path: `noticeDetail`,
component: () => import("@/pages/match/manage/noticeDetail"),
meta: { title: "通知公告" }
}
},
{
path: 'archList',
component: () => import( '@/pages/match/manage/matchArchList'),
meta: { title: '成绩管理' }
},
{
path: 'rank',
component: () => import( '@/pages/match/manage/matchRank'),
meta: { title: '排名管理' }
},
{
path: 'report',
component: () => import( '@/pages/match/manage/matchReport'),
meta: { title: '实验报告' }
},
{
path: 'info',
component: () => import( '@/pages/match/manage/matchInfo'),
meta: { title: '参赛信息与成绩' }
},
]
};

@ -87,7 +87,7 @@ const Setting = {
// 相同路由,不同参数间进行切换,是否强力更新
sameRouteForceUpdate: false,
// 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮)
dynamicRoute: false,
dynamicRoute: true,
// 文件上传
upload: {
apiURL: uploadURL,

Loading…
Cancel
Save