大赛联调

dev_202303
yujialong 2 years ago
parent 121b50bc31
commit edacc49466
  1. 3
      src/assets/css/main.css
  2. 3
      src/utils/api.js
  3. 94
      src/views/course/AddCurriculum.vue
  4. 48
      src/views/match/add/index.vue
  5. 45
      src/views/match/add/set.vue
  6. 61
      src/views/match/add/step1.vue
  7. 64
      src/views/match/add/step2.vue
  8. 6
      src/views/match/add/step3.vue
  9. 53
      src/views/match/add/step4.vue
  10. 36
      src/views/match/manage/index.vue
  11. 118
      src/views/match/manage/matchArch.vue
  12. 16
      src/views/match/manage/matchProgress.vue
  13. 39
      src/views/match/manage/matchSignup.vue
  14. 6
      src/views/match/manage/notice.vue
  15. 2
      src/views/match/manage/noticeDetail.vue

@ -338,6 +338,9 @@ li {
font-weight: normal;
}
.el-input__inner[type=number] {
padding-right: 0;
}
/*flex*/
.flex-center{
display: flex;

@ -303,6 +303,7 @@ export default {
editCompetition: `competition/competition/management/editCompetition`,
getCompetition: `competition/competition/management/getCompetition`,
disabledEventsCompetition: `competition/competition/management/disabledEvents`,
getProjectAssessmentByCompetition: `occupationlab/occupationlab/projectManage/getProjectAssessmentByCompetition`,
// 赛事内容
addCompetitionContent: `competition/competition/content/addCompetitionContent`,
@ -336,6 +337,6 @@ export default {
amendmentAnnouncement: `competition/competition/announcement/amendmentAnnouncement`,
deleteAnnouncement: `competition/competition/announcement/deleteAnnouncement`,
disableAnnouncement: `competition/competition/announcement/disableAnnouncement`,
queryAnnouncementByContestId: `competition/competition/announcement/queryAnnouncementByContestId`,
queryAnnouncementByCompetitionId: `competition/competition/announcement/queryAnnouncementByCompetitionId`,
queryAnnouncementDetails: `competition/competition/announcement/queryAnnouncementDetails`,
};

@ -268,6 +268,56 @@
</div>
</el-card>
<!-- 竞赛配置 -->
<el-card shadow="hover" class="mgb20">
<div class="mgb20 flex-between">
<div class="flex-center ">
<p class="addhr_tag"></p>
<span>竞赛配置</span>
</div>
<div>
<el-button @click="handleBatchDelete(2)">批量移除</el-button>
<el-button @click="handleConfig(2)" icon="el-icon-plus" circle></el-button>
</div>
</div>
<div class="border-b-dashed"></div>
<!-- 实训配置 -->
<div>
<el-table :data="matches" class="table" stripe header-align="center" max-height="400"
@selection-change="handleSelectionAssessment">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="applicationName" label="系统名称" align="center">
<template slot-scope="scope">
{{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template>
</el-table-column>
<el-table-column label="排序" align="center" width="100">
<template slot-scope="scope">
<el-input v-model.trim="scope.row.sort"
@input="assessmentSortChange(scope.row, scope.$index)"></el-input>
</template>
</el-table-column>
<el-table-column label="展示控制" align="center" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShow"
:active-value="0"
:inactive-value="1"
:disabled="scope.row.disabled">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button :disabled="scope.row.disabled" @click.native.prevent="handleDelete(scope.$index, assessmentData)">移除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
</el-col>
</el-row>
@ -441,6 +491,8 @@ export default {
assessmentData: [],
assessmentTotal: 0,
matches: [],
matcheTotal: 0,
multipleAssessment: [],
submiting: false, //
loadIns: null,
@ -535,7 +587,6 @@ export default {
//
getSupplier() {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
console.log("🚀 ~ file: AddCurriculum.vue ~ line 523 ~ getSupplier ~ sid", sid)
this.$get(this.api.getSupplierListByRole, {
permissionId: sid.permissionId
}).then(res => {
@ -544,7 +595,11 @@ export default {
},
//
getSystem() {
const checked = this.permissions ? this.assessmentData : this.practiceData
const checked = this[!this.permissions ?
'practiceData' :
this.permissions == 1 ?
'assessmentData' :
'matches']
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
this.$post(this.api.queryServiceConfig, {
systemName: '',
@ -650,7 +705,11 @@ export default {
},
//
getConfig() {
const checked = this.permissions ? this.assessmentData : this.practiceData
const checked = this[!this.permissions ?
'practiceData' :
this.permissions == 1 ?
'assessmentData' :
'matches']
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
this.$post(this.api.queryServiceConfig, {
systemName: this.systemKeyword,
@ -791,12 +850,15 @@ export default {
e.isShow = 0; // isShow(0: 1:)
e.sort = i + 1; //
});
if (this.permissions) {
this.assessmentData = JSON.parse(JSON.stringify(list))
this.assessmentTotal = this.assessmentData.length;
} else {
if (!this.permissions) {
this.practiceData = JSON.parse(JSON.stringify(list))
this.practiceTotal = this.practiceData.length;
} else if (this.permissions == 1) {
this.assessmentData = JSON.parse(JSON.stringify(list))
this.assessmentTotal = this.assessmentData.length;
} else if (this.permissions == 2) {
this.matches = JSON.parse(JSON.stringify(list))
this.matchTotal = this.matches.length;
}
}
},
@ -813,12 +875,15 @@ export default {
this.multipleAssessment = val;
},
handleBatchDelete(type) { //
if (type && !this.multipleAssessment.length) {
if (type == 1 && !this.multipleAssessment.length) {
this.$message.warning("请勾选考核项目!");
return;
} else if (!type && !this.multiplePractice.length) {
this.$message.warning("请勾选练习项目!");
return;
} else if (type == 2 && !this.multiplePractice.length) {
this.$message.warning("请勾选竞赛项目!");
return;
}
this.$confirm("此操作将批量移除项目, 是否继续?", "提示", {
type: "warning"
@ -874,7 +939,6 @@ export default {
if(+businessProportion + +manufacturerProportion !== 100) return this.$message.warning('比例分成总和须为100%,请重新修改')
}
form.supplier = form.supplier.join()
debugger
if (!form.coverUrl) {
this.$message.warning("请上传课程封面");
return;
@ -909,6 +973,18 @@ export default {
});
form.systemIdByAssessment.sort((a, b) => a.sort - b.sort)
}
//
form.systemIdByCompetition = this.matches.map(i => {
let obj = {
isShow: i.isShow,
projectId: i.projectId,
sort: Number(i.sort),
systemId: i.systemId
};
return obj;
});
form.systemIdByCompetition.sort((a, b) => a.sort - b.sort)
this.submiting = true
this.loadIns = this.$loading({
lock: true,

@ -1,18 +1,22 @@
<template>
<div>
<el-card v-if="!form.id" shadow="hover" class="m-b-20">
<el-card v-if="!id" shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="back" :content="'创建赛事'"></el-page-header>
</div>
</el-card>
<el-card v-if="!form.id" shadow="hover" class="m-b-20">
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px">
<template v-if="step === 1">
<div class="p-title">大赛发布类型</div>
<el-form label-width="100px" label-suffix=":" size="small">
<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-form-item>
<el-steps :space="200" :active="step - 1" finish-status="success">
</el-form>
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1">编辑</el-button>
</template>
<el-steps v-if="editing || !id" :space="200" :active="step - 1" finish-status="success">
<el-step title="大赛信息填写"></el-step>
<template v-if="releaseType">
<el-step title="赛程与规则设置"></el-step>
@ -20,20 +24,23 @@
</template>
<el-step title="发布"></el-step>
</el-steps>
</el-form>
</el-card>
<div class="page">
<div class="page-content">
<step1 v-show="step === 1" ref="step1" @next="next" />
<step2 v-show="step === 2" ref="step2" :setupId.sync="setupId" @next="next" />
<step3 v-if="step === 3" ref="step3" :setupId.sync="setupId" />
<step1 v-show="step === 1" ref="step1" :editing.sync="editing" @next="next" />
<step2 v-if="step === 2" ref="step2" :setupId.sync="setupId" @next="next" />
<step3 v-if="step === 3" ref="step3" :setupId.sync="setupId" @next="next" />
<step4 v-if="step === 4" />
<div class="btns">
<el-button v-if="!form.id" @click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button>
<div v-if="step !== 4" class="btns">
<!-- 处于编辑状态或者新增才显示这几个按钮 -->
<template v-if="editing || !id">
<el-button v-if="!id" @click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button>
<el-button v-if="!releaseType" type="primary" @click="save(1)" v-auth="'/match:管理:大赛详情:发布'">发布</el-button>
<el-button v-else type="primary" @click="save(0, 2)" v-auth="'/match:管理:大赛详情:保存并下一步'">保存并下一步</el-button>
<el-button v-else type="primary" @click="save(id ? 1 : 0, 2)" v-auth="'/match:管理:大赛详情:保存并下一步'">保存并下一步</el-button>
</template>
<el-button type="danger" @click="preview" v-auth="'/match:管理:大赛详情:预览'">预览</el-button>
<el-button>取消</el-button>
<el-button @click="$router.back()">取消</el-button>
</div>
</div>
</div>
@ -46,23 +53,26 @@ import quill from "@/components/quill";
import step1 from './step1'
import step2 from './step2'
import step3 from './step3'
import step4 from './step4'
export default {
name: "add",
data() {
return {
releaseType: 1,
form: {},
id: this.$route.query.id,
step: 1,
submiting: false,
updateTime: 0,
setupId: ''
setupId: '',
releaseType: 0,
editing: 0
};
},
components: {
quill,
step1,
step2,
step3
step3,
step4
},
mounted() {
@ -70,7 +80,6 @@ export default {
methods: {
//
save(status, next = 0) {
// if (this.submiting) return false
this.$refs['step' + this.step].save(status, next, this.releaseType)
},
//
@ -111,6 +120,11 @@ export default {
</script>
<style scoped lang="scss">
.edit {
position: absolute;
top: 30px;
right: 30px;
}
.el-steps {
justify-content: center;
}

@ -82,7 +82,7 @@
</template>
</el-table-column> -->
</el-table>
<!-- <div class="pagination">
<div class="pagination">
<el-pagination
background
:page-size="pageSize"
@ -90,7 +90,7 @@
layout="total,prev, pager, next"
:total="total"
></el-pagination>
</div> -->
</div>
</el-card>
</div>
</template>
@ -104,6 +104,10 @@ export default {
curriculumList: [],
keyword: '',
projects: [],
page: 1,
pageSize: 5,
total: 0,
sysId: '',
permissionsKeys: ['练习', '考核', '竞赛'],
};
},
@ -115,6 +119,12 @@ export default {
},
deep:true
},
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
this.getCourse()
@ -129,20 +139,41 @@ export default {
pageSize: 10000,
supplierId: sid ? sid.supplierId : ''
}).then(({ page }) => {
const list = page.records
this.curriculumList = page.records
if (list.length) this.form.cid = list[0].cid
this.courseChange()
}).catch(err => {});
},
//
courseChange() {
const { sysId, sysName } = this.curriculumList.find(e => e.cid == this.form.cid)
this.form.sysName = sysName
this.$get(this.api.getInternalProjectBySystemId, {
permissions: 2,
systemId: sysId
}).then(res => {
this.projects = res
this.sysId = sysId
this.getProject()
},
//
getProject() {
this.$post(this.api.getProjectAssessmentByCompetition, {
pageNum: this.page,
pageSize: this.pageSize,
cid: this.form.cid,
projectName: this.keyword,
systemId: this.sysId,
permissions: 2
}).then(({ data }) => {
this.projects = data.records
this.total = data.total
}).catch(err => {});
},
initData() {
this.page = 1;
this.getProject();
},
handleCurrentChange(val) {
this.page = val;
this.getProject();
},
//
save() {
const { form } = this

@ -3,7 +3,7 @@
<div class="page">
<div class="page-content">
<div class="p-title">大赛信息</div>
<el-form label-width="170px" label-suffix=":" size="small">
<el-form label-width="170px" label-suffix=":" size="small" :disabled="!editing && form.id">
<el-form-item label="竞赛封面(选填)">
<el-upload
class="avatar-uploader"
@ -61,7 +61,7 @@
<div class="input-wrap" v-for="(item,index) in sponsorList" :key="index">
<el-input placeholder="主办方名称" v-model="sponsorList[index]"></el-input>
<i v-if="sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i>
<button v-if="index == 0" class="add-btn" @click="addSponsor">
<button v-if="index == 0" class="add-btn" :disabled="!editing && form.id" @click="addSponsor">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
@ -73,7 +73,7 @@
<div class="input-wrap" v-for="(item,index) in undertakerList" :key="index">
<el-input placeholder="承办方名称" v-model="undertakerList[index]"></el-input>
<i v-if="undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i>
<button v-if="index == 0" class="add-btn" @click="addOrganizer">
<button v-if="index == 0" class="add-btn" :disabled="!editing && form.id" @click="addOrganizer">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
@ -124,7 +124,7 @@
</el-form-item>
<el-form-item label="团队人数">
<div class="input-center" style="width: 250px;">
<el-input v-model="form.completeCompetitionSetup.minTeamSize" clearable type="number"></el-input>
<el-input v-model="form.completeCompetitionSetup.minTeamSize" type="number"></el-input>
<el-input style="margin-left: 5px;" v-model="form.completeCompetitionSetup.maxTeamSize" type="number"></el-input> /
</div>
</el-form-item>
@ -134,7 +134,7 @@
<el-radio v-model="form.completeCompetitionSetup.isNeedCode" :label="0">不需要</el-radio>
<el-radio v-model="form.completeCompetitionSetup.isNeedCode" :label="1">需要</el-radio>
<el-input style="width: 250px" placeholder="请输入4位邀请码或点击随机生成" v-model="form.completeCompetitionSetup.invitationCode" :disabled="form.completeCompetitionSetup.isNeedCode === 0"></el-input>
<el-button>随机</el-button>
<el-button v-if="form.completeCompetitionSetup.isNeedCode === 1" @click="randomInv">随机</el-button>
</div>
</el-form-item>
<el-form-item label="竞赛详情">
@ -202,6 +202,7 @@
import util from "@/libs/util";
import quill from "@/components/quill";
export default {
props: ['editing'],
data() {
const that = this
return {
@ -228,7 +229,7 @@ export default {
description: '',
releaseType: 0,
completeCompetitionSetup: {
competitionType: 1,
competitionType: 0,
invitationCode: '',
isNeedCode: 0,
maxTeamSize: '',
@ -364,13 +365,15 @@ export default {
methods: {
getData() {
const { id } = this.form
id && this.$post(`${this.api.getContest}?contestId=${id}`).then(({ contest }) => {
this.signupTime = [contest.signUpStartTime, contest.signUpEndTime]
this.playTime = [contest.playStartTime, contest.playEndTime]
this.sponsorList = contest.sponsor.split(",")
this.undertakerList = contest.undertaker.split(",")
id && this.$post(`${this.api.getCompetition}?competitionId=${id}`).then(({ competition }) => {
this.$parent.releaseType = competition.releaseType
this.$parent.setupId = competition.completeCompetitionSetup.setupId
this.signupTime = [competition.signUpStartTime, competition.signUpEndTime]
this.playTime = [competition.playStartTime, competition.playEndTime]
this.sponsorList = competition.sponsor.split(",")
this.undertakerList = competition.undertaker.split(",")
//
const fileList = contest.competitionAnnexList
const fileList = competition.competitionAnnexList
if (fileList) {
const files = []
fileList.map(e => {
@ -381,11 +384,11 @@ export default {
})
this.fileList = files
} else {
contest.competitionAnnexList = []
competition.competitionAnnexList = []
}
//
const ranges = contest.competitionRangeList
const ranges = competition.competitionRangeList
if (ranges) {
const range = []
ranges.map(e => {
@ -398,7 +401,7 @@ export default {
}
// name
const rangeName = contest.competitionRangeRespList
const rangeName = competition.competitionRangeRespList
if (rangeName) {
const range = []
rangeName.map(e => {
@ -406,7 +409,7 @@ export default {
})
this.rangeName = range.join(',')
}
this.form = contest
this.form = competition
}).catch(err => {})
},
//
@ -559,6 +562,14 @@ export default {
const id = this.form.competitionAnnexList.find(e => e.fileName === name).id
id && this.$post(`${this.api.deleteAnnex}?id=${id}`).then(res => {}).catch(res => {})
},
//
randomInv() {
let result = ''
for (let i = 0; i < 4; i++) {
result += Math.floor(Math.random() * 10);
}
this.form.completeCompetitionSetup.invitationCode = result
},
/**
* @description 提交
* status 0草稿1发布
@ -569,12 +580,12 @@ export default {
const { form } = this
form.sponsor = this.sponsorList.filter(d => d).join();
form.undertaker = this.undertakerList.filter(d => d).join();
if (form.competitionScope == 2 && !form.competitionRangeList.length) return util.warningMsg('请选择区域、院校')
if (!form.name) return util.warningMsg("请填写竞赛名称");
if (status == 1) {
//
if (status) {
if (form.competitionScope == 2 && !form.competitionRangeList.length) return util.warningMsg('请选择区域、院校')
if (!form.sponsor) return util.warningMsg("请填写主办方");
if (!form.signUpStartTime) return util.warningMsg("请选择报名时间");
}
let now = new Date().getTime();
let signUpStartTime = new Date(form.signUpStartTime).getTime();
let signUpEndTime = new Date(form.signUpEndTime).getTime();
@ -582,12 +593,21 @@ export default {
// if (signUpStartTime && now > signUpStartTime) return util.warningMsg("");
if (!form.playStartTime && status == 1) return util.warningMsg("请选择竞赛时间");
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
const { competitionType, minTeamSize, maxTeamSize, isNeedCode, invitationCode } = form.completeCompetitionSetup
//
if (competitionType) {
if (minTeamSize === '') return util.warningMsg('请填写团队人数下限')
if (maxTeamSize === '') return util.warningMsg('请填写团队人数上限')
if (minTeamSize >= maxTeamSize) return util.warningMsg('团队人数上限不得小于下限')
}
if (isNeedCode && (!invitationCode || invitationCode.length !== 4)) return util.warningMsg('请填写四位数邀请码')
if (!form.description && status == 1) return util.warningMsg("请填写竞赛详情");
}
form.publishStatus = status
form.ztOpen = status ? 0 : 1 //
form.releaseType = releaseType
if (this.form.id) {
if (form.id) {
this.$post(this.api.editCompetition, form).then(res => {
util.successMsg("修改成功");
this.$emit('next', next)
@ -726,7 +746,6 @@ $upload-lg-height: 150px;
width: 100%;
}
}
.inline-input {
.input-wrap {
display: flex;

@ -49,7 +49,7 @@
团队参赛人数限制
<el-radio v-model="item.teamNumLimitOpt" :label="0">不限制</el-radio>
<el-radio v-model="item.teamNumLimitOpt" :label="1">自定义</el-radio>
<el-input v-model="item.teamNumLimit" style="width: 150px;" :disabled="item.teamNumLimitOpt === 0"></el-input>
<el-input v-model.number="item.teamNumLimit" type="number" style="width: 150px;" :disabled="item.teamNumLimitOpt === 0"></el-input>
<span class="tips">可限制本阶段单个团队的出战人数</span>
</div>
<div v-if="step1.completeCompetitionSetup.competitionType" class="line">
@ -65,20 +65,20 @@
<div>
<div class="line">
本阶段成绩排名前
<el-input v-model="item.peopleLimit" style="width: 100px"></el-input>
<el-input v-model.number="item.peopleLimit" type="number" style="width: 100px"></el-input>
可晋级下一阶段比赛
</div>
<div class="line">
本阶段成绩排名前
<el-input v-model="item.percentageLimit" style="width: 100px"></el-input>
<el-input v-model.number="item.percentageLimit" type="number" style="width: 100px"></el-input>
%可晋级下一阶段比赛
</div>
<div>
本阶段成绩
<el-select v-model="item.operator" clearable style="width: 80px;margin-right: 10px">
<el-select v-model="item.operator" style="width: 80px;margin-right: 10px">
<el-option v-for="i in operators" :key="i" :label="i" :value="i"></el-option>
</el-select>
<el-input v-model="item.score" style="width: 100px"></el-input>
<el-input v-model="item.score" type="number" style="width: 100px"></el-input>
可晋级下一阶段比赛
</div>
</div>
@ -86,7 +86,7 @@
<div v-if="!form.rule" class="line">
<span class="req">*</span>
占总成绩权重
<el-input v-model="item.pointWeight" style="width: 150px;"></el-input> %
<el-input v-model.number="item.pointWeight" type="number" style="width: 150px;"></el-input> %
</div>
</div>
</el-form-item>
@ -108,7 +108,7 @@
</el-form-item>
<el-form-item prop="resultAnnouncementTime" label="成绩公布时间">
阶段比赛结束后
<el-input v-model="form.resultAnnouncementTime" style="width: 120px"></el-input>
<el-input v-model.number="form.resultAnnouncementTime" style="width: 120px"></el-input>
小时公布阶段比赛成绩
</el-form-item>
<el-form-item prop="resultsDetails" label="是否公布成绩详情">
@ -130,6 +130,7 @@ export default {
props: ['setupId'],
data() {
return {
id: this.$route.query.id,
step1: this.$parent.$refs.step1.form,
form: {
resultAnnouncementTime: '',
@ -257,16 +258,14 @@ export default {
},
mounted() {
this.ruleForm = JSON.parse(JSON.stringify(this.form.competitionStageList[0]))
console.log(44, this.step1)
// this.getData()
this.id && this.getData()
},
methods: {
getData() {
const { form } = this
this.$post(this.api.CompetitionPageConditionQueryByNakadai, {
pageNum: this.page,
}).then(({ data }) => {
this.matchData = data.records
this.$get(this.api.getCompetitionRule, {
competitionId: this.id
}).then(res => {
if (res.competitionRule) this.form = res.competitionRule
}).catch(res => {})
},
//
@ -282,15 +281,42 @@ export default {
//
save(status, next = 0) {
const { form } = this
if (form.rule === 1) {
form.competitionStageList.map(e => {
const { rule } = form
let invalid = 0
let pointWeight = 0
for (const e of form.competitionStageList) {
if (!e.stageName) {
invalid = 1
util.errorMsg('请输入阶段名称')
break
}
const { competitionType } = this.step1.completeCompetitionSetup // 01
// rule: 012
//
if (!rule) {
//
if (e.pointWeight === '') {
invalid = 1
util.errorMsg('请输入权重')
break
}
pointWeight += e.pointWeight //
if (competitionType && e.teamNumLimitOpt && e.teamNumLimit === '') {
invalid = 1
util.errorMsg('请输入团队参数人数限制')
break
}
} else if (rule === 1) { //
e.scoreLimit = e.operator + e.score
})
}
// if (form.competitionScope == 2 && !form.contestRangeList.length) return util.warningMsg('')
if (this.form.id) {
}
if (invalid) return
if (!rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入')
if (form.resultAnnouncementTime === '') return util.errorMsg('请填写成绩公布时间')
if (form.ruleId) {
this.$post(this.api.editCompetitionRule, form).then(res => {
util.successMsg("修改成功");
this.$emit('next', next)
}).catch(err => {})
} else {
form.setupId = this.setupId

@ -17,7 +17,9 @@
type="datetimerange"
range-separator="~"
start-placeholder="开始日期"
end-placeholder="结束日期">
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
<template v-if="item.method === 2">
@ -157,6 +159,8 @@ export default {
util.errorMsg('请选择课程')
break
}
e.offlineButton = e.offlineButton ? 1 : 0
e.onlineButton = e.onlineButton ? 1 : 0
}
if (invalid) return
if (form[0].contentId) {

@ -0,0 +1,53 @@
<template>
<div class="wrap">
<div class="modal">
<el-steps :space="200" :active="4" finish-status="success">
<el-step title="大赛信息填写"></el-step>
<el-step title="赛程与规则设置"></el-step>
<el-step title="比赛内容设置"></el-step>
<el-step title="发布"></el-step>
</el-steps>
<h1>大赛已发布</h1>
<div class="btns">
<el-button type="primary" @click="back">确定</el-button>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
};
},
mounted() {
},
methods: {
back() {
this.$router.push(`/match?page=${this.$store.state.matchPage}`)
}
}
};
</script>
<style scoped lang="scss">
.wrap {
height: calc(100vh - 300px);
background-color: #fefefe;
}
.modal {
width: 500px;
padding-top: 150px;
margin: 0 auto ;
h1 {
margin: 20px;
text-align: center;
}
.btns {
text-align: center;
}
}
</style>

@ -10,14 +10,11 @@
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
</div>
<!-- 大赛详情 -->
<MatchDetail v-if="active == 'first'" ref="detail" />
<!-- 竞赛进展 -->
<MatchProgress v-else-if="active == 'second'" />
<!-- 公告通知 -->
<notice v-else-if="active == 'third'" />
<!-- 报名人员 -->
<MatchSignup v-else />
<MatchDetail v-if="active == 'tab1'" ref="detail" />
<MatchArch v-if="active == 'tab2'" />
<MatchProgress v-else-if="active == 'tab3'" />
<notice v-else-if="active == 'tab4'" />
<MatchSignup v-else-if="active == 'tab5'" />
</div>
</div>
@ -26,6 +23,7 @@
<script>
import Setting from "@/setting";
import MatchDetail from "../add";
import MatchArch from "./matchArch";
import MatchProgress from "./matchProgress";
import notice from "./notice";
import MatchSignup from "./matchSignup";
@ -34,17 +32,19 @@ export default {
data() {
return {
name: this.$route.query.name,
active: this.$route.query.tab || "first",
active: this.$route.query.tab || "tab1",
tabs: {
first: "大赛详情",
second: "竞赛进展",
third: "公告通知",
fourth: "报名人员"
tab1: "大赛详情",
tab2: "大赛成绩管理",
tab3: "竞赛进展",
tab4: "公告通知",
tab5: "报名人员"
}
};
},
components: {
MatchDetail,
MatchArch,
MatchProgress,
notice,
MatchSignup
@ -60,10 +60,10 @@ export default {
const tab3 = btns.includes('/match:管理:公告通知')
const tab4 = btns.includes('/match:管理:报名人员')
tab1 || delete this.tabs.first
tab2 || delete this.tabs.second
tab3 || delete this.tabs.third
tab4 || delete this.tabs.fourth
tab1 || delete this.tabs.tab1
tab2 || delete this.tabs.tab2
tab3 || delete this.tabs.tab3
tab4 || delete this.tabs.tab4
const type = this.$route.query.tab
const keys = Object.keys(this.tabs)
this.active = keys.includes(type) ? type : keys[0]
@ -74,7 +74,7 @@ export default {
// confirm
handleSave(i) {
//
if (this.active === 'first') {
if (this.active === 'tab1') {
const detail = this.$refs.detail
if (detail.updateTime > 1) {
this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', {

@ -0,0 +1,118 @@
<template>
<!-- 报名人员 -->
<div class="page-content" style="padding: 24px">
<el-collapse v-model="curStep" accordion>
<el-collapse-item title="一致性 Consistency" :name="1">
<div>与现实生活一致与现实生活的流程逻辑保持一致遵循用户习惯的语言和概念</div>
<div>在界面中一致所有的元素和结构需保持一致比如设计样式图标和文本元素的位置等</div>
</el-collapse-item>
<el-collapse-item title="反馈 Feedback" :name="2">
<div>控制反馈通过界面样式和交互动效让用户可以清晰的感知自己的操作</div>
<div>页面反馈操作后通过页面元素的变化清晰地展现当前状态</div>
</el-collapse-item>
<el-collapse-item title="效率 Efficiency" :name="3">
<div>简化流程设计简洁直观的操作流程</div>
<div>清晰明确语言表达清晰且表意明确让用户快速理解进而作出决策</div>
<div>帮助用户识别界面简单直白让用户快速识别而非回忆减少用户记忆负担</div>
</el-collapse-item>
</el-collapse>
</div>
</template>
<script>
import util from "@/libs/util";
import axios from 'axios'
export default {
name: "matchArch",
data() {
return {
curStep: 1
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getData();
}, 500);
}
},
mounted() {
// this.getData();
},
methods: {
getData() {
this.$post(this.api.queryApplicantByCondition, {
pageNum: this.page,
pageSize: this.pageSize,
contestId: this.id,
keyWord: this.keyword,
}).then(({ data }) => {
this.listData = data.records;
this.totals = data.total;
this.$refs.table.clearSelection();
}).catch(res => {
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
switchOff(val, row, index) {
this.$put(`${this.api.disableApplicant}/${row.id}/${val}`)
.then(res => {
})
.catch(err => {
});
},
disalbeAllData() {
if (this.multipleSelection.length != "") {
let newArr = this.multipleSelection;
let delList = newArr.map(item => {
return item.id;
});
this.$confirm("确定要禁用吗?", "提示", {
type: "warning"
})
.then(() => {
this.$put(`${this.api.disableContests}?ids=${delList.join(",")}`).then(res => {
this.multipleSelection = [];
util.successMsg("禁用成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
exportAll() {
const data = this.multipleSelection
if (data.length) {
data.map((e, i) => e.id = i + 1)
axios.post(this.api.exportDataInBatches, data, {
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`报名人员.xls`, new Blob([res.data]))
}).catch(res => {})
} else {
location.href = `${this.api.excelExport}?contestId=${this.id}`
}
}
}
};
</script>
<style scoped>
</style>

@ -77,10 +77,10 @@ export default {
row.operate = true
},
getData() {
this.$get(this.api.getContestProgress, {
contestId: this.id
this.$get(this.api.getCompetitionProgress, {
competitionId: this.id
}).then(res => {
this.listData = res.contestProgressList;
this.listData = res.competitionProgressList;
for(let index=0; index<this.listData.length; index++) {
//
this.$set(this.listData, index, { operate: false, ...this.listData[index]})
@ -93,14 +93,14 @@ export default {
let data = row;
if (data.title.length) {
if (row.id) {
this.$put(this.api.editContestProgress, data).then(res => {
this.$put(this.api.editCompetitionProgress, data).then(res => {
this.touchTime = this.touchTime-1
util.successMsg("修改成功");
this.getData();
}).catch(res => {
});
} else {
this.$post(this.api.addContestProgress, data).then(res => {
this.$post(this.api.addCompetitionProgress, data).then(res => {
this.touchTime = this.touchTime-1
util.successMsg("创建成功");
this.getData();
@ -131,7 +131,7 @@ export default {
util.successMsg("删除成功");
}else {
this.touchTime = this.touchTime+1
this.$del(`${this.api.deleteContestProgress}/${row.id}`).then(res => {
this.$del(`${this.api.deleteCompetitionProgress}?competitionProgressId=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
@ -147,7 +147,7 @@ export default {
if (this.listData.length) {
if (this.listData[this.listData.length - 1].id) {
this.listData.push({
contestId: this.id,
competitionId: this.id,
id: "",
title: "",
description: "",
@ -160,7 +160,7 @@ export default {
}
} else {
this.listData.push({
contestId: this.id,
competitionId: this.id,
id: "",
title: "",
description: "",

@ -5,10 +5,17 @@
<ul class="filter">
<li>
<label>搜索</label>
<el-input placeholder="请输入姓名/手机号/学校" prefix-icon="el-icon-search" v-model="keyword" clearable size="mini"></el-input>
<el-input placeholder="请输入姓名/手机号/团队名称/学号" prefix-icon="el-icon-search" v-model="keyword" clearable size="mini"></el-input>
</li>
<li>
<label>参赛人员状态</label>
<el-select v-model="status" @change="initData">
<el-option v-for="(item, i) in statusList" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
</ul>
<div>
<el-button type="primary" round @click="add" v-auth="'/match:管理:报名人员:新增'">新增</el-button>
<el-button type="primary" round @click="exportAll" v-auth="'/match:管理:报名人员:导出'">导出</el-button>
</div>
</div>
@ -22,6 +29,8 @@
</el-table-column>
<el-table-column prop="school" label="学校">
</el-table-column>
<el-table-column prop="school" label="团队名称">
</el-table-column>
<el-table-column prop="username" label="学生姓名">
</el-table-column>
<el-table-column prop="workNumber" label="学号">
@ -60,6 +69,20 @@ export default {
return {
token: sessionStorage.getItem('token'),
id: this.$route.query.id,
statusList: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '已禁用'
},
{
id: 2,
name: '未禁用'
}
],
keyword: "",
listData: [],
multipleSelection: [],
@ -72,19 +95,19 @@ export default {
keyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getData();
this.initData();
}, 500);
}
},
mounted() {
this.getData();
this.initData();
},
methods: {
getData() {
this.$post(this.api.queryApplicantByCondition, {
this.$post(this.api.queryRegistrationByCondition, {
pageNum: this.page,
pageSize: this.pageSize,
contestId: this.id,
competitionId: this.id,
keyWord: this.keyword,
}).then(({ data }) => {
this.listData = data.records;
@ -93,6 +116,10 @@ export default {
}).catch(res => {
});
},
initData() {
this.page = 1
this.getData()
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
@ -144,7 +171,7 @@ export default {
util.downloadFileDirect(`报名人员.xls`, new Blob([res.data]))
}).catch(res => {})
} else {
location.href = `${this.api.excelExport}?contestId=${this.id}`
location.href = `${this.api.excelExport}?competitionId=${this.id}`
}
}
}

@ -76,7 +76,7 @@ export default {
},
methods: {
getData() {
this.$post(`${this.api.queryAnnouncementByContestId}?pageNum=${this.pageNo}&pageSize=${this.pageSize}&contestId=${this.id}`).then(({ data }) => {
this.$post(`${this.api.queryAnnouncementByCompetitionId}?pageNum=${this.pageNo}&pageSize=${this.pageSize}&CompetitionId=${this.id}`).then(({ data }) => {
this.listData = data.records
this.totals = data.total
this.$refs.table.clearSelection()
@ -126,10 +126,10 @@ export default {
}
},
add() {
this.$router.push(`/noticeDetail?contestId=${this.id}`)
this.$router.push(`/noticeDetail?competitionId=${this.id}`)
},
edit(row) {
this.$router.push(`/noticeDetail?id=${row.id}&contestId=${this.id}`)
this.$router.push(`/noticeDetail?id=${row.id}&competitionId=${this.id}`)
}
}
};

@ -60,7 +60,7 @@ export default {
},
form: {
id: this.$route.query.id,
contestId: this.$route.query.contestId,
competitionId: this.$route.query.competitionId,
announcementText: '',
announcementTitle: '',
announcementAnnexList: [],

Loading…
Cancel
Save