|
|
@ -3,10 +3,12 @@ |
|
|
|
<div class="page"> |
|
|
|
<div class="page"> |
|
|
|
<div class="page-content"> |
|
|
|
<div class="page-content"> |
|
|
|
<div class="p-title">大赛信息</div> |
|
|
|
<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-form-item label="竞赛封面(选填)"> |
|
|
|
<el-upload |
|
|
|
<el-upload class="avatar-uploader" |
|
|
|
class="avatar-uploader" |
|
|
|
|
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-error="uploadError" |
|
|
@ -16,52 +18,71 @@ |
|
|
|
:on-exceed="handleExceed" |
|
|
|
:on-exceed="handleExceed" |
|
|
|
:action="this.api.fileupload" |
|
|
|
:action="this.api.fileupload" |
|
|
|
:headers="headers" |
|
|
|
:headers="headers" |
|
|
|
name="file" |
|
|
|
name="file"> |
|
|
|
> |
|
|
|
<img v-if="form.coverUrl" |
|
|
|
<img v-if="form.coverUrl" :src="form.coverUrl" class="avatar"> |
|
|
|
:src="form.coverUrl" |
|
|
|
<div class="uploader-default" v-else> |
|
|
|
class="avatar"> |
|
|
|
|
|
|
|
<div class="uploader-default" |
|
|
|
|
|
|
|
v-else> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
<p>上传封面</p> |
|
|
|
<p>上传封面</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div slot="tip" class="el-upload__tip"> |
|
|
|
<div slot="tip" |
|
|
|
|
|
|
|
class="el-upload__tip"> |
|
|
|
<p>展示宽度为220,高度140,JPG/PNG/GIF,3MB以内</p> |
|
|
|
<p>展示宽度为220,高度140,JPG/PNG/GIF,3MB以内</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="竞赛封面长图(选填)"> |
|
|
|
<el-form-item label="竞赛封面长图(选填)"> |
|
|
|
<el-upload |
|
|
|
<el-upload class="avatar-uploader avatar-uploader-lg" |
|
|
|
class="avatar-uploader avatar-uploader-lg" |
|
|
|
|
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
:on-remove="handleLgRemove" |
|
|
|
:on-remove="handleLgRemove" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-success="uploadLgSuccess" |
|
|
|
:on-success="uploadLgSuccess" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
:limit="1" :on-exceed="handleExceed" |
|
|
|
:limit="1" |
|
|
|
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
:action="this.api.fileupload" |
|
|
|
:action="this.api.fileupload" |
|
|
|
:headers="headers" |
|
|
|
:headers="headers" |
|
|
|
name="file" |
|
|
|
name="file"> |
|
|
|
> |
|
|
|
<img v-if="form.carouselUrl" |
|
|
|
<img v-if="form.carouselUrl" :src="form.carouselUrl" class="avatar-lg"> |
|
|
|
:src="form.carouselUrl" |
|
|
|
<div class="uploader-default" v-else> |
|
|
|
class="avatar-lg"> |
|
|
|
|
|
|
|
<div class="uploader-default" |
|
|
|
|
|
|
|
v-else> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
<p>上传封面</p> |
|
|
|
<p>上传封面</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div slot="tip" class="el-upload__tip"> |
|
|
|
<div slot="tip" |
|
|
|
|
|
|
|
class="el-upload__tip"> |
|
|
|
<p>展示宽度为1920,高度300,JPG/PNG/GIF,3MB以内</p> |
|
|
|
<p>展示宽度为1920,高度300,JPG/PNG/GIF,3MB以内</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="req" label="竞赛名称"> |
|
|
|
<el-form-item class="req" |
|
|
|
|
|
|
|
label="竞赛名称"> |
|
|
|
<div class="d-inline-block"> |
|
|
|
<div class="d-inline-block"> |
|
|
|
<el-input placeholder="请输入竞赛名称" v-model="form.name" clearable></el-input> |
|
|
|
<el-input placeholder="请输入竞赛名称" |
|
|
|
|
|
|
|
v-model="form.name" |
|
|
|
|
|
|
|
clearable></el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="req" label="主办方"> |
|
|
|
<el-form-item class="req" |
|
|
|
|
|
|
|
label="主办方"> |
|
|
|
<div class="inline-input"> |
|
|
|
<div class="inline-input"> |
|
|
|
<div class="input-wrap" v-for="(item,index) in sponsorList" :key="index"> |
|
|
|
<div class="input-wrap" |
|
|
|
<el-input placeholder="主办方名称" v-model="sponsorList[index]"></el-input> |
|
|
|
v-for="(item,index) in sponsorList" |
|
|
|
<i v-if="sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i> |
|
|
|
:key="index"> |
|
|
|
<button v-if="index == 0" class="add-btn" type="button" :disabled="!editing && form.id !== ''" @click="addSponsor"> |
|
|
|
<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" |
|
|
|
|
|
|
|
type="button" |
|
|
|
|
|
|
|
:disabled="!editing && form.id !== ''" |
|
|
|
|
|
|
|
@click="addSponsor"> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
<span>添加</span> |
|
|
|
<span>添加</span> |
|
|
|
</button> |
|
|
|
</button> |
|
|
@ -70,103 +91,151 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="承办方(选填)"> |
|
|
|
<el-form-item label="承办方(选填)"> |
|
|
|
<div class="inline-input"> |
|
|
|
<div class="inline-input"> |
|
|
|
<div class="input-wrap" v-for="(item,index) in undertakerList" :key="index"> |
|
|
|
<div class="input-wrap" |
|
|
|
<el-input placeholder="承办方名称" v-model="undertakerList[index]"></el-input> |
|
|
|
v-for="(item,index) in undertakerList" |
|
|
|
<i v-if="undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i> |
|
|
|
:key="index"> |
|
|
|
<button v-if="index == 0" class="add-btn" type="button" :disabled="!editing && form.id !== ''" @click="addOrganizer"> |
|
|
|
<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" |
|
|
|
|
|
|
|
type="button" |
|
|
|
|
|
|
|
:disabled="!editing && form.id !== ''" |
|
|
|
|
|
|
|
@click="addOrganizer"> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
<span>添加</span> |
|
|
|
<span>添加</span> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<button v-if="!undertakerList.length" class="add-btn" type="button" @click="addOrganizer"> |
|
|
|
<button v-if="!undertakerList.length" |
|
|
|
|
|
|
|
class="add-btn" |
|
|
|
|
|
|
|
type="button" |
|
|
|
|
|
|
|
@click="addOrganizer"> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
<span>添加</span> |
|
|
|
<span>添加</span> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="req" label="报名时间"> |
|
|
|
<el-form-item class="req" |
|
|
|
<el-date-picker v-model="signupTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" |
|
|
|
label="报名时间"> |
|
|
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" |
|
|
|
<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> |
|
|
|
:picker-options="pickerOptions"></el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="req" label="竞赛时间"> |
|
|
|
<el-form-item class="req" |
|
|
|
<el-date-picker v-model="playTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" |
|
|
|
label="竞赛时间"> |
|
|
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" |
|
|
|
<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> |
|
|
|
:picker-options="pickerOptions"></el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="req" label="比赛范围"> |
|
|
|
<el-form-item class="req" |
|
|
|
|
|
|
|
label="比赛范围"> |
|
|
|
<div v-if="form.id"> |
|
|
|
<div v-if="form.id"> |
|
|
|
<el-radio v-model="form.competitionScope" :label="0" disabled>本校内</el-radio> |
|
|
|
<el-radio v-model="form.competitionScope" |
|
|
|
|
|
|
|
:label="0" |
|
|
|
|
|
|
|
disabled>本校内</el-radio> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-radio v-model="form.competitionScope" :label="1">全平台</el-radio> |
|
|
|
<el-radio v-model="form.competitionScope" |
|
|
|
|
|
|
|
:label="1">全平台</el-radio> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-radio v-model="form.competitionScope" :label="2">指定区域、院校</el-radio> |
|
|
|
<el-radio v-model="form.competitionScope" |
|
|
|
<el-button v-if="form.competitionScope === 2" type="primary" size="mini" @click="showRange">选择院校</el-button> |
|
|
|
:label="2">指定区域、院校</el-radio> |
|
|
|
|
|
|
|
<el-button v-if="form.competitionScope === 2" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
size="mini" |
|
|
|
|
|
|
|
@click="showRange">选择院校</el-button> |
|
|
|
<span style="margin-left: 20px">{{ rangeName }}</span> |
|
|
|
<span style="margin-left: 20px">{{ rangeName }}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="req" label="竞赛类型"> |
|
|
|
<el-form-item class="req" |
|
|
|
<el-radio v-model="form.completeCompetitionSetup.competitionType" :label="0">个人赛</el-radio> |
|
|
|
label="竞赛类型"> |
|
|
|
<el-radio v-model="form.completeCompetitionSetup.competitionType" :label="1">团队赛</el-radio> |
|
|
|
<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> |
|
|
|
<el-form-item class="req" v-if="!form.completeCompetitionSetup.competitionType" label="报名人数上限"> |
|
|
|
<el-form-item class="req" |
|
|
|
|
|
|
|
v-if="!form.completeCompetitionSetup.competitionType" |
|
|
|
|
|
|
|
label="报名人数上限"> |
|
|
|
<div class="input-center"> |
|
|
|
<div class="input-center"> |
|
|
|
<el-input placeholder="请输入人数" v-model.number="form.completeCompetitionSetup.quantityLimit" type="number"></el-input> 人 |
|
|
|
<el-input placeholder="请输入人数" |
|
|
|
|
|
|
|
v-model.number="form.completeCompetitionSetup.quantityLimit" |
|
|
|
|
|
|
|
type="number"></el-input> 人 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<template v-if="form.completeCompetitionSetup.competitionType"> |
|
|
|
<template v-if="form.completeCompetitionSetup.competitionType"> |
|
|
|
<el-form-item class="req" label="报名团队数上限"> |
|
|
|
<el-form-item class="req" |
|
|
|
|
|
|
|
label="报名团队数上限"> |
|
|
|
<div class="input-center"> |
|
|
|
<div class="input-center"> |
|
|
|
<el-input placeholder="请输入团队数" v-model.number="form.completeCompetitionSetup.quantityLimit" type="number"></el-input> 队 |
|
|
|
<el-input placeholder="请输入团队数" |
|
|
|
|
|
|
|
v-model.number="form.completeCompetitionSetup.quantityLimit" |
|
|
|
|
|
|
|
type="number"></el-input> 队 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="req" label="团队人数"> |
|
|
|
<el-form-item class="req" |
|
|
|
<div class="input-center" style="width: 250px;"> |
|
|
|
label="团队人数"> |
|
|
|
<el-input v-model.number="form.completeCompetitionSetup.minTeamSize" type="number"></el-input> 至 |
|
|
|
<div class="input-center" |
|
|
|
<el-input style="margin-left: 5px;" v-model.number="form.completeCompetitionSetup.maxTeamSize" type="number"></el-input> 人/队 |
|
|
|
style="width: 250px;"> |
|
|
|
|
|
|
|
<el-input v-model.number="form.completeCompetitionSetup.minTeamSize" |
|
|
|
|
|
|
|
type="number"></el-input> 至 |
|
|
|
|
|
|
|
<el-input style="margin-left: 5px;" |
|
|
|
|
|
|
|
v-model.number="form.completeCompetitionSetup.maxTeamSize" |
|
|
|
|
|
|
|
type="number"></el-input> 人/队 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<el-form-item class="req" label="报名邀请码"> |
|
|
|
<el-form-item class="req" |
|
|
|
<div class="input-center" style="width: 550px;"> |
|
|
|
label="报名邀请码"> |
|
|
|
<el-radio v-model="form.completeCompetitionSetup.isNeedCode" :label="0">不需要</el-radio> |
|
|
|
<div class="input-center" |
|
|
|
<el-radio v-model="form.completeCompetitionSetup.isNeedCode" :label="1">需要</el-radio> |
|
|
|
style="width: 550px;"> |
|
|
|
<el-input style="width: 250px" placeholder="请输入4位邀请码或点击随机生成" v-model="form.completeCompetitionSetup.invitationCode" :disabled="form.completeCompetitionSetup.isNeedCode === 0"></el-input> |
|
|
|
<el-radio v-model="form.completeCompetitionSetup.isNeedCode" |
|
|
|
<el-button v-if="form.completeCompetitionSetup.isNeedCode === 1" @click="randomInv">随机</el-button> |
|
|
|
: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 v-if="form.completeCompetitionSetup.isNeedCode === 1" |
|
|
|
|
|
|
|
@click="randomInv">随机</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="req" label="竞赛详情"> |
|
|
|
<el-form-item class="req" |
|
|
|
<quill v-if="quillShow" :border="true" v-model="form.description" :height="400" :readonly="!editing && form.id !== ''" /> |
|
|
|
label="竞赛详情"> |
|
|
|
|
|
|
|
<quill v-if="quillShow" |
|
|
|
|
|
|
|
:border="true" |
|
|
|
|
|
|
|
v-model="form.description" |
|
|
|
|
|
|
|
:height="400" |
|
|
|
|
|
|
|
:readonly="!editing && form.id !== ''" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="附件"> |
|
|
|
<el-form-item label="附件"> |
|
|
|
<el-upload |
|
|
|
<Upload :limit="5" |
|
|
|
|
|
|
|
:file-list.sync="fileList" |
|
|
|
:on-remove="handleAnnexRemove" |
|
|
|
:on-remove="handleAnnexRemove" |
|
|
|
:on-error="uploadError" |
|
|
|
@onSuccess="uploadAnnexSuccess"></Upload> |
|
|
|
:before-upload="beforeUpload" |
|
|
|
|
|
|
|
:on-success="uploadAnnexSuccess" |
|
|
|
|
|
|
|
:limit="5" |
|
|
|
|
|
|
|
:on-exceed="handleExceedAnnex" |
|
|
|
|
|
|
|
:action="this.api.fileupload" |
|
|
|
|
|
|
|
:headers="headers" |
|
|
|
|
|
|
|
:file-list="fileList" |
|
|
|
|
|
|
|
name="file" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<el-button size="small" type="primary">点击上传</el-button> |
|
|
|
|
|
|
|
<div slot="tip" class="el-upload__tip"> |
|
|
|
|
|
|
|
<p>支持扩展名:.rar .zip .doc .docx .pdf .jpg...</p> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-upload> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="请勾选院校" :visible.sync="rangeVisible" width="580px" custom-class="range-dia" :close-on-click-modal="false"> |
|
|
|
<el-dialog title="请勾选院校" |
|
|
|
|
|
|
|
:visible.sync="rangeVisible" |
|
|
|
|
|
|
|
width="580px" |
|
|
|
|
|
|
|
custom-class="range-dia" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
<div class="range-wrap"> |
|
|
|
<div class="range-wrap"> |
|
|
|
<el-cascader |
|
|
|
<el-cascader ref="range" |
|
|
|
ref="range" |
|
|
|
|
|
|
|
class="range-cas" |
|
|
|
class="range-cas" |
|
|
|
key="range" |
|
|
|
key="range" |
|
|
|
v-model="range" |
|
|
|
v-model="range" |
|
|
@ -179,8 +248,7 @@ |
|
|
|
@change="rangeChange" |
|
|
|
@change="rangeChange" |
|
|
|
@visible-change="rangeViChange" |
|
|
|
@visible-change="rangeViChange" |
|
|
|
@input.native="rangeSearch"></el-cascader> |
|
|
|
@input.native="rangeSearch"></el-cascader> |
|
|
|
<el-tag |
|
|
|
<el-tag v-for="(tag, i) in rangeChecked" |
|
|
|
v-for="(tag, i) in rangeChecked" |
|
|
|
|
|
|
|
:key="tag.value" |
|
|
|
:key="tag.value" |
|
|
|
class="range-check" |
|
|
|
class="range-check" |
|
|
|
closable |
|
|
|
closable |
|
|
@ -190,9 +258,13 @@ |
|
|
|
</el-tag> |
|
|
|
</el-tag> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
<el-button size="small" @click="rangeVisible = false">取 消</el-button> |
|
|
|
class="dialog-footer"> |
|
|
|
<el-button size="small" type="primary" @click="rangeSubmit">确 定</el-button> |
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
@click="rangeVisible = false">取 消</el-button> |
|
|
|
|
|
|
|
<el-button size="small" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
@click="rangeSubmit">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -201,10 +273,11 @@ |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import util from "@/libs/util"; |
|
|
|
import util from "@/libs/util"; |
|
|
|
import quill from "@/components/quill"; |
|
|
|
import quill from "@/components/quill"; |
|
|
|
|
|
|
|
import Upload from '@/components/upload'; |
|
|
|
import { Loading } from 'element-ui' |
|
|
|
import { Loading } from 'element-ui' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
props: ['editing'], |
|
|
|
props: ['editing'], |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
const that = this |
|
|
|
const that = this |
|
|
|
return { |
|
|
|
return { |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
@ -285,7 +358,7 @@ export default { |
|
|
|
data.push(e) |
|
|
|
data.push(e) |
|
|
|
}) |
|
|
|
}) |
|
|
|
resolve(data) |
|
|
|
resolve(data) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
} else if (level === 1) { |
|
|
|
} else if (level === 1) { |
|
|
|
// 城市 |
|
|
|
// 城市 |
|
|
|
that.$get(that.api.queryCity, { |
|
|
|
that.$get(that.api.queryCity, { |
|
|
@ -300,7 +373,7 @@ export default { |
|
|
|
data.push(e) |
|
|
|
data.push(e) |
|
|
|
}) |
|
|
|
}) |
|
|
|
resolve(data) |
|
|
|
resolve(data) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
} else if (level === 2) { |
|
|
|
} else if (level === 2) { |
|
|
|
// 学校 |
|
|
|
// 学校 |
|
|
|
that.$get(that.api.getSchoolsByProvince, { |
|
|
|
that.$get(that.api.getSchoolsByProvince, { |
|
|
@ -317,7 +390,7 @@ export default { |
|
|
|
data.push(e) |
|
|
|
data.push(e) |
|
|
|
}) |
|
|
|
}) |
|
|
|
resolve(data) |
|
|
|
resolve(data) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
resolve([]) |
|
|
|
resolve([]) |
|
|
|
} |
|
|
|
} |
|
|
@ -329,10 +402,11 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: { |
|
|
|
components: { |
|
|
|
quill |
|
|
|
quill, |
|
|
|
|
|
|
|
Upload |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
editing: function(val) { |
|
|
|
editing: function (val) { |
|
|
|
this.quillShow = false |
|
|
|
this.quillShow = false |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.quillShow = true |
|
|
|
this.quillShow = true |
|
|
@ -340,12 +414,12 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
|
|
|
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
handler(){ |
|
|
|
handler () { |
|
|
|
this.updateTime++ |
|
|
|
this.updateTime++ |
|
|
|
}, |
|
|
|
}, |
|
|
|
deep:true |
|
|
|
deep: true |
|
|
|
}, |
|
|
|
}, |
|
|
|
signupTime: function(val) { |
|
|
|
signupTime: function (val) { |
|
|
|
const { form } = this |
|
|
|
const { form } = this |
|
|
|
if (val) { |
|
|
|
if (val) { |
|
|
|
form.signUpStartTime = val[0]; |
|
|
|
form.signUpStartTime = val[0]; |
|
|
@ -355,7 +429,7 @@ export default { |
|
|
|
form.signUpEndTime = '' |
|
|
|
form.signUpEndTime = '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
playTime: function(val) { |
|
|
|
playTime: function (val) { |
|
|
|
const { form } = this |
|
|
|
const { form } = this |
|
|
|
if (val) { |
|
|
|
if (val) { |
|
|
|
form.playStartTime = val[0] |
|
|
|
form.playStartTime = val[0] |
|
|
@ -366,12 +440,12 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
this.getSchool() |
|
|
|
this.getSchool() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getData() { |
|
|
|
getData () { |
|
|
|
const { id } = this.form |
|
|
|
const { id } = this.form |
|
|
|
id && this.$post(`${this.api.getCompetition}?competitionId=${id}`).then(({ competition }) => { |
|
|
|
id && this.$post(`${this.api.getCompetition}?competitionId=${id}`).then(({ competition }) => { |
|
|
|
this.$parent.publishStatus = competition.publishStatus |
|
|
|
this.$parent.publishStatus = competition.publishStatus |
|
|
@ -387,6 +461,7 @@ export default { |
|
|
|
const files = [] |
|
|
|
const files = [] |
|
|
|
fileList.map(e => { |
|
|
|
fileList.map(e => { |
|
|
|
files.push({ |
|
|
|
files.push({ |
|
|
|
|
|
|
|
id: e.id, |
|
|
|
name: e.fileName, |
|
|
|
name: e.fileName, |
|
|
|
url: e.filePath |
|
|
|
url: e.filePath |
|
|
|
}) |
|
|
|
}) |
|
|
@ -424,14 +499,14 @@ export default { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.updateTime = 0 |
|
|
|
this.updateTime = 0 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 选择范围 |
|
|
|
// 选择范围 |
|
|
|
showRange() { |
|
|
|
showRange () { |
|
|
|
this.rangeVisible = true |
|
|
|
this.rangeVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 范围勾选回调 |
|
|
|
// 范围勾选回调 |
|
|
|
rangeChange(val, e) { |
|
|
|
rangeChange (val, e) { |
|
|
|
const checked = this.$refs.range.getCheckedNodes() |
|
|
|
const checked = this.$refs.range.getCheckedNodes() |
|
|
|
const name = [] |
|
|
|
const name = [] |
|
|
|
const { rangeChecked } = this |
|
|
|
const { rangeChecked } = this |
|
|
@ -441,14 +516,14 @@ export default { |
|
|
|
this.rangeChecked.push(...name) |
|
|
|
this.rangeChecked.push(...name) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 范围展开收缩回调 |
|
|
|
// 范围展开收缩回调 |
|
|
|
rangeViChange(e) { |
|
|
|
rangeViChange (e) { |
|
|
|
// 展开的时候清空搜索结果 |
|
|
|
// 展开的时候清空搜索结果 |
|
|
|
if (e) { |
|
|
|
if (e) { |
|
|
|
this.rangeList = [] |
|
|
|
this.rangeList = [] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取学校列表 |
|
|
|
// 获取学校列表 |
|
|
|
getSchool() { |
|
|
|
getSchool () { |
|
|
|
this.$get(this.api.querySchoolData).then(({ list }) => { |
|
|
|
this.$get(this.api.querySchoolData).then(({ list }) => { |
|
|
|
const result = [] |
|
|
|
const result = [] |
|
|
|
list.map(e => { |
|
|
|
list.map(e => { |
|
|
@ -458,14 +533,14 @@ export default { |
|
|
|
result.push(e) |
|
|
|
result.push(e) |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.schools = result |
|
|
|
this.schools = result |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 范围模糊查询前置钩子 |
|
|
|
// 范围模糊查询前置钩子 |
|
|
|
beforeFilter() { |
|
|
|
beforeFilter () { |
|
|
|
return false |
|
|
|
return false |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 范围筛选 |
|
|
|
// 范围筛选 |
|
|
|
rangeSearch(el) { |
|
|
|
rangeSearch (el) { |
|
|
|
const val = el.target.value.trim() |
|
|
|
const val = el.target.value.trim() |
|
|
|
const checked = this.rangeChecked |
|
|
|
const checked = this.rangeChecked |
|
|
|
if (!val) { |
|
|
|
if (!val) { |
|
|
@ -483,11 +558,11 @@ export default { |
|
|
|
this.rangeList = result |
|
|
|
this.rangeList = result |
|
|
|
}, 100) |
|
|
|
}, 100) |
|
|
|
}, |
|
|
|
}, |
|
|
|
closeRange(i) { |
|
|
|
closeRange (i) { |
|
|
|
this.rangeChecked.splice(i, 1) |
|
|
|
this.rangeChecked.splice(i, 1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 范围确定 |
|
|
|
// 范围确定 |
|
|
|
rangeSubmit() { |
|
|
|
rangeSubmit () { |
|
|
|
// 处理提交需要的id |
|
|
|
// 处理提交需要的id |
|
|
|
const data = [] |
|
|
|
const data = [] |
|
|
|
const checked = this.rangeChecked |
|
|
|
const checked = this.rangeChecked |
|
|
@ -510,74 +585,57 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
this.rangeVisible = false |
|
|
|
this.rangeVisible = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleExceed(files, fileList) { |
|
|
|
handleExceed (files, fileList) { |
|
|
|
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); |
|
|
|
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleExceedAnnex(files, fileList) { |
|
|
|
uploadSuccess (res) { |
|
|
|
util.warningMsg(`当前限制选择 5 个文件,如需更换,请删除一个文件再重新选择!`); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
uploadSuccess(res) { |
|
|
|
|
|
|
|
const { coverUrl } = this.form |
|
|
|
const { coverUrl } = this.form |
|
|
|
coverUrl && this.$del(`${this.api.fileDeletion}?keys=${coverUrl}`).then(res => {}).catch(res => {}) |
|
|
|
coverUrl && this.$del(`${this.api.fileDeletion}?keys=${coverUrl}`).then(res => { }).catch(res => { }) |
|
|
|
this.form.coverUrl = res.data.filesResult.fileUrl |
|
|
|
this.form.coverUrl = res.data.filesResult.fileUrl |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadLgSuccess(res) { |
|
|
|
uploadLgSuccess (res) { |
|
|
|
const { carouselUrl } = this.form |
|
|
|
const { carouselUrl } = this.form |
|
|
|
carouselUrl && this.$del(`${this.api.fileDeletion}?keys=${carouselUrl}`).then(res => {}).catch(res => {}) |
|
|
|
carouselUrl && this.$del(`${this.api.fileDeletion}?keys=${carouselUrl}`).then(res => { }).catch(res => { }) |
|
|
|
this.form.carouselUrl = res.data.filesResult.fileUrl |
|
|
|
this.form.carouselUrl = res.data.filesResult.fileUrl |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 附件上传成功 |
|
|
|
// 附件上传成功 |
|
|
|
uploadAnnexSuccess(res) { |
|
|
|
uploadAnnexSuccess (file) { |
|
|
|
const file = res.data.filesResult |
|
|
|
|
|
|
|
const { id } = this.form |
|
|
|
const { id } = this.form |
|
|
|
const data = { |
|
|
|
const data = { |
|
|
|
competitionId: id || '', |
|
|
|
competitionId: id || '', |
|
|
|
fileName: this.fileName, |
|
|
|
fileName: file.name, |
|
|
|
filePath: file.fileUrl || file.fileId |
|
|
|
filePath: file.url |
|
|
|
} |
|
|
|
} |
|
|
|
this.form.competitionAnnexList.push(data) |
|
|
|
this.form.competitionAnnexList.push(data) |
|
|
|
// 编辑的时候需要调新增附件接口 |
|
|
|
// 编辑的时候需要调新增附件接口 |
|
|
|
id && this.$post(this.api.saveComAnnex, data).then(res => {}).catch(res => {}) |
|
|
|
id && this.$post(this.api.saveComAnnex, data).then(res => { }).catch(res => { }) |
|
|
|
}, |
|
|
|
|
|
|
|
// 附件上传前 |
|
|
|
|
|
|
|
beforeUpload(file) { |
|
|
|
|
|
|
|
const isLt2M = file.size / 1024 / 1024 < 10 |
|
|
|
|
|
|
|
if (!isLt2M) util.warningMsg('请上传小于10MB的附件!') |
|
|
|
|
|
|
|
if (isLt2M) { |
|
|
|
|
|
|
|
this.fileName = file.name |
|
|
|
|
|
|
|
return true |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadError(err, file, fileList) { |
|
|
|
uploadError (err, file, fileList) { |
|
|
|
this.$message({ |
|
|
|
this.$message({ |
|
|
|
message: "上传出错,请重试!", |
|
|
|
message: "上传出错,请重试!", |
|
|
|
type: "error", |
|
|
|
type: "error", |
|
|
|
center: true |
|
|
|
center: true |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeRemove(file, fileList) { |
|
|
|
beforeRemove (file, fileList) { |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleRemove(file, fileList) { |
|
|
|
handleRemove (file, fileList) { |
|
|
|
this.$del(`${this.api.fileDeletion}?keys=${this.form.coverUrl}`).then(res => { |
|
|
|
this.$del(`${this.api.fileDeletion}?keys=${this.form.coverUrl}`).then(res => { |
|
|
|
this.form.coverUrl = '' |
|
|
|
this.form.coverUrl = '' |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleLgRemove(file, fileList) { |
|
|
|
handleLgRemove (file, fileList) { |
|
|
|
this.$del(`${this.api.fileDeletion}?keys=${this.form.carouselUrl}`).then(res => { |
|
|
|
this.$del(`${this.api.fileDeletion}?keys=${this.form.carouselUrl}`).then(res => { |
|
|
|
this.form.carouselUrl = '' |
|
|
|
this.form.carouselUrl = '' |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleAnnexRemove(file, fileList) { |
|
|
|
handleAnnexRemove (file, fileList) { |
|
|
|
const { url, name } = file |
|
|
|
const { id } = file |
|
|
|
url && this.$del(`${this.api.fileDeletion}?keys=${url}`).then(res => {}).catch(res => {}) |
|
|
|
id && this.$post(`${this.api.delComAnnex}?id=${id}`).then(res => { }).catch(res => { }) |
|
|
|
const id = this.form.competitionAnnexList.find(e => e.fileName === name).id |
|
|
|
|
|
|
|
id && this.$post(`${this.api.delComAnnex}?id=${id}`).then(res => {}).catch(res => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 随机邀请码 |
|
|
|
// 随机邀请码 |
|
|
|
randomInv() { |
|
|
|
randomInv () { |
|
|
|
let result = '' |
|
|
|
let result = '' |
|
|
|
for (let i = 0; i < 4; i++) { |
|
|
|
for (let i = 0; i < 4; i++) { |
|
|
|
result += Math.floor(Math.random() * 10); |
|
|
|
result += Math.floor(Math.random() * 10); |
|
|
@ -590,7 +648,7 @@ export default { |
|
|
|
* next 0:返回,1:不做任何操作,2:下一步 |
|
|
|
* next 0:返回,1:不做任何操作,2:下一步 |
|
|
|
* releaseType 发布类型(0发布信息,1完整比赛) |
|
|
|
* releaseType 发布类型(0发布信息,1完整比赛) |
|
|
|
* */ |
|
|
|
* */ |
|
|
|
save(status, next = 0, releaseType = 0) { |
|
|
|
save (status, next = 0, releaseType = 0) { |
|
|
|
const { form } = this |
|
|
|
const { form } = this |
|
|
|
form.sponsor = this.sponsorList.filter(d => d).join(); |
|
|
|
form.sponsor = this.sponsorList.filter(d => d).join(); |
|
|
|
form.undertaker = this.undertakerList.filter(d => d).join(); |
|
|
|
form.undertaker = this.undertakerList.filter(d => d).join(); |
|
|
@ -648,20 +706,20 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 预览 |
|
|
|
// 预览 |
|
|
|
preview() { |
|
|
|
preview () { |
|
|
|
util.local.set('match', this.form) |
|
|
|
util.local.set('match', this.form) |
|
|
|
window.open(this.$router.resolve('/matchPreview').href) |
|
|
|
window.open(this.$router.resolve('/matchPreview').href) |
|
|
|
}, |
|
|
|
}, |
|
|
|
addSponsor() { |
|
|
|
addSponsor () { |
|
|
|
this.sponsorList.push(""); |
|
|
|
this.sponsorList.push(""); |
|
|
|
}, |
|
|
|
}, |
|
|
|
delSponsor(index) { |
|
|
|
delSponsor (index) { |
|
|
|
this.sponsorList.splice(index, 1); |
|
|
|
this.sponsorList.splice(index, 1); |
|
|
|
}, |
|
|
|
}, |
|
|
|
addOrganizer() { |
|
|
|
addOrganizer () { |
|
|
|
this.undertakerList.push(""); |
|
|
|
this.undertakerList.push(""); |
|
|
|
}, |
|
|
|
}, |
|
|
|
delOrganizer(index) { |
|
|
|
delOrganizer (index) { |
|
|
|
this.undertakerList.splice(index, 1); |
|
|
|
this.undertakerList.splice(index, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -751,7 +809,8 @@ $upload-lg-height: 150px; |
|
|
|
/deep/ .d-inline-block { |
|
|
|
/deep/ .d-inline-block { |
|
|
|
width: 216px; |
|
|
|
width: 216px; |
|
|
|
|
|
|
|
|
|
|
|
.el-select, .el-input { |
|
|
|
.el-select, |
|
|
|
|
|
|
|
.el-input { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -770,7 +829,7 @@ $upload-lg-height: 150px; |
|
|
|
.remove { |
|
|
|
.remove { |
|
|
|
width: 16px; |
|
|
|
width: 16px; |
|
|
|
height: 16px; |
|
|
|
height: 16px; |
|
|
|
background: url("../../../assets/img/close.png") 0 0/cover no-repeat; |
|
|
|
background: url('../../../assets/img/close.png') 0 0 / cover no-repeat; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|