|
|
|
@ -37,41 +37,44 @@ |
|
|
|
|
<el-input placeholder="请输入竞赛名称" v-model="form.name" clearable></el-input> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<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" type="button" :disabled="!editing && form.id !== ''" |
|
|
|
|
@click="addSponsor"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
<span>添加</span> |
|
|
|
|
</button> |
|
|
|
|
|
|
|
|
|
<template v-if="!isPractice"> |
|
|
|
|
<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" type="button" :disabled="!editing && form.id !== ''" |
|
|
|
|
@click="addSponsor"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
<span>添加</span> |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="承办方(选填)"> |
|
|
|
|
<div class="inline-input"> |
|
|
|
|
<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" type="button" :disabled="!editing && form.id !== ''" |
|
|
|
|
@click="addOrganizer"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
<span>添加</span> |
|
|
|
|
</button> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="承办方(选填)"> |
|
|
|
|
<div class="inline-input"> |
|
|
|
|
<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" type="button" :disabled="!editing && form.id !== ''" |
|
|
|
|
@click="addOrganizer"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
<span>添加</span> |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<button v-if="!undertakerList.length" class="add-btn" type="button" @click="addOrganizer"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
<span>添加</span> |
|
|
|
|
</button> |
|
|
|
|
</el-form-item> |
|
|
|
|
<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> |
|
|
|
|
<button v-if="!undertakerList.length" class="add-btn" type="button" @click="addOrganizer"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
<span>添加</span> |
|
|
|
|
</button> |
|
|
|
|
</el-form-item> |
|
|
|
|
<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> |
|
|
|
|
</template> |
|
|
|
|
<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="结束日期" |
|
|
|
@ -92,42 +95,44 @@ |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<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 class="req" v-if="!form.completeCompetitionSetup.competitionType" label="报名人数上限"> |
|
|
|
|
<div class="input-center"> |
|
|
|
|
<el-input placeholder="请输入人数" v-model.number="form.completeCompetitionSetup.quantityLimit" |
|
|
|
|
type="number"></el-input> |
|
|
|
|
人 |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<template v-if="form.completeCompetitionSetup.competitionType"> |
|
|
|
|
<el-form-item class="req" label="报名团队数上限"> |
|
|
|
|
<template v-if="!isPractice"> |
|
|
|
|
<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 class="req" v-if="!form.completeCompetitionSetup.competitionType" label="报名人数上限"> |
|
|
|
|
<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> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item class="req" label="团队人数"> |
|
|
|
|
<div class="input-center" 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> 人/队 |
|
|
|
|
<template v-if="form.completeCompetitionSetup.competitionType"> |
|
|
|
|
<el-form-item class="req" label="报名团队数上限"> |
|
|
|
|
<div class="input-center"> |
|
|
|
|
<el-input placeholder="请输入团队数" v-model.number="form.completeCompetitionSetup.quantityLimit" |
|
|
|
|
type="number"></el-input> 队 |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item class="req" label="团队人数"> |
|
|
|
|
<div class="input-center" 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> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
<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> |
|
|
|
|
<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> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
<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> |
|
|
|
|
<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> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item class="req" label="竞赛详情"> |
|
|
|
|
<quill v-if="quillShow" :border="true" v-model="form.description" :height="400" |
|
|
|
|
:readonly="!editing && form.id !== ''" /> |
|
|
|
@ -136,6 +141,56 @@ |
|
|
|
|
<Upload :limit="5" :file-list.sync="fileList" :on-remove="handleAnnexRemove" |
|
|
|
|
@onSuccess="uploadAnnexSuccess" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<template v-if="isPractice"> |
|
|
|
|
<el-form-item label="比赛方式"> |
|
|
|
|
<el-radio-group v-model="form.type"> |
|
|
|
|
<el-radio :label="0">实训</el-radio> |
|
|
|
|
<el-radio :label="1">理论</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="比赛内容"> |
|
|
|
|
<el-button style="margin-bottom: 10px;" size="small" type="primary">选择理论试卷</el-button> |
|
|
|
|
<el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="id"> |
|
|
|
|
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="name" label="试卷名称" align="center" min-width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="questionCount" label="试题总数" align="center" width="70"></el-table-column> |
|
|
|
|
<el-table-column prop="score" label="总分" align="center" width="60"></el-table-column> |
|
|
|
|
<el-table-column prop="questionType" label="题型" align="center" min-width="90" |
|
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
|
<el-table-column prop="difficult" label="试卷难度" align="center" width="100" sortable="custom"> |
|
|
|
|
<!-- <template slot-scope="scope">{{ difficults.find(e => e.id === scope.row.difficult) ? difficults.find(e |
|
|
|
|
=> |
|
|
|
|
e.id === scope.row.difficult).name : '' }}</template> --> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="suggestTime" label="建议用时" align="center" width="70"> |
|
|
|
|
<template slot-scope="scope">{{ scope.row.suggestTime }}min</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="classificationPath" label="试卷分类" align="center" width="90" |
|
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
|
<el-table-column label="建议用途" align="center" width="70"> |
|
|
|
|
<!-- <template slot-scope="scope">{{ paperTypes.find(e => e.id === scope.row.paperType) ? paperTypes.find(e |
|
|
|
|
=> |
|
|
|
|
e.id === scope.row.paperType).name : '' }}</template> --> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="updateTime" label="最近编辑时间" align="center" width="160" |
|
|
|
|
sortable="custom"></el-table-column> |
|
|
|
|
<el-table-column prop="createUser" label="最近编辑人" align="center" width="90"></el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" width="240"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="text" @click="toDetail(scope.row, 1)">复制</el-button> |
|
|
|
|
<!-- <el-button type="text" @click="edit(scope.row)">预览</el-button> --> |
|
|
|
|
<el-button type="text" @click="toDetail(scope.row)">编辑</el-button> |
|
|
|
|
<el-button type="text" @click="del(scope.row)">删除</el-button> |
|
|
|
|
<el-switch v-if="!scope.row.status" v-model="scope.row.isDisable" :active-value="false" |
|
|
|
|
:inactive-value="true" style="margin: 0 10px 0 5px" :active-text="scope.row.isDisable ? '关' : '开'" |
|
|
|
|
@change="switchOff($event, scope.row, scope.$index)"></el-switch> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -293,6 +348,11 @@ export default { |
|
|
|
|
quill, |
|
|
|
|
Upload |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
isPractice () { |
|
|
|
|
return this.$parent.releaseType === 2 |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
editing: function (val) { |
|
|
|
|
this.quillShow = false |
|
|
|
|