|
|
|
@ -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" :disabled="!editing && form.id"> |
|
|
|
|
<el-form label-width="170px" label-suffix=":" size="small" :disabled="!editing && form.id !== ''"> |
|
|
|
|
<el-form-item label="竞赛封面(选填)"> |
|
|
|
|
<el-upload |
|
|
|
|
class="avatar-uploader" |
|
|
|
@ -51,17 +51,17 @@ |
|
|
|
|
</div> |
|
|
|
|
</el-upload> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="竞赛名称"> |
|
|
|
|
<el-form-item class="req" label="竞赛名称"> |
|
|
|
|
<div class="d-inline-block"> |
|
|
|
|
<el-input placeholder="请输入竞赛名称" v-model="form.name" clearable></el-input> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="主办方"> |
|
|
|
|
<el-form-item class="req" label="主办方"> |
|
|
|
|
<div class="inline-input"> |
|
|
|
|
<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" :disabled="!editing && form.id" @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" :disabled="!editing && form.id" @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> |
|
|
|
@ -84,17 +84,17 @@ |
|
|
|
|
<span>添加</span> |
|
|
|
|
</button> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="报名时间"> |
|
|
|
|
<el-form-item class="req" label="报名时间"> |
|
|
|
|
<el-date-picker v-model="signupTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" |
|
|
|
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" |
|
|
|
|
:picker-options="pickerOptions"></el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="竞赛时间"> |
|
|
|
|
<el-form-item class="req" label="竞赛时间"> |
|
|
|
|
<el-date-picker v-model="playTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" |
|
|
|
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" |
|
|
|
|
:picker-options="pickerOptions"></el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="比赛范围"> |
|
|
|
|
<el-form-item class="req" label="比赛范围"> |
|
|
|
|
<div v-if="form.id"> |
|
|
|
|
<el-radio v-model="form.competitionScope" :label="0" disabled>本校内</el-radio> |
|
|
|
|
</div> |
|
|
|
@ -107,29 +107,29 @@ |
|
|
|
|
<span style="margin-left: 20px">{{ rangeName }}</span> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="竞赛类型"> |
|
|
|
|
<el-form-item class="req" label="竞赛类型"> |
|
|
|
|
<el-radio v-model="form.completeCompetitionSetup.competitionType" :label="0">个人赛</el-radio> |
|
|
|
|
<el-radio v-model="form.completeCompetitionSetup.competitionType" :label="1">团队赛</el-radio> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item v-if="!form.completeCompetitionSetup.competitionType" label="报名人数上限"> |
|
|
|
|
<el-form-item class="req" v-if="!form.completeCompetitionSetup.competitionType" label="报名人数上限"> |
|
|
|
|
<div class="input-center"> |
|
|
|
|
<el-input placeholder="请输入人数" v-model="form.completeCompetitionSetup.quantityLimit" type="number"></el-input> 人 |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<template v-if="form.completeCompetitionSetup.competitionType"> |
|
|
|
|
<el-form-item label="报名团队数上限"> |
|
|
|
|
<el-form-item class="req" label="报名团队数上限"> |
|
|
|
|
<div class="input-center"> |
|
|
|
|
<el-input placeholder="请输入团队数" v-model="form.completeCompetitionSetup.quantityLimit" type="number"></el-input> 队 |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="团队人数"> |
|
|
|
|
<el-form-item class="req" label="团队人数"> |
|
|
|
|
<div class="input-center" style="width: 250px;"> |
|
|
|
|
<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> |
|
|
|
|
</template> |
|
|
|
|
<el-form-item label="报名邀请码"> |
|
|
|
|
<el-form-item class="req" label="报名邀请码"> |
|
|
|
|
<div class="input-center" style="width: 550px;"> |
|
|
|
|
<el-radio v-model="form.completeCompetitionSetup.isNeedCode" :label="0">不需要</el-radio> |
|
|
|
|
<el-radio v-model="form.completeCompetitionSetup.isNeedCode" :label="1">需要</el-radio> |
|
|
|
@ -137,7 +137,7 @@ |
|
|
|
|
<el-button v-if="form.completeCompetitionSetup.isNeedCode === 1" @click="randomInv">随机</el-button> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="竞赛详情"> |
|
|
|
|
<el-form-item class="req" label="竞赛详情"> |
|
|
|
|
<quill :border="true" v-model="form.description" :height="400" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="附件"> |
|
|
|
@ -201,6 +201,7 @@ |
|
|
|
|
<script> |
|
|
|
|
import util from "@/libs/util"; |
|
|
|
|
import quill from "@/components/quill"; |
|
|
|
|
import { Loading } from 'element-ui' |
|
|
|
|
export default { |
|
|
|
|
props: ['editing'], |
|
|
|
|
data() { |
|
|
|
@ -210,7 +211,7 @@ export default { |
|
|
|
|
token: sessionStorage.getItem('token') |
|
|
|
|
}, |
|
|
|
|
form: { |
|
|
|
|
id: this.$route.query.id, |
|
|
|
|
id: this.$route.query.id || '', |
|
|
|
|
platformSource: 0, // 平台来源(0:中台,1:职站) |
|
|
|
|
ztOpen: 0, // 中台是否开启(0开启 1未开启 默认0) |
|
|
|
|
name: '', |
|
|
|
@ -366,6 +367,7 @@ export default { |
|
|
|
|
getData() { |
|
|
|
|
const { id } = this.form |
|
|
|
|
id && this.$post(`${this.api.getCompetition}?competitionId=${id}`).then(({ competition }) => { |
|
|
|
|
this.$parent.publishStatus = competition.publishStatus |
|
|
|
|
this.$parent.releaseType = competition.releaseType |
|
|
|
|
this.$parent.setupId = competition.completeCompetitionSetup.setupId |
|
|
|
|
if (competition.signUpStartTime) this.signupTime = [competition.signUpStartTime, competition.signUpEndTime] |
|
|
|
@ -598,25 +600,32 @@ export default { |
|
|
|
|
if (competitionType) { |
|
|
|
|
if (minTeamSize === '') return util.warningMsg('请填写团队人数下限') |
|
|
|
|
if (maxTeamSize === '') return util.warningMsg('请填写团队人数上限') |
|
|
|
|
if (minTeamSize >= maxTeamSize) return util.warningMsg('团队人数上限不得小于下限') |
|
|
|
|
if (minTeamSize > maxTeamSize) return util.warningMsg('团队人数上限不得小于下限') |
|
|
|
|
} |
|
|
|
|
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 |
|
|
|
|
if (form.id) { |
|
|
|
|
this.$post(this.api.editCompetition, form).then(res => { |
|
|
|
|
this.$parent.hideLoad() |
|
|
|
|
util.successMsg("修改成功"); |
|
|
|
|
this.$emit('next', next) |
|
|
|
|
}).catch(err => {}); |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.$parent.hideLoad() |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$post(this.api.addCompetition, form).then(({ competitionId, setupId }) => { |
|
|
|
|
this.$parent.hideLoad() |
|
|
|
|
util.successMsg("创建成功"); |
|
|
|
|
this.$emit('next', next, setupId, competitionId) |
|
|
|
|
}).catch(err => {}); |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.$parent.hideLoad() |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 预览 |
|
|
|
@ -811,4 +820,15 @@ $upload-lg-height: 150px; |
|
|
|
|
.el-steps { |
|
|
|
|
justify-content: center; |
|
|
|
|
} |
|
|
|
|
/deep/.req { |
|
|
|
|
.el-form-item__label { |
|
|
|
|
&:before { |
|
|
|
|
content: '*'; |
|
|
|
|
margin-right: 5px; |
|
|
|
|
font-size: 18px; |
|
|
|
|
vertical-align: middle; |
|
|
|
|
color: #f00; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |