parent
7bc3f3313c
commit
7f861789d1
26 changed files with 4491 additions and 1004 deletions
@ -0,0 +1,48 @@ |
||||
/** |
||||
* 大赛配置 |
||||
* */ |
||||
|
||||
export default { |
||||
rules: [ |
||||
{ |
||||
id: 0, |
||||
name: '积分赛' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '淘汰赛' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '单项赛' |
||||
} |
||||
], |
||||
methods: [ |
||||
{ |
||||
id: 0, |
||||
name: '实操' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '理论' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '线下' |
||||
} |
||||
], |
||||
teamCalculationMethods: [ |
||||
{ |
||||
id: 0, |
||||
name: '最高分' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '平均分' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '总分' |
||||
} |
||||
], |
||||
} |
@ -0,0 +1,228 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<div> |
||||
<p class="m-b-20">比赛名称</p> |
||||
{{ form.stageName }} |
||||
</div> |
||||
</el-card> |
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<div> |
||||
<p class="m-b-20">比赛时间</p> |
||||
<div class="date-inputs"> |
||||
起止时间: |
||||
<div style="display: inline-flex;align-items: center;"> |
||||
<el-date-picker |
||||
v-model="form.time" |
||||
type="datetimerange" |
||||
range-separator="~" |
||||
start-placeholder="开始日期" |
||||
end-placeholder="结束日期" |
||||
format="yyyy-MM-dd HH:mm:ss" |
||||
value-format="yyyy-MM-dd HH:mm:ss" |
||||
@change="timeChange"> |
||||
</el-date-picker> |
||||
<el-alert |
||||
style="width: auto;padding: 4px 16px;margin-left: 10px;" |
||||
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'" |
||||
type="error" |
||||
:closable="false" |
||||
effect="dark"> |
||||
</el-alert> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
<el-card shadow="hover" class="mgr20 m-b-20"> |
||||
<div> |
||||
<p class="m-b-20">课程</p> |
||||
<div class="inline-input"> |
||||
<el-select v-model="form.cid" @change="courseChange"> |
||||
<el-option |
||||
v-for="item in curriculumList" |
||||
:key="item.cid" |
||||
:label="item.curriculumName" |
||||
:value="item.cid"> |
||||
</el-option> |
||||
</el-select> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<div class="flex-between m-b-20"> |
||||
<span>实训项目</span> |
||||
<div style="display: inline-flex;"> |
||||
<div> |
||||
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input> |
||||
</div> |
||||
<el-button style="margin-left: 5px" type="primary" round>自定义实验项目</el-button> |
||||
</div> |
||||
</div> |
||||
<!-- 实训项目表格 --> |
||||
<el-table :data="projects" class="table" stripe header-align="center"> |
||||
<el-table-column width="60" label="选择" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-radio v-model="form.projectId" :label="scope.row.projectId"> </el-radio> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> |
||||
<el-table-column prop="auth" label="项目权限" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ permissionsKeys[scope.row.permissions] }} |
||||
</template> |
||||
</el-table-column> |
||||
<!-- <el-table-column prop="createUser" label="创建人" align="center"></el-table-column> --> |
||||
<el-table-column prop="founder" label="创建人" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.createUser }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column> |
||||
<!-- <el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="showProject(scope.row)">查看</el-button> |
||||
</template> |
||||
</el-table-column> --> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination |
||||
background |
||||
:page-size="pageSize" |
||||
@current-change="handleCurrentChange" |
||||
layout="total,prev, pager, next" |
||||
:total="total" |
||||
></el-pagination> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<div style="text-align: center"> |
||||
<el-button @click="back">返回</el-button> |
||||
<el-button type="primary" @click="save">保存</el-button> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
export default { |
||||
props: ['form', 'step1'], |
||||
data() { |
||||
return { |
||||
curriculumList: [], |
||||
keyword: '', |
||||
projects: [], |
||||
page: 1, |
||||
pageSize: 5, |
||||
total: 0, |
||||
sysId: '', |
||||
permissionsKeys: ['练习', '考核', '竞赛'], |
||||
timeInvalid: false |
||||
}; |
||||
}, |
||||
watch: { |
||||
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
||||
form: { |
||||
handler(){ |
||||
this.updateTime++ |
||||
}, |
||||
deep:true |
||||
}, |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer); |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData(); |
||||
}, 500); |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getCourse() |
||||
}, |
||||
methods: { |
||||
// 获取课程 |
||||
getCourse() { |
||||
this.$get(this.api.curriculumList).then(({ data }) => { |
||||
const list = data |
||||
this.curriculumList = data |
||||
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.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(); |
||||
}, |
||||
// 时间选择回调 |
||||
timeChange(val) { |
||||
if (val.length) { |
||||
const startTime = new Date(val[0]) |
||||
const endTime = new Date(val[1]) |
||||
const { playStartTime, playEndTime } = this.step1 |
||||
if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) { |
||||
this.timeInvalid = true |
||||
return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') |
||||
} |
||||
this.timeInvalid = false |
||||
const { form, curStep } = this.$parent |
||||
for (const i in form) { |
||||
// 判断其他阶段的时间跟当前选的时间是否重叠 |
||||
if (i !== curStep) { |
||||
const time1 = new Date(form[i].startTime) |
||||
const time2 = new Date(form[i].endTime) |
||||
if ((startTime >= time1 && startTime <= time2) || (endTime >= time1 && endTime <= time2)) { |
||||
util.warningMsg('请注意,所设置的时间与已设置的阶段时间重合。') |
||||
break |
||||
} |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
// 提交 |
||||
save() { |
||||
const { form } = this |
||||
if (!form.time.length) return util.warningMsg('请选择比赛时间') |
||||
if (this.timeInvalid) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') |
||||
if (!form.cid) return util.warningMsg('请选择课程') |
||||
if (!form.projectId) return util.warningMsg('请选择项目') |
||||
const { systemId, projectName } = this.projects.find(e => e.projectId == form.projectId) |
||||
form.systemId = systemId |
||||
form.projectName = projectName |
||||
form.startTime = form.time[0] |
||||
form.endTime = form.time[1] |
||||
this.$emit('hideSet', this.form) |
||||
}, |
||||
// 返回 |
||||
back() { |
||||
this.$emit('hideSet') |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
@ -0,0 +1,824 @@ |
||||
<template> |
||||
<div> |
||||
<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-item label="竞赛封面(选填)"> |
||||
<el-upload |
||||
class="avatar-uploader" |
||||
accept=".jpg,.png,.jpeg,.gif" |
||||
:on-remove="handleRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.fileupload" |
||||
:headers="headers" |
||||
name="file" |
||||
> |
||||
<img v-if="form.coverUrl" :src="form.coverUrl" class="avatar"> |
||||
<div class="uploader-default" v-else> |
||||
<i class="el-icon-plus"></i> |
||||
<p>上传封面</p> |
||||
</div> |
||||
<div slot="tip" class="el-upload__tip"> |
||||
<p>展示宽度为220,高度140,JPG/PNG/GIF,3MB以内</p> |
||||
</div> |
||||
</el-upload> |
||||
</el-form-item> |
||||
<el-form-item label="竞赛封面长图(选填)"> |
||||
<el-upload |
||||
class="avatar-uploader avatar-uploader-lg" |
||||
accept=".jpg,.png,.jpeg,.gif" |
||||
:on-remove="handleLgRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadLgSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" :on-exceed="handleExceed" |
||||
:action="this.api.fileupload" |
||||
:headers="headers" |
||||
name="file" |
||||
> |
||||
<img v-if="form.carouselUrl" :src="form.carouselUrl" class="avatar-lg"> |
||||
<div class="uploader-default" v-else> |
||||
<i class="el-icon-plus"></i> |
||||
<p>上传封面</p> |
||||
</div> |
||||
<div slot="tip" class="el-upload__tip"> |
||||
<p>展示宽度为1920,高度300,JPG/PNG/GIF,3MB以内</p> |
||||
</div> |
||||
</el-upload> |
||||
</el-form-item> |
||||
<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 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> |
||||
</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> |
||||
<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> |
||||
<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 class="req" label="比赛范围"> |
||||
<div> |
||||
<el-radio v-model="form.competitionScope" :label="0">本校内</el-radio> |
||||
</div> |
||||
<div> |
||||
<el-radio v-model="form.competitionScope" :label="1">全平台</el-radio> |
||||
</div> |
||||
<div> |
||||
<el-radio v-model="form.competitionScope" :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> |
||||
</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="报名团队数上限"> |
||||
<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> |
||||
<el-form-item class="req" label="竞赛详情"> |
||||
<quill :border="true" v-model="form.description" :height="400" /> |
||||
</el-form-item> |
||||
<el-form-item label="附件"> |
||||
<el-upload |
||||
:on-remove="handleAnnexRemove" |
||||
:on-error="uploadError" |
||||
: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> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-dialog title="请勾选院校" :visible.sync="rangeVisible" width="580px" custom-class="range-dia" :close-on-click-modal="false"> |
||||
<div class="range-wrap"> |
||||
<el-cascader |
||||
ref="range" |
||||
class="range-cas" |
||||
key="range" |
||||
v-model="range" |
||||
:props="props" |
||||
:show-all-levels="false" |
||||
clearable |
||||
filterable |
||||
:before-filter="beforeFilter" |
||||
:options="rangeList" |
||||
@change="rangeChange" |
||||
@visible-change="rangeViChange" |
||||
@input.native="rangeSearch"></el-cascader> |
||||
<el-tag |
||||
v-for="(tag, i) in rangeChecked" |
||||
:key="tag.value" |
||||
class="range-check" |
||||
closable |
||||
:disable-transitions="false" |
||||
@close="val => closeRange(i)"> |
||||
{{tag.label}} |
||||
</el-tag> |
||||
</div> |
||||
|
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button size="small" @click="rangeVisible = false">取 消</el-button> |
||||
<el-button size="small" type="primary" @click="rangeSubmit">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
import quill from "@/components/quill"; |
||||
import Setting from "@/setting"; |
||||
export default { |
||||
props: ['editing'], |
||||
data() { |
||||
const that = this |
||||
return { |
||||
headers: { |
||||
token: util.local.get(Setting.tokenKey) |
||||
}, |
||||
form: { |
||||
id: this.$route.query.id || '', |
||||
platformSource: 1, // 平台来源(0:中台,1:职站) |
||||
isOpen: 0, // 职站是否开启(0开启 1未开启 默认0) |
||||
name: '', |
||||
sponsor: '', |
||||
undertaker: '', |
||||
competitionScope: 0, // 大赛范围(0:本校内 1:全平台 2:指定区域、院校) |
||||
competitionRangeList: [], // 大赛范围选择 |
||||
competitionAnnexList: [], // 赛事附件 |
||||
coverUrl: '', |
||||
carouselUrl: '', |
||||
publishStatus: 0, |
||||
signUpStartTime: '', |
||||
signUpEndTime: '', |
||||
playStartTime: '', |
||||
playEndTime: '', |
||||
description: '', |
||||
releaseType: 0, |
||||
completeCompetitionSetup: { |
||||
competitionType: 0, |
||||
invitationCode: '', |
||||
isNeedCode: 0, |
||||
maxTeamSize: '', |
||||
minTeamSize: '', |
||||
quantityLimit: '', |
||||
} |
||||
}, |
||||
fileName: '', |
||||
signupTime: [], |
||||
playTime: [], |
||||
sponsorList: [""], |
||||
undertakerList: [""], |
||||
fileList: [], |
||||
pickerOptions: { |
||||
disabledDate: time => { |
||||
return time.getTime() < new Date().getTime() - 86400000; |
||||
} |
||||
}, |
||||
rangeVisible: false, |
||||
range: [], |
||||
rangeInit: [], |
||||
rangeName: '', |
||||
rangeChecked: [], |
||||
schools: [], |
||||
rangeList: [], |
||||
rangeTimer: null, |
||||
// 选择区域懒加载 |
||||
props: { |
||||
multiple: true, |
||||
checkStrictly: true, |
||||
lazy: true, |
||||
lazyLoad (node, resolve) { |
||||
// 如果是在模糊搜索中,则不再用懒加载请求数据 |
||||
const input = document.querySelector('.el-cascader__search-input') |
||||
const checked = that.rangeChecked |
||||
|
||||
if (input && input.value.trim()) { |
||||
const val = input.value.trim() |
||||
return that.schools.filter(e => e.label.includes(val)) |
||||
} |
||||
|
||||
const { level, value } = node |
||||
// 省份 |
||||
if (!level) { |
||||
that.$get(that.api.queryProvince).then(({ list }) => { |
||||
const data = [] |
||||
list.map(e => { |
||||
e.value = e.provinceId |
||||
e.label = e.provinceName |
||||
e.children = [] |
||||
e.disabled = !!checked.find(n => n.provinceId == e.provinceId && !n.cityId) |
||||
data.push(e) |
||||
}) |
||||
resolve(data) |
||||
}).catch(res => {}) |
||||
} else if (level === 1) { |
||||
// 城市 |
||||
that.$get(that.api.queryCity, { |
||||
provinceId: value |
||||
}).then(({ list }) => { |
||||
const data = [] |
||||
list.map(e => { |
||||
e.value = e.cityId |
||||
e.label = e.cityName |
||||
e.children = [] |
||||
e.disabled = !!checked.find(n => n.cityId == e.cityId && n.provinceId == e.provinceId && !n.schoolId) |
||||
data.push(e) |
||||
}) |
||||
resolve(data) |
||||
}).catch(res => {}) |
||||
} else if (level === 2) { |
||||
// 学校 |
||||
that.$get(that.api.getSchoolsByProvince, { |
||||
provinceId: node.data.provinceId, |
||||
cityId: value, |
||||
schoolName: '' |
||||
}).then(({ list }) => { |
||||
const data = [] |
||||
list.map(e => { |
||||
e.value = e.schoolId |
||||
e.label = e.schoolName |
||||
e.leaf = true |
||||
e.disabled = !!checked.find(n => n.schoolId == e.schoolId && n.cityId == e.cityId && n.provinceId == e.provinceId) |
||||
data.push(e) |
||||
}) |
||||
resolve(data) |
||||
}).catch(res => {}) |
||||
} else { |
||||
resolve([]) |
||||
} |
||||
} |
||||
}, |
||||
submiting: false, |
||||
updateTime: 0, |
||||
}; |
||||
}, |
||||
components: { |
||||
quill |
||||
}, |
||||
watch: { |
||||
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
||||
form: { |
||||
handler(){ |
||||
this.updateTime++ |
||||
}, |
||||
deep:true |
||||
}, |
||||
signupTime: function(val) { |
||||
const { form } = this |
||||
if (val) { |
||||
form.signUpStartTime = val[0]; |
||||
form.signUpEndTime = val[1]; |
||||
} else { |
||||
form.signUpStartTime = '' |
||||
form.signUpEndTime = '' |
||||
} |
||||
}, |
||||
playTime: function(val) { |
||||
const { form } = this |
||||
if (val) { |
||||
form.playStartTime = val[0] |
||||
form.playEndTime = val[1] |
||||
} else { |
||||
form.playStartTime = '' |
||||
form.playEndTime = '' |
||||
} |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
this.getSchool() |
||||
}, |
||||
methods: { |
||||
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] |
||||
if (competition.playStartTime) this.playTime = [competition.playStartTime, competition.playEndTime] |
||||
this.sponsorList = competition.sponsor.split(",") |
||||
this.undertakerList = competition.undertaker.split(",") |
||||
// 附件 |
||||
const fileList = competition.competitionAnnexList |
||||
if (fileList) { |
||||
const files = [] |
||||
fileList.map(e => { |
||||
files.push({ |
||||
name: e.fileName, |
||||
url: e.filePath |
||||
}) |
||||
}) |
||||
this.fileList = files |
||||
} else { |
||||
competition.competitionAnnexList = [] |
||||
} |
||||
|
||||
// 选择范围 |
||||
const ranges = competition.competitionRangeList |
||||
if (ranges) { |
||||
const range = [] |
||||
ranges.map(e => { |
||||
const item = [+e.provinceId] |
||||
e.cityId && item.push(+e.cityId) |
||||
e.schoolId && item.push(+e.schoolId) |
||||
range.push(item) |
||||
}) |
||||
this.range = range |
||||
} |
||||
|
||||
// 选择范围name |
||||
const rangeName = competition.competitionRangeRespList |
||||
if (rangeName) { |
||||
const range = [] |
||||
rangeName.map(e => { |
||||
range.push(e.type ? (e.cityName || e.provinceName) : e.schoolName) |
||||
}) |
||||
this.rangeName = range.join(',') |
||||
} |
||||
this.form = competition |
||||
this.$nextTick(() => { |
||||
this.updateTime = 0 |
||||
}) |
||||
}).catch(err => {}) |
||||
}, |
||||
// 选择范围 |
||||
showRange() { |
||||
this.rangeVisible = true |
||||
}, |
||||
// 范围勾选回调 |
||||
rangeChange(val, e) { |
||||
const checked = this.$refs.range.getCheckedNodes() |
||||
const name = [] |
||||
const { rangeChecked } = this |
||||
checked.map(e => { |
||||
rangeChecked.find(n => n.value === e.value && n.label == e.label) || name.push(e.data) // 未勾选的,则push |
||||
}) |
||||
this.rangeChecked.push(...name) |
||||
}, |
||||
// 范围展开收缩回调 |
||||
rangeViChange(e) { |
||||
// 展开的时候清空搜索结果 |
||||
if (e) { |
||||
this.rangeList = [] |
||||
} |
||||
}, |
||||
// 获取学校列表 |
||||
getSchool() { |
||||
this.$get(this.api.querySchoolData).then(({ list }) => { |
||||
const result = [] |
||||
list.map(e => { |
||||
e.value = e.schoolId |
||||
e.label = e.schoolName |
||||
e.leaf = true |
||||
result.push(e) |
||||
}) |
||||
this.schools = result |
||||
}).catch(res => {}) |
||||
}, |
||||
// 范围模糊查询前置钩子 |
||||
beforeFilter() { |
||||
return false |
||||
}, |
||||
// 范围筛选 |
||||
rangeSearch(el) { |
||||
const val = el.target.value.trim() |
||||
const checked = this.rangeChecked |
||||
if (!val) { |
||||
this.rangeList = [] |
||||
return false |
||||
} |
||||
clearTimeout(this.rangeTimer) |
||||
this.rangeTimer = setTimeout(() => { |
||||
let result = this.schools.filter(e => { |
||||
if (e.label.includes(val)) { |
||||
e.disabled = !!checked.find(n => n.schoolId == e.schoolId) |
||||
return e |
||||
} |
||||
}) // 用学校列表做比对 |
||||
this.rangeList = result |
||||
}, 100) |
||||
}, |
||||
closeRange(i) { |
||||
this.rangeChecked.splice(i, 1) |
||||
}, |
||||
// 范围确定 |
||||
rangeSubmit() { |
||||
// 处理提交需要的id |
||||
const data = [] |
||||
const checked = this.rangeChecked |
||||
checked.map(e => { |
||||
data.push({ |
||||
provinceId: e.provinceId || '', |
||||
cityId: e.cityId || '', |
||||
schoolId: e.schoolId || '', |
||||
type: e.schoolId ? 0 : 1 |
||||
}) |
||||
}) |
||||
this.form.competitionRangeList = data |
||||
|
||||
// 处理显示的name |
||||
const name = [] |
||||
checked.map(e => { |
||||
name.push(e.label) |
||||
}) |
||||
this.rangeName = name.join('、') |
||||
|
||||
this.rangeVisible = false |
||||
}, |
||||
handleExceed(files, fileList) { |
||||
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); |
||||
}, |
||||
handleExceedAnnex(files, fileList) { |
||||
util.warningMsg(`当前限制选择 5 个文件,如需更换,请删除一个文件再重新选择!`); |
||||
}, |
||||
uploadSuccess(res) { |
||||
const { coverUrl } = this.form |
||||
coverUrl && this.$del(`${this.api.fileDeletion}?keys=${coverUrl}`).then(res => {}).catch(res => {}) |
||||
this.form.coverUrl = res.data.filesResult.fileUrl |
||||
}, |
||||
uploadLgSuccess(res) { |
||||
const { carouselUrl } = this.form |
||||
carouselUrl && this.$del(`${this.api.fileDeletion}?keys=${carouselUrl}`).then(res => {}).catch(res => {}) |
||||
this.form.carouselUrl = res.data.filesResult.fileUrl |
||||
}, |
||||
// 附件上传成功 |
||||
uploadAnnexSuccess(res) { |
||||
const file = res.data.filesResult |
||||
const { id } = this.form |
||||
const data = { |
||||
contestId: 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 => {}) |
||||
}, |
||||
// 附件上传前 |
||||
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) { |
||||
this.$message({ |
||||
message: "上传出错,请重试!", |
||||
type: "error", |
||||
center: true |
||||
}) |
||||
}, |
||||
beforeRemove(file, fileList) { |
||||
return this.$confirm(`确定移除 ${file.name}?`); |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
this.$del(`${this.api.fileDeletion}?keys=${this.form.coverUrl}`).then(res => { |
||||
this.form.coverUrl = '' |
||||
}).catch(res => {}) |
||||
}, |
||||
handleLgRemove(file, fileList) { |
||||
this.$del(`${this.api.fileDeletion}?keys=${this.form.carouselUrl}`).then(res => { |
||||
this.form.carouselUrl = '' |
||||
}).catch(res => {}) |
||||
}, |
||||
handleAnnexRemove(file, fileList) { |
||||
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 => {}) |
||||
}, |
||||
// 随机邀请码 |
||||
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发布 |
||||
* next 0:返回,1:不做任何操作,2:下一步 |
||||
* releaseType 发布类型(0发布信息,1完整比赛) |
||||
* */ |
||||
save(status, next = 0, releaseType = 0) { |
||||
const { form } = this |
||||
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 (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(); |
||||
let playStartTime = new Date(form.playStartTime).getTime(); |
||||
// if (signUpStartTime && now > signUpStartTime) return util.warningMsg("报名时间不能早于当前时间"); |
||||
if (!form.playStartTime) return util.warningMsg("请选择竞赛时间"); |
||||
if (playStartTime && signUpEndTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间"); |
||||
const { competitionType, quantityLimit, minTeamSize, maxTeamSize, isNeedCode, invitationCode } = form.completeCompetitionSetup |
||||
// 团队 |
||||
if (competitionType) { |
||||
if (quantityLimit === '') return util.warningMsg('请填写报名团队数上限') |
||||
if (quantityLimit < 0) return util.warningMsg('报名团队数上限不得小于0') |
||||
if (minTeamSize === '') return util.warningMsg('请填写团队人数下限') |
||||
if (minTeamSize < 2) return util.warningMsg('团队人数下限不得小于2') |
||||
if (maxTeamSize === '') return util.warningMsg('请填写团队人数上限') |
||||
if (minTeamSize > maxTeamSize) return util.warningMsg('团队人数上限不得小于下限') |
||||
} else { // 个人 |
||||
if (quantityLimit === '') return util.warningMsg('请填写报名人数上限') |
||||
if (quantityLimit < 0) return util.warningMsg('报名人数上限不得小于0') |
||||
} |
||||
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.$parent.hideLoad() |
||||
util.successMsg("修改成功"); |
||||
this.$emit('next', next) |
||||
}).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 => { |
||||
this.$parent.hideLoad() |
||||
}); |
||||
} |
||||
}, |
||||
// 预览 |
||||
preview() { |
||||
util.local.set('match', this.form) |
||||
window.open(this.$router.resolve('/matchPreview').href) |
||||
}, |
||||
addSponsor() { |
||||
this.sponsorList.push(""); |
||||
}, |
||||
delSponsor(index) { |
||||
this.sponsorList.splice(index, 1); |
||||
}, |
||||
addOrganizer() { |
||||
this.undertakerList.push(""); |
||||
}, |
||||
delOrganizer(index) { |
||||
this.undertakerList.splice(index, 1); |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
$upload-width: 220px; |
||||
$upload-height: 140px; |
||||
$upload-lg-height: 150px; |
||||
/deep/ .avatar-uploader { |
||||
.el-upload { |
||||
position: relative; |
||||
width: $upload-width; |
||||
height: $upload-height; |
||||
border: 1px dashed #d9d9d9; |
||||
border-radius: 6px; |
||||
cursor: pointer; |
||||
overflow: hidden; |
||||
|
||||
&:hover { |
||||
border-color: #cb221c; |
||||
} |
||||
|
||||
.uploader-default { |
||||
display: flex; |
||||
height: $upload-height; |
||||
flex-direction: column; |
||||
justify-content: center; |
||||
text-align: center; |
||||
background: rgba(0, 0, 0, 0.04); |
||||
|
||||
i { |
||||
font-size: 20px; |
||||
font-weight: bold; |
||||
color: #8c939d; |
||||
} |
||||
|
||||
p { |
||||
margin-top: 10px; |
||||
font-size: 14px; |
||||
color: rgba(0, 0, 0, 0.65); |
||||
line-height: 1; |
||||
} |
||||
} |
||||
} |
||||
|
||||
&.avatar-uploader-lg { |
||||
.el-upload { |
||||
width: 100%; |
||||
max-width: 960px; |
||||
height: $upload-lg-height; |
||||
|
||||
.uploader-default { |
||||
height: $upload-lg-height; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.avatar { |
||||
display: block; |
||||
width: $upload-width; |
||||
height: $upload-height; |
||||
} |
||||
|
||||
.avatar-lg { |
||||
display: block; |
||||
width: 100%; |
||||
height: $upload-lg-height; |
||||
} |
||||
|
||||
.el-upload__tip { |
||||
margin-top: 0; |
||||
|
||||
p { |
||||
font-size: 14px; |
||||
color: rgba(0, 0, 0, 0.45); |
||||
line-height: 1; |
||||
|
||||
&:first-child { |
||||
margin-bottom: 5px; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
/deep/ .d-inline-block { |
||||
width: 216px; |
||||
|
||||
.el-select, .el-input { |
||||
width: 100%; |
||||
} |
||||
} |
||||
.inline-input { |
||||
.input-wrap { |
||||
display: flex; |
||||
align-items: center; |
||||
margin-bottom: 10px; |
||||
|
||||
.el-input { |
||||
display: inline-block; |
||||
width: 216px; |
||||
margin-right: 8px; |
||||
} |
||||
|
||||
.remove { |
||||
width: 16px; |
||||
height: 16px; |
||||
background: url("../../../assets/img/close.png") 0 0/cover no-repeat; |
||||
cursor: pointer; |
||||
} |
||||
} |
||||
|
||||
.add-btn { |
||||
margin-left: 32px; |
||||
} |
||||
} |
||||
|
||||
.add-btn { |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
width: 216px; |
||||
line-height: 32px; |
||||
font-size: 14px; |
||||
color: rgba(0, 0, 0, 0.65); |
||||
background-color: transparent; |
||||
border: 1px dashed rgba(0, 0, 0, 0.15); |
||||
border-radius: 4px; |
||||
cursor: pointer; |
||||
|
||||
i { |
||||
margin-right: 8px; |
||||
font-size: 14px; |
||||
font-weight: bold; |
||||
} |
||||
} |
||||
.range-check { |
||||
display: inline-block; |
||||
margin: 0 0 10px 10px; |
||||
} |
||||
/deep/.range-cas { |
||||
.el-tag { |
||||
display: none; |
||||
} |
||||
} |
||||
.input-center { |
||||
display: flex; |
||||
align-items: center; |
||||
width: 216px; |
||||
white-space: nowrap; |
||||
.el-input { |
||||
margin-right: 5px; |
||||
} |
||||
} |
||||
.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> |
@ -0,0 +1,427 @@ |
||||
<template> |
||||
<div> |
||||
<div class="page"> |
||||
<div class="page-content"> |
||||
<div class="p-title">赛程与规则设置</div> |
||||
<el-form :model="form" :rules="validRules" label-width="170px" label-suffix=":" size="small" :disabled="!editing && id"> |
||||
<el-form-item label="竞赛类型"> |
||||
{{ step1.completeCompetitionSetup.competitionType ? '团队赛(' + step1.completeCompetitionSetup.minTeamSize + '-' + step1.completeCompetitionSetup.maxTeamSize + '人/队)' : '个人赛' }} <span class="tips">(如需修改,请返回上一步。)</span> |
||||
</el-form-item> |
||||
<el-form-item prop="rule" label="赛制"> |
||||
<el-radio v-for="(rule, i) in rules" :key="i" v-model="form.rule" :label="rule.id">{{ rule.name }}</el-radio> |
||||
<p class="tips">积分赛——包含多个竞赛阶段,每个阶段的成绩都包含在最终总成绩里,最后一轮结束后总成绩排名靠前的参赛者得到获奖资格。</p> |
||||
<p class="tips">淘汰赛——包含多个竞赛阶段,每个阶段结束后之后只有部分参赛者能晋级下一阶段,晋级最后一轮且在最后一轮排名靠前的参赛者得到获奖资格。</p> |
||||
<p class="tips">单项赛——仅包含一个竞赛阶段,单项的成绩排名即为最终排名,排名靠前的参赛者得到获奖资格。</p> |
||||
<p class="tips">注:系统默认排名规则,优先按分数排名(分数高则排名靠前),分数相同则按用时排名(用时短则排名靠前)。</p> |
||||
</el-form-item> |
||||
<template v-if="form.rule !== 2"> |
||||
<el-form-item prop="stageNum" label="阶段数量"> |
||||
<div class="input-center"> |
||||
<el-select v-model="form.stageNum" @change="stageChange"> |
||||
<el-option v-for="i in 10" :key="i" :label="i" :value="i"></el-option> |
||||
</el-select> |
||||
</div> |
||||
<div v-if="step1.completeCompetitionSetup.competitionType" class="tips"> |
||||
(团队赛是否限制队内每个成员只能参加一个阶段赛项? |
||||
<el-radio v-model="form.teamLimit" :label="1">是</el-radio> |
||||
<el-radio v-model="form.teamLimit" :label="0">否</el-radio> |
||||
) |
||||
</div> |
||||
</el-form-item> |
||||
<el-form-item prop="resultCalculationMethod" label="总成绩计算方式"> |
||||
<el-radio v-model="form.resultCalculationMethod" :label="0">各阶段成绩加权求和</el-radio> |
||||
<el-radio v-model="form.resultCalculationMethod" :label="1">各阶段成绩直接求和</el-radio> |
||||
<el-radio v-model="form.resultCalculationMethod" :label="2">各阶段成绩取平均值</el-radio> |
||||
<p class="tips">(若选择加权求和,则需要设置每个阶段成绩所占权重,且权重总和须为100%)</p> |
||||
</el-form-item> |
||||
<el-form-item prop="stageNum" label="阶段设置"> |
||||
<div v-for="(item, i) in form.competitionStageList" :key="i" class="step-set"> |
||||
<div class="line"> |
||||
第{{ serials[i] }}阶段 <el-input v-model="item.stageName" clearable placeholder="请输入阶段名称,如“初赛”" style="width: 200px"></el-input> |
||||
</div> |
||||
<div class="line"> |
||||
<span class="req">*</span> |
||||
比赛方式: |
||||
<el-radio v-for="(method, i) in methods" :key="i" v-model="item.method" :label="method.id">{{ method.name }}</el-radio> |
||||
</div> |
||||
<div v-if="step1.completeCompetitionSetup.competitionType" class="line"> |
||||
<span class="req">*</span> |
||||
团队参赛人数限制: |
||||
<el-radio v-model="item.teamNumLimitOpt" :label="0">不限制</el-radio> |
||||
<el-radio v-model="item.teamNumLimitOpt" :label="1">自定义</el-radio> |
||||
<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"> |
||||
<span class="req">*</span> |
||||
团队成绩计算方式: |
||||
<el-radio v-for="(j, i) in teamCalculationMethods" :key="i" v-model="item.teamCalculationMethod" :label="j.id">{{ j.name }}</el-radio> |
||||
<span class="tips">(可设置本阶段的团队取分规则)</span> |
||||
</div> |
||||
<div v-if="form.rule === 1 && i !== form.competitionStageList.length - 1" class="line" style="display: flex;"> |
||||
<p> |
||||
<span class="req">*</span>晋级规则: |
||||
</p> |
||||
<div> |
||||
<div class="line"> |
||||
本阶段成绩排名前 |
||||
<el-input v-model.number="item.peopleLimit" type="number" style="width: 100px"></el-input> |
||||
队,可晋级下一阶段比赛 |
||||
</div> |
||||
<div class="line"> |
||||
本阶段成绩排名前 |
||||
<el-input v-model.number="item.percentageLimit" type="number" style="width: 100px"></el-input> |
||||
%,可晋级下一阶段比赛 |
||||
</div> |
||||
<div> |
||||
本阶段成绩 |
||||
<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" type="number" style="width: 100px"></el-input> |
||||
分,可晋级下一阶段比赛 |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div v-if="!form.rule" class="line"> |
||||
<span class="req">*</span> |
||||
占总成绩权重: |
||||
<el-input v-model.number="item.pointWeight" type="number" :disabled="form.resultCalculationMethod != 0" style="width: 150px;"></el-input> % |
||||
</div> |
||||
<div class="line"> |
||||
<span class="req">*</span> |
||||
成绩公布时间: |
||||
(阶段)比赛结束后 |
||||
<el-input v-model="item.resultAnnouncementTime" type="number" style="width: 120px"></el-input> |
||||
小时,公布(阶段)比赛成绩。 |
||||
</div> |
||||
<div class="line"> |
||||
<span class="req">*</span> |
||||
是否公布成绩详情: |
||||
<el-radio v-model="item.resultsDetails" :label="0">是</el-radio> |
||||
<el-radio v-model="item.resultsDetails" :label="1">否</el-radio> |
||||
<p class="tips">若选择“是”,则公布成绩详情,竞赛结束后参赛者可查看自己的比赛成绩得分详情;</p> |
||||
<p class="tips">若选择“否”,则不公布成绩详情,参赛者只能知晓自己的分数及排名,不能查看得分详情。</p> |
||||
</div> |
||||
</div> |
||||
</el-form-item> |
||||
</template> |
||||
<template v-else> |
||||
<el-form-item prop="stageNum" label="规则设置"> |
||||
<div class="step-set"> |
||||
<div class="line"> |
||||
<span class="req">*</span> |
||||
比赛方式: |
||||
<el-radio v-for="(method, i) in methods" :key="i" v-model="form.competitionStageList[0].method" :label="method.id">{{ method.name }}</el-radio> |
||||
</div> |
||||
<div v-if="step1.completeCompetitionSetup.competitionType" class="line"> |
||||
<span class="req">*</span> |
||||
团队成绩计算方式: |
||||
<el-radio v-for="(j, i) in teamCalculationMethods" :key="i" v-model="form.competitionStageList[0].teamCalculationMethod" :label="j.id">{{ j.name }}</el-radio> |
||||
<span class="tips">(可设置本阶段的团队取分规则)</span> |
||||
</div> |
||||
</div> |
||||
</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-form-item> |
||||
<el-form-item prop="resultsDetails" label="是否公布成绩详情"> |
||||
<el-radio v-model="form.competitionStageList[0].resultsDetails" :label="0">是</el-radio> |
||||
<el-radio v-model="form.competitionStageList[0].resultsDetails" :label="1">否</el-radio> |
||||
<p class="tips">若选择“是”,则公布成绩详情,竞赛结束后参赛者可查看自己的比赛成绩得分详情;</p> |
||||
<p class="tips">若选择“否”,则不公布成绩详情,参赛者只能知晓自己的分数及排名,不能查看得分详情。</p> |
||||
</el-form-item> |
||||
</template> |
||||
</el-form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
import quill from "@/components/quill"; |
||||
import Const from '@/const/match' |
||||
export default { |
||||
props: ['setupId', 'editing'], |
||||
data() { |
||||
return { |
||||
id: this.$route.query.id, |
||||
updateTime: 0, |
||||
step1: this.$parent.$refs.step1.form, |
||||
serials: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'], |
||||
form: { |
||||
resultCalculationMethod: 0, |
||||
rule: 0, |
||||
stageNum: 3, |
||||
teamLimit: 1, |
||||
competitionStageList: [ |
||||
{ |
||||
method: 0, |
||||
number: 1, |
||||
pointWeight: '', |
||||
stageName: '', |
||||
teamCalculationMethod: 0, |
||||
peopleLimit: '', |
||||
percentageLimit: '', |
||||
scoreLimit: '', |
||||
operator: '>', |
||||
score: '', |
||||
teamNumLimit: '', |
||||
teamNumLimitOpt: 0, |
||||
resultAnnouncementTime: '', |
||||
resultsDetails: 0, |
||||
}, |
||||
{ |
||||
method: 0, |
||||
number: 2, |
||||
pointWeight: '', |
||||
stageName: '', |
||||
teamCalculationMethod: 0, |
||||
peopleLimit: '', |
||||
percentageLimit: '', |
||||
scoreLimit: '', |
||||
operator: '>', |
||||
score: '', |
||||
teamNumLimit: '', |
||||
teamNumLimitOpt: 0, |
||||
resultAnnouncementTime: '', |
||||
resultsDetails: 0, |
||||
}, |
||||
{ |
||||
method: 0, |
||||
number: 3, |
||||
pointWeight: '', |
||||
stageName: '', |
||||
teamCalculationMethod: 0, |
||||
peopleLimit: '', |
||||
percentageLimit: '', |
||||
scoreLimit: '', |
||||
operator: '>', |
||||
score: '', |
||||
teamNumLimit: '', |
||||
teamNumLimitOpt: 0, |
||||
resultAnnouncementTime: '', |
||||
resultsDetails: 0, |
||||
} |
||||
] |
||||
}, |
||||
validRules: { |
||||
rule: [ |
||||
{ required: true, trigger: 'change' } |
||||
], |
||||
stageNum: [ |
||||
{ required: true, trigger: 'change' } |
||||
], |
||||
resultCalculationMethod: [ |
||||
{ required: true, trigger: 'change' } |
||||
], |
||||
resultAnnouncementTime: [ |
||||
{ required: true, message: '请输入成绩公布时间', trigger: 'change' } |
||||
], |
||||
resultsDetails: [ |
||||
{ required: true, trigger: 'change' } |
||||
], |
||||
}, |
||||
ruleForm: {}, |
||||
rules: Const.rules, |
||||
methods: Const.methods, |
||||
teamCalculationMethods: Const.teamCalculationMethods, |
||||
operators: ['>', '>=', '=', '<', '<='] |
||||
}; |
||||
}, |
||||
watch: { |
||||
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
||||
form: { |
||||
handler(){ |
||||
this.updateTime++ |
||||
}, |
||||
deep:true |
||||
}, |
||||
}, |
||||
mounted() { |
||||
this.ruleForm = JSON.parse(JSON.stringify(this.form.competitionStageList[0])) |
||||
this.id && this.getData() |
||||
this.step1 || this.getStep1() // 如果没有第一步的数据,则直接接口获取 |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
this.$get(this.api.getCompetitionRule, { |
||||
competitionId: this.id |
||||
}).then(res => { |
||||
const rule = res.competitionRule |
||||
if (rule) { |
||||
rule.competitionStageList.map(e => { |
||||
const limit = e.scoreLimit |
||||
if (limit) { |
||||
e.operator = limit.replace(/\d+/, '') |
||||
const num = limit.replace(/\D+/, '') |
||||
if (num) e.score = num |
||||
} |
||||
e.teamNumLimitOpt = e.teamNumLimit ? 1 : 0 |
||||
e.teamCalculationMethod = +e.teamCalculationMethod |
||||
}) |
||||
this.form = rule |
||||
} |
||||
this.$nextTick(() => { |
||||
this.updateTime = 0 |
||||
}) |
||||
}).catch(res => {}) |
||||
}, |
||||
// 获取第二部的数据 |
||||
getStep1() { |
||||
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { |
||||
this.step1 = competition |
||||
const { minTeamSize, maxTeamSize, competitionType } = this.step1.completeCompetitionSetup |
||||
competitionType && minTeamSize !== '' && maxTeamSize !== '' && minTeamSize == maxTeamSize && this.teamCalculationMethods.pop() // 团队上下限人数相等,则不显示求和 |
||||
}).catch(err => {}) |
||||
}, |
||||
// 阶段数量选择回调 |
||||
stageChange(val) { |
||||
const list = [] |
||||
for (let i = 1; i <= val; i++) { |
||||
const form = JSON.parse(JSON.stringify(this.ruleForm)) |
||||
form.number = i |
||||
list.push(form) |
||||
} |
||||
this.form.competitionStageList = list |
||||
}, |
||||
// 提交 |
||||
save(status, next = 0) { |
||||
const { 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 // 0为个人赛,1为团队赛 |
||||
// rule: 0为积分赛,1为淘汰赛,2为单项赛 |
||||
// 积分赛 |
||||
if (!rule) { |
||||
// 个人 |
||||
if (form.resultCalculationMethod == 0 && e.pointWeight === '') { |
||||
invalid = 1 |
||||
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 |
||||
} |
||||
} |
||||
if (!e.resultsDetails) { |
||||
e.resultAnnouncementTime = +e.resultAnnouncementTime |
||||
if (e.resultAnnouncementTime === '') { |
||||
invalid = 1 |
||||
util.errorMsg('请填写成绩公布时间') |
||||
break |
||||
} |
||||
if (e.resultAnnouncementTime < 0) { |
||||
invalid = 1 |
||||
util.errorMsg('成绩公布时间不得小于0') |
||||
break |
||||
} |
||||
} |
||||
} |
||||
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 => { |
||||
this.$parent.hideLoad() |
||||
util.successMsg("修改成功"); |
||||
this.$emit('next', next) |
||||
}).catch(err => { |
||||
this.$parent.hideLoad() |
||||
}) |
||||
} else { |
||||
form.setupId = this.setupId |
||||
this.$post(this.api.addCompetitionRule, form).then(res => { |
||||
this.$parent.hideLoad() |
||||
util.successMsg("创建成功"); |
||||
this.$emit('next', next) |
||||
}).catch(err => { |
||||
this.$parent.hideLoad() |
||||
}) |
||||
} |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
/deep/ .d-inline-block { |
||||
width: 216px; |
||||
.el-select, .el-input { |
||||
width: 100%; |
||||
} |
||||
} |
||||
.inline-input { |
||||
.input-wrap { |
||||
display: flex; |
||||
align-items: center; |
||||
margin-bottom: 10px; |
||||
|
||||
.el-input { |
||||
display: inline-block; |
||||
width: 216px; |
||||
margin-right: 8px; |
||||
} |
||||
|
||||
.remove { |
||||
width: 16px; |
||||
height: 16px; |
||||
background: url("../../../assets/img/close.png") 0 0/cover no-repeat; |
||||
cursor: pointer; |
||||
} |
||||
} |
||||
|
||||
.add-btn { |
||||
margin-left: 32px; |
||||
} |
||||
} |
||||
.input-center { |
||||
display: flex; |
||||
align-items: center; |
||||
width: 216px; |
||||
white-space: nowrap; |
||||
.el-input { |
||||
margin-right: 5px; |
||||
} |
||||
} |
||||
.step-set { |
||||
padding: 15px; |
||||
background-color: #fbfbfb; |
||||
} |
||||
.tips { |
||||
font-size: 13px; |
||||
color: #959595; |
||||
} |
||||
.req { |
||||
color: #f00; |
||||
} |
||||
.line { |
||||
margin-bottom: 10px; |
||||
} |
||||
</style> |
@ -0,0 +1,290 @@ |
||||
<template> |
||||
<div> |
||||
<div v-show="!setVisible" class="page"> |
||||
<div class="page-content"> |
||||
<div class="p-title">比赛内容设置</div> |
||||
<el-form label-width="170px" label-suffix=":" size="small" :disabled="!editing && id"> |
||||
<div v-for="(item, i) in form" :key="i" class="step"> |
||||
<div class="title"> |
||||
<span>{{ item.stageName }}(第{{ nums[i] }}阶段) | {{ methods.find(e => e.id === item.method).name }} </span> |
||||
<el-button v-if="item.method !== 2" type="primary" @click="toSet(i)">设置</el-button> |
||||
</div> |
||||
<el-form-item class="req" prop="time" label="比赛时间"> |
||||
<span v-if="item.method !== 2 && item.startTime">{{ item.startTime + ' 至 ' + item.endTime }}</span> |
||||
<div style="display: flex;align-items: center;" v-if="item.method === 2"> |
||||
<el-date-picker |
||||
v-model="item.time" |
||||
type="datetimerange" |
||||
range-separator="~" |
||||
start-placeholder="开始日期" |
||||
end-placeholder="结束日期" |
||||
format="yyyy-MM-dd HH:mm:ss" |
||||
value-format="yyyy-MM-dd HH:mm:ss" |
||||
@change="timeChange"> |
||||
</el-date-picker> |
||||
<el-alert |
||||
style="width: auto;padding: 0px 16px;margin-left: 10px;" |
||||
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'" |
||||
type="error" |
||||
:closable="false" |
||||
effect="dark"> |
||||
</el-alert> |
||||
</div> |
||||
</el-form-item> |
||||
<template v-if="item.method === 2"> |
||||
<el-form-item class="req" label="比赛地点"> |
||||
<el-input v-model="item.offlineAddress" style="width: 80%"></el-input> |
||||
</el-form-item> |
||||
<el-form-item class="req" label="比赛内容"> |
||||
<el-input v-model="item.contentDescription" type="textarea" style="width: 80%"></el-input> |
||||
</el-form-item> |
||||
<el-form-item class="req" label="评分规则"> |
||||
<el-input v-model="item.scoreRule" type="textarea" style="width: 80%"></el-input> |
||||
</el-form-item> |
||||
</template> |
||||
<template v-else> |
||||
<el-form-item class="req" prop="cid" label="课程系统"> |
||||
{{ item.systemName }} |
||||
</el-form-item> |
||||
<el-form-item class="req" prop="assessmentId" label="已选择考核"> |
||||
{{ item.projectName }} |
||||
</el-form-item> |
||||
<el-form-item class="req" prop="resultAnnouncementTime" label="比赛地点"> |
||||
<div class="line"> |
||||
<el-checkbox v-model="item.onlineButton">线上</el-checkbox> |
||||
<el-input v-model="item.onlineAddress" clearable placeholder="请输入比赛网址" :disabled="!item.onlineButton" style="width: 400px;margin-left: 10px"></el-input> |
||||
</div> |
||||
<div class="line"> |
||||
<el-checkbox v-model="item.offlineButton">线下</el-checkbox> |
||||
<el-input v-model="item.offlineAddress" clearable placeholder="请输入地址" :disabled="!item.offlineButton" style="width: 400px;margin-left: 10px"></el-input> |
||||
</div> |
||||
</el-form-item> |
||||
</template> |
||||
</div> |
||||
</el-form> |
||||
</div> |
||||
</div> |
||||
|
||||
<set v-if="setVisible" :form.sync="form[curStep]" :step1.sync="step1" @hideSet="hideSet" /> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
import set from './set' |
||||
export default { |
||||
props: ['setupId', 'competitionId', 'editing'], |
||||
data() { |
||||
return { |
||||
id: this.$route.query.id, |
||||
updateTime: 0, |
||||
step1: this.$parent.$refs.step1.form, |
||||
nums: ['一', '二', '三'], |
||||
methods: [ |
||||
{ |
||||
id: 0, |
||||
name: '实操' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '理论' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '线下' |
||||
} |
||||
], |
||||
originForm: { |
||||
cid: '', |
||||
contentDescription: '', |
||||
endTime: '', |
||||
scoreRule: '', |
||||
stageId: '', |
||||
startTime: '', |
||||
systemId: '', |
||||
offlineAddress: '', |
||||
offlineButton: 0, |
||||
onlineAddress: '', |
||||
onlineButton: 0, |
||||
time: [] |
||||
}, |
||||
form: [], |
||||
setVisible: false, |
||||
curStep: 0, |
||||
timeInvalid: false |
||||
}; |
||||
}, |
||||
components: { |
||||
set |
||||
}, |
||||
watch: { |
||||
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
||||
form: { |
||||
handler(){ |
||||
this.updateTime++ |
||||
}, |
||||
deep:true |
||||
}, |
||||
}, |
||||
mounted() { |
||||
this.handleForm() |
||||
}, |
||||
methods: { |
||||
// 处理form |
||||
handleForm() { |
||||
// 根据赛事id查询赛事规则 |
||||
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] |
||||
form.offlineButton = !!form.offlineButton |
||||
form.onlineButton = !!form.onlineButton |
||||
form.method = e.method |
||||
form.stageId = e.stageId |
||||
form.stageName = e.stageName |
||||
this.form.push(form) |
||||
}) |
||||
this.$nextTick(() => { |
||||
this.updateTime = 0 |
||||
}) |
||||
}).catch(res => {}) |
||||
}, |
||||
// 显示设置页面 |
||||
toSet(i) { |
||||
this.curStep = i |
||||
this.$parent.showBtns = false |
||||
this.setVisible = true |
||||
}, |
||||
// 隐藏设置 |
||||
hideSet(form) { |
||||
if (form) this.form[this.curStep] = form |
||||
this.setVisible = false |
||||
this.$parent.showBtns = true |
||||
}, |
||||
// 时间选择回调 |
||||
timeChange(val) { |
||||
if (val.length) { |
||||
const startTime = new Date(val[0]) |
||||
const endTime = new Date(val[1]) |
||||
const { playStartTime, playEndTime } = this.step1 |
||||
if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) { |
||||
this.timeInvalid = true |
||||
return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') |
||||
} |
||||
this.timeInvalid = false |
||||
const { form, curStep } = this |
||||
for (const i in form) { |
||||
// 判断其他阶段的时间跟当前选的时间是否重叠 |
||||
if (i !== curStep) { |
||||
const time1 = new Date(form[i].startTime) |
||||
const time2 = new Date(form[i].endTime) |
||||
if ((startTime >= time1 && startTime <= time2) || (endTime >= time1 && endTime <= time2)) { |
||||
util.warningMsg('请注意,所设置的时间与已设置的阶段时间重合。') |
||||
break |
||||
} |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
// 发布赛事 |
||||
publish() { |
||||
this.competitionId && this.$post(`${this.api.publishCompetition}?competitionId=${this.competitionId}&publishStatus=1`).then(res => {}).catch(err => {}) |
||||
}, |
||||
// 提交 |
||||
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) { |
||||
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 |
||||
// 处理单选框 |
||||
for (const e of form) { |
||||
e.offlineButton = e.offlineButton ? 1 : 0 |
||||
e.onlineButton = e.onlineButton ? 1 : 0 |
||||
} |
||||
this.$parent.showLoad() |
||||
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], { |
||||
competitionContents: form |
||||
}).then(res => { |
||||
// 新增赛事,并且点的是发布按钮,则发布该赛事 |
||||
!form[0].contentId && status && this.publish(status) |
||||
this.$parent.hideLoad() |
||||
util.successMsg((status ? '发布' : '保存') + '成功') |
||||
this.$emit('next', next) |
||||
}).catch(err => { |
||||
this.$parent.hideLoad() |
||||
}) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.step { |
||||
padding-bottom: 10px; |
||||
background-color: #f9f9f9; |
||||
.title { |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
padding: 10px 15px; |
||||
margin-bottom: 10px; |
||||
background-color: #ededed; |
||||
} |
||||
} |
||||
.line { |
||||
margin-bottom: 10px; |
||||
} |
||||
/deep/.req { |
||||
.el-form-item__label { |
||||
&:before { |
||||
content: '*'; |
||||
margin-right: 5px; |
||||
font-size: 18px; |
||||
vertical-align: middle; |
||||
color: #f00; |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -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> |
@ -0,0 +1,109 @@ |
||||
<template> |
||||
<!-- 报名人员 --> |
||||
<div class="page-content" style="padding: 24px"> |
||||
<el-collapse v-model="curStep"> |
||||
<el-collapse-item v-for="(item, i) in list" :key="i" :title="item.stageName" :name="item.stageId"> |
||||
<div class="line"> |
||||
<span>比赛方式:{{ item.methodName }}</span> |
||||
<span>比赛形式:{{ item.competitionType ? '团队赛' : '个人赛' }}</span> |
||||
<span>赛制:{{ item.ruleName }}</span> |
||||
<span>状态:{{ item.status }}</span> |
||||
<span>竞赛起止时间:{{ item.startTime + ' ~ ' + item.endTime }}</span> |
||||
<div> |
||||
<el-button type="primary" @click="toRank(item, i)">排名</el-button> |
||||
<el-button @click="toArch(item)">成绩管理</el-button> |
||||
</div> |
||||
</div> |
||||
</el-collapse-item> |
||||
</el-collapse> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
import Const from '@/const/match' |
||||
export default { |
||||
name: "matchArch", |
||||
data() { |
||||
return { |
||||
id: +this.$route.query.id, |
||||
list: [], |
||||
form: {}, |
||||
timer: null, |
||||
curStep: [] |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this.$once('hook:beforeDestroy', function() { |
||||
clearInterval(this.timer) |
||||
}) |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { |
||||
this.form = competition |
||||
this.timer = setInterval(this.handleStatus, 1000) |
||||
this.getArch() |
||||
}).catch(err => {}) |
||||
}, |
||||
getArch() { |
||||
this.$post(this.api.detailsOfCompetitionStage, { |
||||
pageNum: 1, |
||||
pageSize: 100, |
||||
contestId: this.id, |
||||
}).then(({ page }) => { |
||||
const list = page.records |
||||
list.map(e => { |
||||
e.methodName = Const.methods.find(n => n.id === e.method).name |
||||
e.ruleName = Const.rules.find(n => n.id === e.rule).name |
||||
}) |
||||
this.curStep = list.map(e => e.stageId) |
||||
this.list = list |
||||
}).catch(res => {}); |
||||
}, |
||||
// 报名时间、比赛时间、状态处理 |
||||
handleStatus() { |
||||
const now = new Date() |
||||
this.form.competitionStage.map(e => { |
||||
const startTime = new Date(e.startTime) |
||||
const endTime = new Date(e.endTime) |
||||
const item = this.list.find(n => n.stageId == e.stageId) |
||||
if (item) { |
||||
if (now < startTime) { |
||||
this.$set(item, 'status', '未开始') |
||||
} else if (now >= startTime && now <= endTime) { |
||||
this.$set(item, 'status', '比赛中') |
||||
} else if (now > endTime) { |
||||
this.$set(item, 'status', '已完成') |
||||
} |
||||
} |
||||
}) |
||||
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}`) |
||||
}, |
||||
// 成绩管理 |
||||
toArch(row) { |
||||
this.$router.push(`/matchArchList?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}`) |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
/deep/.el-collapse-item__header { |
||||
font-size: 16px; |
||||
color: #333; |
||||
} |
||||
.line { |
||||
display: flex; |
||||
justify-content: space-around; |
||||
align-items: center; |
||||
span { |
||||
margin-right: 30px; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,381 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="m-b-20 head-card"> |
||||
<div class="flex-between m-b-20"> |
||||
<el-page-header @back="$router.back()" content="成绩管理"></el-page-header> |
||||
</div> |
||||
|
||||
</el-card> |
||||
|
||||
<el-card v-if="method != 2" shadow="hover" class="m-b-20"> |
||||
<div class="stat"> |
||||
<div class="nums"> |
||||
<div class="item"> |
||||
<p class="name">实验总人数</p> |
||||
<p class="val">{{ totalNumber }}</p> |
||||
</div> |
||||
<div class="item"> |
||||
<p class="name">实验平均分</p> |
||||
<p class="val">{{ avgScore }}</p> |
||||
</div> |
||||
</div> |
||||
<div class="chart" id="chart"></div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<div class="flex-between m-b-20"> |
||||
<div> |
||||
<el-input |
||||
size="small" |
||||
placeholder="请输入学校/学生姓名" |
||||
prefix-icon="el-icon-search" |
||||
v-model="keyword" clearable |
||||
style="width: 300px" |
||||
></el-input> |
||||
</div> |
||||
<div> |
||||
<el-button v-if="method == 2" type="primary" @click="batchImport">上传成绩</el-button> |
||||
<el-button type="primary" @click="delAllData">批量删除</el-button> |
||||
<el-button type="primary" @click="exportData">导出</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId"> |
||||
<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"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.$index + (page - 1) * pageSize + 1 }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="schoolName" label="学校" min-width="150" align="center"></el-table-column> |
||||
<el-table-column v-if="competitionType" prop="teamName" label="团队名称" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="userName" label="学生姓名" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="workNumber" label="学号" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="score" label="分数" width="90" align="center"></el-table-column> |
||||
<el-table-column prop="timeSum" label="耗时" width="90" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.timeSum }}min |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="submitTime" label="提交时间" min-width="150" align="center"> |
||||
</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 type="text" @click="handleDelete(scope.row)">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"> |
||||
<div style="text-align: center"> |
||||
<div style="margin-bottom: 10px;"> |
||||
<el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
||||
</div> |
||||
<el-upload |
||||
ref="importStaff" |
||||
name="file" |
||||
accept=".xls,.xlsx" |
||||
:on-remove="handleRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.importStaff" |
||||
:file-list="uploadList" |
||||
:headers="headers" |
||||
> |
||||
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
||||
</el-upload> |
||||
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败,查看失败原因</el-link> |
||||
</div> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button size="small" @click="importVisible = false">取 消</el-button> |
||||
<el-button size="small" type="primary" @click="uploadSure">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from "@/setting"; |
||||
import util from "@/libs/util"; |
||||
import * as echarts from "echarts"; |
||||
import axios from 'axios'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
id: +this.$route.query.id, |
||||
stageId: +this.$route.query.stageId, |
||||
method: +this.$route.query.method, |
||||
competitionType: +this.$route.query.competitionType, |
||||
keyword: "", |
||||
searchTimer: null, |
||||
list: [], |
||||
multipleSelection: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
totalNumber: 0, // 总人数 |
||||
avgScore: 0, // 平均分 |
||||
importVisible: false, |
||||
uploadList: [], |
||||
uploadFaild: false, |
||||
exportCode: '', |
||||
headers: { |
||||
token: sessionStorage.getItem("token") |
||||
}, |
||||
statData: {} |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer); |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData(); |
||||
}, 500); |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
this.$post(this.api.stageGradeManagementList, { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
competitionId: this.id, |
||||
keyWord: this.keyword, |
||||
stageId: this.stageId, |
||||
isNakadai: 1 |
||||
}).then(({ data, page }) => { |
||||
this.total = page.total |
||||
this.list = page.records |
||||
this.statData = data |
||||
this.avgScore = (+data.avgScore).toFixed(2) |
||||
this.totalNumber = data.totalNumber |
||||
this.getChart() |
||||
}).catch(res => {}) |
||||
}, |
||||
initData() { |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
// 查看成绩报告 |
||||
show(row) { |
||||
this.$router.push(`/matchReport?reportId=${row.reportId}`) |
||||
}, |
||||
// 导出(有勾选:就导勾选中的;没有勾选:就导全部) |
||||
exportData() { |
||||
// 有勾选,就带上勾选的id |
||||
if (this.multipleSelection.length) { |
||||
const ids = this.multipleSelection.map(e => e.reportId) |
||||
url += `&ids=${ids.toString()}` |
||||
} |
||||
axios.post(this.api.exportExperimentalResultsInBatch, this.list, { |
||||
responseType: 'blob' |
||||
}).then((res) => { |
||||
util.downloadFileDirect(`赛事成绩.xls`,new Blob([res.data])) |
||||
}).catch(res => {}) |
||||
}, |
||||
handleDelete(row) { // 删除 |
||||
this.$confirm("确定要删除吗?", "提示", { |
||||
type: "warning" |
||||
}).then(() => { |
||||
this.$post(this.api.batchDeleteContestGrade, { |
||||
ids: [this.method == 2 ? row.scoreId : row.reportId], |
||||
competitionId: this.id, |
||||
stageId: row.stageId |
||||
}).then(res => { |
||||
util.successMsg("删除成功"); |
||||
this.getData(); |
||||
}).catch(res => { |
||||
}); |
||||
}).catch(() => { |
||||
}); |
||||
}, |
||||
delAllData() { // 批量删除 |
||||
if (this.multipleSelection.length) { |
||||
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", { |
||||
type: "warning" |
||||
}).then(() => { |
||||
let ids = this.multipleSelection.map(item => { |
||||
return item.reportId; |
||||
}); |
||||
this.$post(this.api.deleteExperimentalReport, ids).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$refs.table.clearSelection(); |
||||
util.successMsg("删除成功"); |
||||
this.getData(); |
||||
}).catch(res => { |
||||
}); |
||||
}).catch(() => { |
||||
}); |
||||
} else { |
||||
util.errorMsg("请先选择数据 !"); |
||||
} |
||||
}, |
||||
handleSelectionChange(val) { // 多选 |
||||
this.multipleSelection = val; |
||||
}, |
||||
handleCurrentChange(val) { // 切换分页 |
||||
this.page = val; |
||||
this.getData(); |
||||
}, |
||||
getChart() { // 初始化折线图 |
||||
const data = [] |
||||
const { statData } = this |
||||
for (let i = 1; i <= 10; i++) { |
||||
data.push(statData['num' + i]) |
||||
} |
||||
let myChart = echarts.init(document.getElementById("chart")); |
||||
myChart.setOption({ |
||||
title: { text: "实验分数分布图" }, |
||||
tooltip: {}, |
||||
xAxis: { |
||||
name: "分数", |
||||
type: "category", |
||||
boundaryGap: false, |
||||
interval: 10, |
||||
data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"] |
||||
}, |
||||
yAxis: { |
||||
name: "人数", |
||||
type: "value", |
||||
interval: 1 |
||||
}, |
||||
series: [{ |
||||
data, |
||||
type: "line", |
||||
areaStyle: {}, |
||||
color: ["#8191fd"] |
||||
}] |
||||
}); |
||||
}, |
||||
// 批量导入 |
||||
batchImport() { |
||||
this.importVisible = true |
||||
this.uploadList = [] |
||||
this.uploadFaild = false |
||||
}, |
||||
// 模板下载 |
||||
download() { |
||||
location.href = this.api.gradeImport |
||||
}, |
||||
// 上传文件 |
||||
handleExceed(files, fileList) { |
||||
util.warningMsg( |
||||
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
||||
) |
||||
}, |
||||
// 下载失败文件 |
||||
showFaild() { |
||||
location.href = `${this.api.performanceExportFailure}?exportCode=${this.exportCode}` |
||||
}, |
||||
uploadSuccess(res, file, fileList) { |
||||
this.uploadFaild = false |
||||
if (res.status === 200) { |
||||
if (res.data.exportCode) { |
||||
this.exportCode = res.data.exportCode |
||||
this.uploadFaild = true |
||||
util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`) |
||||
} |
||||
} else { |
||||
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据") |
||||
} |
||||
}, |
||||
uploadError(err, file, fileList) { |
||||
this.$message({ |
||||
message: "上传出错,请重试!", |
||||
type: "error", |
||||
center: true |
||||
}) |
||||
}, |
||||
beforeRemove(file, fileList) { |
||||
return this.$confirm(`确定移除 ${file.name}?`) |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
this.uploadList = fileList |
||||
this.uploadFaild = false |
||||
}, |
||||
uploadSure() { |
||||
this.importVisible = false |
||||
this.studentType = 1 |
||||
this.keyWord = '' |
||||
this.$refs.orgTree.setCurrentKey(null) |
||||
this.getOrg() |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
|
||||
/deep/ .head-card { |
||||
.el-card__body { |
||||
padding-bottom: 0px; |
||||
|
||||
.el-tabs__header { |
||||
margin-bottom: 1px; |
||||
|
||||
.el-tabs__nav-wrap::after { |
||||
display: none; |
||||
} |
||||
|
||||
.el-tabs__item { |
||||
font-size: 18px; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
.stat { |
||||
display: flex; |
||||
|
||||
.nums { |
||||
display: flex; |
||||
align-items: center; |
||||
margin-right: 20px; |
||||
|
||||
.item:nth-child(1) { |
||||
background-image: url('../../../assets/img/total.png'); |
||||
} |
||||
|
||||
.item:nth-child(2) { |
||||
background-image: url('../../../assets/img/avg.png'); |
||||
} |
||||
|
||||
.item { |
||||
width: 300px; |
||||
padding: 30px 30px; |
||||
margin: 0 10px; |
||||
box-sizing: border-box; |
||||
border-radius: 8px; |
||||
background-size: 100% 100%; |
||||
background-repeat: no-repeat; |
||||
|
||||
p { |
||||
font-size: 18px; |
||||
color: #ffffff; |
||||
} |
||||
|
||||
.val { |
||||
margin-top: 10px; |
||||
color: #ffffff; |
||||
font-size: 36px; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.chart { |
||||
flex: 1; |
||||
height: 300px; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,562 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="m-b-20 head-card"> |
||||
<div class="flex-between"> |
||||
<el-page-header @back="$router.back()" content="参赛信息与成绩"></el-page-header> |
||||
</div> |
||||
</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> |
||||
<table class="table"> |
||||
<tr> |
||||
<th width="150">姓名:</th> |
||||
<td>{{ info.person.userName }}</td> |
||||
</tr> |
||||
<tr> |
||||
<th>学号:</th> |
||||
<td>{{ info.person.workNumber }}</td> |
||||
</tr> |
||||
<tr> |
||||
<th>学校:</th> |
||||
<td>{{ info.person.schoolName }}</td> |
||||
</tr> |
||||
<template v-if="form.completeCompetitionSetup.competitionType"> |
||||
<template> |
||||
<tr> |
||||
<th>队长:</th> |
||||
<td>{{ info.caption.userName }}{{ info.caption.schoolName && ',' + info.caption.schoolName }}{{ info.caption.workNumber && ',' + info.caption.workNumber }}</td> |
||||
</tr> |
||||
<tr> |
||||
<th>团队成员:</th> |
||||
<td> |
||||
<el-tag v-for="(item, i) in info.teamDetail" :key="i" style="margin-right: 5px">{{ item.userName }}</el-tag> |
||||
</td> |
||||
</tr> |
||||
</template> |
||||
</template> |
||||
<tr> |
||||
<th width="130">指导老师:</th> |
||||
<td> |
||||
<div class="plus"> |
||||
<i class="el-icon-circle-plus-outline icon" @click="addAdvisor"></i> |
||||
</div> |
||||
<div v-for="(item, i) in info.teamInstructors" :key="i" class="line"> |
||||
<el-input placeholder="请输入姓名" v-model="item.name" clearable size="mini" :disabled="!item.edit"></el-input> |
||||
<el-input placeholder="请输入职务" maxlength="10" v-model="item.position" clearable size="mini" :disabled="!item.edit"></el-input> |
||||
<el-input placeholder="请输入手机号" maxlength="11" v-model="item.phone" clearable size="mini" :disabled="!item.edit"></el-input> |
||||
<template v-if="status < 5"> |
||||
<i v-if="item.edit" class="el-icon-check icon" @click="submitAdvisor(item)"></i> |
||||
<i v-else class="el-icon-edit icon" @click="editAdvisor(item)"></i> |
||||
<i class="el-icon-delete icon" @click="delAdvisor(item, i)"></i> |
||||
</template> |
||||
</div> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th>竞赛阶段:</th> |
||||
<td> |
||||
<table class="table tc"> |
||||
<tr> |
||||
<th width="80">序号</th> |
||||
<th>赛项阶段名称</th> |
||||
<template v-if="form.completeCompetitionSetup.competitionType"> |
||||
<th width="110">参赛人数限制</th> |
||||
<th>允许参赛人员</th> |
||||
<th v-if="info.team.captain === 0 && form.rule === 0">总分</th> |
||||
</template> |
||||
<th>竞赛成绩</th> |
||||
</tr> |
||||
<template v-if="info.stages.length"> |
||||
<tr v-for="(item, i) in info.stages" :key="i"> |
||||
<td>{{ i + 1 }}</td> |
||||
<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> |
||||
</template> |
||||
<td> |
||||
<span v-if="item.score" 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> |
||||
</template> |
||||
<tr v-else> |
||||
<td colspan="6">暂无数据</td> |
||||
</tr> |
||||
</table> |
||||
<el-alert |
||||
v-if="form.completeCompetitionSetup.competitionType" |
||||
style="margin-top: 10px;" |
||||
:title="'注:请团长(团队创建人)设置各阶段参赛成员,只有被选择的允许参赛成员可进入对应阶段比赛' + (info.teamLimit ? ',每个团队成员只能参加一个赛项阶段' : '') + '!'" |
||||
type="warning" |
||||
show-icon> |
||||
</el-alert> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
|
||||
<template v-if="form.completeCompetitionSetup.competitionType"> |
||||
<div class="l-title m-t-20">团队成员</div> |
||||
<div class="flex-center"> |
||||
<p>队长:{{ info.caption.userName }}</p> |
||||
<el-button type="primary" @click="transfer">转让队长</el-button> |
||||
</div> |
||||
<el-table :data="info.teamDetail" stripe header-align="center"> |
||||
<el-table-column prop="userName" label="成员姓名" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="schoolName" label="学校" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="workNumber" label="学号" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="createTime" label="加入时间" width="180" align="center"></el-table-column> |
||||
<el-table-column label="操作" align="center" width="160"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-if="scope.row.captain" type="text" @click="removeLine(scope.row)">踢出团队</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
</template> |
||||
</el-card> |
||||
|
||||
<el-dialog title="选择参赛成员" :visible.sync="transferVisible" :close-on-click-modal="false" width="400px"> |
||||
<template v-for="(item, i) in info.teamDetail"> |
||||
<el-radio v-if="item.captain" :key="i" v-model="checkedPlayer" :label="item.teamId">{{ item.userName }}</el-radio> |
||||
</template> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button size="small" type="primary" @click="transferSubmit">确定</el-button> |
||||
<el-button size="small" @click="transferVisible = false">取消</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
<el-dialog title="选择参赛成员" :visible.sync="chooseVisible" :close-on-click-modal="false" width="400px"> |
||||
<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> |
||||
<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> |
||||
</span> |
||||
</el-dialog> |
||||
<el-dialog title="团队得分详情" :visible.sync="memberVisible" width="900px" :close-on-click-modal="false"> |
||||
<h6 v-if="members.length" style="margin-bottom: 10px;font-size: 16px;">团队名称:{{ members[0].teamName }} 阶段名称:{{ curRow.stageName }}</h6> |
||||
<table class="table tc"> |
||||
<tr> |
||||
<th width="60">序号</th> |
||||
<th width="100">姓名</th> |
||||
<th width="100">学校</th> |
||||
<th width="100">用时</th> |
||||
<th width="100">分数</th> |
||||
<th width="100">得分详情</th> |
||||
</tr> |
||||
<template v-if="members.length"> |
||||
<tr v-for="(item, i) in members" :key="i"> |
||||
<td>{{ i + 1 }}</td> |
||||
<td>{{ item.userName }}</td> |
||||
<td>{{ item.schoolName }}</td> |
||||
<td>{{ item.timeSum }}min</td> |
||||
<td>{{ item.score }}</td> |
||||
<td> |
||||
<el-button type="text" @click="toReport(item)">查看</el-button> |
||||
</td> |
||||
</tr> |
||||
</template> |
||||
<tr v-else> |
||||
<td colspan="6">暂无数据</td> |
||||
</tr> |
||||
</table> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button size="small" type="primary" @click="memberVisible = false">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from "@/setting"; |
||||
import util from "@/libs/util"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
id: +this.$route.query.id, |
||||
accountId: +this.$route.query.accountId, |
||||
status: 5, |
||||
form: { |
||||
competitionStage: [], |
||||
completeCompetitionSetup: {}, |
||||
competitionRegistration: {} |
||||
}, |
||||
info: { |
||||
isCaption: 0, |
||||
person: {}, |
||||
caption: {}, |
||||
team: { |
||||
captain: 1, |
||||
invitationCode: '' |
||||
}, |
||||
stages: [], |
||||
teamDetail: [], |
||||
teamInstructors: [] |
||||
}, |
||||
memberVisible: false, |
||||
members: [], |
||||
curRow: {}, |
||||
teamVisible: false, |
||||
teams: [], |
||||
teamNameRepeat: false, |
||||
teamForm: { |
||||
accountId: +this.$route.query.accountId, |
||||
identification: 1, |
||||
competitionId: this.$route.query.id, |
||||
registrationInvitationCode: '', |
||||
teamName: '', |
||||
invitationCode: '', |
||||
whetherSignUp: 1 |
||||
}, |
||||
curStage: null, |
||||
originInfo: {}, |
||||
originIns: { |
||||
position: '', |
||||
name: '', |
||||
phone: '', |
||||
}, |
||||
checkedPlayer: '', |
||||
transferVisible: false, |
||||
editing: false, |
||||
memberVisible: false, |
||||
members: [], |
||||
curRow: {}, |
||||
chooseVisible: false, |
||||
checkedMember: '', |
||||
checkedMembers: [], |
||||
chooses: [], |
||||
timerList: [], |
||||
timer: null |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this.$once('hook:beforeDestroy', function() { |
||||
clearInterval(this.timer) |
||||
this.timerList.forEach(n => { |
||||
clearInterval(n) |
||||
}) |
||||
this.timerList = [] |
||||
}) |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { |
||||
this.form = competition |
||||
this.timer = setInterval(this.handleStatus, 1000) |
||||
this.getInfo() |
||||
}).catch(err => {}) |
||||
}, |
||||
// 获取竞赛信息 |
||||
getInfo() { |
||||
this.$post(`${this.api.entryInformation}?competitionId=${this.id}&accountId=${this.accountId}`).then(res => { |
||||
const info = res.entryInformation |
||||
// 如果是队长,并且没有指导老师,默认添加一个空的 |
||||
if (!info.teamInstructors.length) info.teamInstructors.push(JSON.parse(JSON.stringify(this.originIns))) |
||||
if (info.personalDetail) { |
||||
info.team = {} |
||||
info.teamDetail = [] |
||||
} else { |
||||
info.isCaption = info.team.caption |
||||
} |
||||
const caption = info.teamDetail.find(e => !e.caption) |
||||
info.caption = caption ? caption : {} |
||||
info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId) |
||||
this.originInfo = JSON.parse(JSON.stringify(info)) |
||||
// 设置定时器,阶段比赛结束后公布成绩,到时间后调本接口 |
||||
const now = Date.now() |
||||
this.form.competitionStage.map(e => { |
||||
// 如果公布成绩详情勾选的是 |
||||
if (!e.resultsDetails) { |
||||
const endTime = new Date(e.endTime).getTime() + e.resultAnnouncementTime * 3600000 // 阶段结束时间+成绩公布时间(成绩公布时间单位是小时,所以要转化为毫秒) |
||||
if (now > endTime) { // 如果到了公布时间 |
||||
info.stages.find(n => n.stageId == e.stageId).showDetail = 1 |
||||
} else { // 没有到公布时间,则加定时器,到点后调用 |
||||
this.timerList.push(setTimeout(this.getInfo, endTime - now)) |
||||
} |
||||
} |
||||
}) |
||||
this.info = info |
||||
}).catch(err => {}); |
||||
}, |
||||
// 报名时间、比赛时间、状态处理 |
||||
handleStatus() { |
||||
let status |
||||
const n = this.form |
||||
let now = new Date().getTime(); |
||||
let signUpStartTime = new Date(this.dateCompatible(n.signUpStartTime)).getTime(); // 报名开始时间 |
||||
let signUpEndTime = new Date(this.dateCompatible(n.signUpEndTime)).getTime(); // 报名结束时间 |
||||
let playStartTime = new Date(this.dateCompatible(n.playStartTime)).getTime(); // 比赛开始时间 |
||||
let playEndTime = new Date(this.dateCompatible(n.playEndTime)).getTime(); // 比赛结束时间 |
||||
if (now < signUpStartTime) { // 报名没开始 |
||||
status = 0; |
||||
} else if (now > signUpStartTime && now < signUpEndTime) { // 报名进行中 |
||||
status = n.competitionRegistration ? 1 : 2 // 1已报名,2立即报名 |
||||
} else if (now > signUpEndTime && now < playStartTime) { // 报名结束了,但比赛没开始 |
||||
status = 3; |
||||
} else if (now > playStartTime && now < playEndTime) { // 比赛进行中 |
||||
status = 4 |
||||
} else if (now > playEndTime) { // 比赛结束 |
||||
status = 5; |
||||
} |
||||
this.status = status |
||||
}, |
||||
// 编辑保存 |
||||
edit(showMsg) { |
||||
if (this.editing || !showMsg) { |
||||
const { teamId, teamName, invitationCode } = this.info.team |
||||
this.$post(this.api.editCompetitionTeam, { |
||||
accountId: this.accountId, |
||||
identification: 1, |
||||
competitionId: this.id, |
||||
teamId, |
||||
teamName, |
||||
invitationCode, |
||||
whetherSignUp: 1 |
||||
}).then(res => { |
||||
this.getInfo() |
||||
showMsg && util.successMsg('保存成功') |
||||
}).catch(res => {}) |
||||
} else { |
||||
this.editing = !this.editing |
||||
} |
||||
}, |
||||
// 删除指导老师 |
||||
delAdvisor(row, i) { |
||||
if (row.id) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.$post(`${this.api.deleteAnAdvisor}?id=${row.id}`).then(res => { |
||||
util.successMsg('删除成功') |
||||
this.getInfo() |
||||
}).catch(res => {}) |
||||
}).catch(() => {}) |
||||
} else { |
||||
this.info.teamInstructors.splice(i, 1) |
||||
} |
||||
}, |
||||
// 添加指导老师 |
||||
addAdvisor() { |
||||
if (this.info.teamInstructors.length > 4) return util.errorMsg('指导老师仅限添加5个!') |
||||
this.info.teamInstructors.push(JSON.parse(JSON.stringify(this.originIns))) |
||||
}, |
||||
// 编辑导老师 |
||||
editAdvisor(row) { |
||||
this.$set(row, 'edit', 1) |
||||
}, |
||||
// 提交指导老师 |
||||
submitAdvisor(row) { |
||||
if (!row.name) return util.errorMsg('请输入姓名') |
||||
const { phone } = row |
||||
if (phone && !/^1[3456789]\d{9}$/.test(phone)) return util.errorMsg('请输入正确手机号格式') |
||||
this.$post(this.api.addAnAdvisor, { |
||||
name: row.name, |
||||
competitionId: this.id, |
||||
id: row.id, |
||||
teamId: this.info.teamId, |
||||
phone: row.phone, |
||||
position: row.position, |
||||
}).then(res => { |
||||
util.successMsg((row.id ? '修改' : '新增') + '成功') |
||||
this.getInfo() |
||||
}).catch(res => {}) |
||||
}, |
||||
// 显示转让队长 |
||||
transfer() { |
||||
// 取每个阶段的开始结束时间,有任何阶段开始了都不能转让队长和踢出队员 |
||||
const now = new Date() |
||||
let start = 0 |
||||
for (const e of this.form.competitionStage) { |
||||
if (now >= new Date(e.startTime) && now <= new Date(e.endTime)) { |
||||
util.errorMsg('比赛已经开始,无法转让队长!') |
||||
start = 1 |
||||
break |
||||
} |
||||
} |
||||
if (!start) this.transferVisible = true |
||||
}, |
||||
// 转让队长提交 |
||||
transferSubmit() { |
||||
if (!this.checkedPlayer) return util.errorMsg('请选择成员') |
||||
this.$post(this.api.captainOfTransfer, { |
||||
captainId: this.info.caption.teamId, |
||||
playerId: this.checkedPlayer |
||||
}).then(res => { |
||||
this.checkedPlayer = '' |
||||
util.successMsg('转让成功') |
||||
this.transferVisible = false |
||||
this.getInfo() |
||||
}).catch(res => {}) |
||||
}, |
||||
// 踢出团队 |
||||
removeLine(row) { |
||||
// 取每个阶段的开始结束时间,有任何阶段开始了都不能转让队长和踢出队员 |
||||
const now = new Date() |
||||
let start = 0 |
||||
for (const e of this.form.competitionStage) { |
||||
if (now >= new Date(e.startTime) && now <= new Date(e.endTime)) { |
||||
util.errorMsg('比赛已经开始,无法踢出成员!') |
||||
start = 1 |
||||
break |
||||
} |
||||
} |
||||
if (!start) { |
||||
this.$confirm('确定要踢出该成员吗?', '提示', { |
||||
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=true,则每个成员只能参加一个阶段的比赛,要获取stages里返回的所有participantAccountIds(参赛人员的accountId),然后不显示这些参赛人员 |
||||
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 |
||||
} else { |
||||
this.chooses = this.info.teamDetail |
||||
} |
||||
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}个以下参赛成员!`) // 选择的参赛人员个数不能大于参赛人数限制 |
||||
this.$post(this.api.stageSelectParticipants, { |
||||
accountIds, |
||||
competitionId: this.id, |
||||
stageId: this.curRow.stageId, |
||||
teamId: this.info.teamId |
||||
}).then(res => { |
||||
this.checkedMembers = [] |
||||
util.successMsg('修改成功') |
||||
this.getInfo() |
||||
this.chooseVisible = false |
||||
}).catch(res => {}) |
||||
}, |
||||
// 查看成绩详情 |
||||
show(row) { |
||||
// 团队展示弹框,个人跳转实验报告 |
||||
if (this.form.completeCompetitionSetup.competitionType && this.info.team.captain === 0) { // 团队比赛并且是队长,则展示团队成员成绩详情 |
||||
this.curRow = row |
||||
this.memberVisible = true |
||||
const teamId = this.form.competitionRegistration.teamId |
||||
if (teamId) { |
||||
this.$post(this.api.stageGradeManagementList, { |
||||
pageNum: 1, |
||||
pageSize: 1000, |
||||
competitionId: this.id, |
||||
stageId: row.stageId, |
||||
isNakadai: 0 |
||||
}).then(({ page }) => { |
||||
this.members = page.records.filter(e => e.teamId === teamId) |
||||
}).catch(res => {}) |
||||
} else { |
||||
this.members = [] |
||||
} |
||||
} else if (row.reportId) { // 团员或者个人比赛,并且有reportId,则进入实验报告 |
||||
this.toReport(row) |
||||
} |
||||
}, |
||||
// 跳转实验报告 |
||||
toReport(row) { |
||||
this.$router.push(`/matchReport?reportId=${row.reportId}`) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.l-title { |
||||
margin-top: 20px; |
||||
font-size: 18px; |
||||
} |
||||
.table { |
||||
width: 100%; |
||||
border-collapse: collapse; |
||||
th, td { |
||||
padding: 12px; |
||||
border: 1px solid #ebeef5; |
||||
} |
||||
&.tc { |
||||
text-align: center; |
||||
} |
||||
th { |
||||
text-align: center; |
||||
background-color: #f8faff; |
||||
} |
||||
.icon { |
||||
margin-right: 10px; |
||||
font-size: 16px; |
||||
color: #7a7a7a; |
||||
cursor: pointer; |
||||
} |
||||
.plus { |
||||
margin-bottom: 10px; |
||||
text-align: right; |
||||
} |
||||
.line { |
||||
display: flex; |
||||
align-items: center; |
||||
margin-bottom: 10px; |
||||
.el-input { |
||||
margin-right: 15px; |
||||
} |
||||
} |
||||
} |
||||
.flex-center { |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
margin-bottom: 15px; |
||||
} |
||||
.text-center { |
||||
text-align: center; |
||||
} |
||||
</style> |
@ -0,0 +1,476 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="m-b-20 head-card"> |
||||
<div class="flex-between m-b-20"> |
||||
<el-page-header v-if="grades.length" @back="$router.back()" :content="grades[index].stageName + '/排名'"></el-page-header> |
||||
</div> |
||||
|
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<div class="tabs"> |
||||
<template v-for="(item, i) in grades"> |
||||
<a v-if="i === index || !item.stageId" :key="i" class="item" :class="{active: item.stageId == active}" @click="tabChange(item.stageId)">{{ item.stageName }}排名</a> |
||||
</template> |
||||
</div> |
||||
<div class="flex-between" style="margin: 20px 0"> |
||||
<div style="display: inline-flex;align-items: center"> |
||||
<el-radio v-model="type" :label="0" @change="typeChange">默认系统排序</el-radio> |
||||
<el-radio v-model="type" :label="1" @change="typeChange">手动上传</el-radio> |
||||
<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> |
||||
</div> |
||||
</div> |
||||
<el-table :data="list" class="table" ref="table" stripe header-align="center"> |
||||
<el-table-column type="index" width="60" label="排名" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.$index + (page - 1) * pageSize + 1 }} |
||||
</template> |
||||
</el-table-column> |
||||
<template v-if="competitionType == 1"> |
||||
<el-table-column prop="teamName" label="团队名称" min-width="150" align="center"></el-table-column> |
||||
<el-table-column prop="leaderName" label="队长" min-width="150" align="center"></el-table-column> |
||||
</template> |
||||
<el-table-column v-else prop="userName" label="学生姓名" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="schoolName" label="学校" min-width="100" align="center"></el-table-column> |
||||
<el-table-column prop="timeSum" label="用时" width="90" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.timeSum }}min |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="score" label="分数" width="90" align="center"></el-table-column> |
||||
<el-table-column label="得分详情" align="center" width="160"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="show(scope.row, scope.$index)">查看</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-dialog title="团队得分详情" :visible.sync="teamVisible" width="900px" :close-on-click-modal="false"> |
||||
<h6 v-if="active" style="margin-bottom: 10px;font-size: 16px;">团队名称:{{ curRow.teamName }} 阶段名称:{{ stageName }}</h6> |
||||
<table class="table tc"> |
||||
<tr> |
||||
<template v-if="!active"> |
||||
<th width="100">阶段</th> |
||||
<th width="100">团队成绩</th> |
||||
</template> |
||||
<th width="60">序号</th> |
||||
<th width="100">姓名</th> |
||||
<th width="100">学校</th> |
||||
<th width="100">用时</th> |
||||
<th width="100">分数</th> |
||||
<th width="100">得分详情</th> |
||||
</tr> |
||||
<tr v-for="(item, i) in teams" :key="i"> |
||||
<template v-if="!active && item.rowspan"> |
||||
<td :rowspan="item.rowspan">{{ item.stageName }}</td> |
||||
<td :rowspan="item.rowspan">{{ item.teamScore }}</td> |
||||
</template> |
||||
<td>{{ i + 1 }}</td> |
||||
<td>{{ item.userName }}</td> |
||||
<td>{{ item.schoolName }}</td> |
||||
<td>{{ item.timeSum }}min</td> |
||||
<td>{{ item.score }}</td> |
||||
<td> |
||||
<el-button type="text" @click="toReport(item)">查看</el-button> |
||||
</td> |
||||
</tr> |
||||
<tr v-if="!active"> |
||||
<td>综合得分</td> |
||||
<td>{{ totalScore }}</td> |
||||
<td colspan="6">总排名:第{{ curRow.index }}名</td> |
||||
</tr> |
||||
</table> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button size="small" type="primary" @click="teamVisible = false">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"> |
||||
<div style="text-align: center"> |
||||
<div style="margin-bottom: 10px;"> |
||||
<el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button> |
||||
</div> |
||||
<el-upload |
||||
ref="importStaff" |
||||
name="file" |
||||
accept=".xls,.xlsx" |
||||
:on-remove="handleRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.batchImportRanking" |
||||
:file-list="uploadList" |
||||
:headers="headers" |
||||
:data="{ |
||||
competitionId: this.id, |
||||
stageId: this.stageId, |
||||
isOverallRanking: active ? 0 : 1 |
||||
}" |
||||
> |
||||
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
||||
</el-upload> |
||||
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败,查看失败原因</el-link> |
||||
</div> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button size="small" @click="importVisible = false">取 消</el-button> |
||||
<el-button size="small" type="primary" @click="uploadSure">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from "@/setting"; |
||||
import util from "@/libs/util"; |
||||
import echarts from "echarts"; |
||||
import axios from 'axios'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
id: +this.$route.query.id, |
||||
stageId: +this.$route.query.stageId, |
||||
index: +this.$route.query.index, |
||||
method: this.$route.query.method, |
||||
competitionType: +this.$route.query.competitionType, |
||||
rule: +this.$route.query.rule, |
||||
headers: { |
||||
token: util.local.get(Setting.tokenKey) |
||||
}, |
||||
active: '', |
||||
grades: [], |
||||
list: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
type: 0, |
||||
teamVisible: false, |
||||
teams: [], |
||||
memberVisible: false, |
||||
members: [], |
||||
importVisible: false, |
||||
uploadList: [], |
||||
uploadFaild: false, |
||||
exportCode: '', |
||||
curRow: {}, |
||||
stageName: '', |
||||
totalScore: 0, |
||||
published: false, |
||||
uploadData: [], |
||||
sourceType: '' |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this.getStage() |
||||
}, |
||||
methods: { |
||||
// 获排名 |
||||
getData() { |
||||
// 查询是否已经发布排名 |
||||
this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || ''}&isOverallRanking=${this.active ? 0 : 1}`).then(({ whetherToPublish }) => { |
||||
// 如果已发布,查询发布上一次排名的来源——>默认顺序或者手动发布(返回数据:是否手动发布(1为是,0不是)) |
||||
whetherToPublish && this.$post(`${this.api.queryPublicationSource}?competitionId=${this.id}&stageId=${this.active || ''}&isOverallRanking=${this.active ? 0 : 1}`).then(({ source }) => { |
||||
this.sourceType = source |
||||
this.type = source == 1 ? 1 : 0 |
||||
}).catch(res => {}) |
||||
this.published = whetherToPublish |
||||
this.getRank(whetherToPublish) |
||||
}).catch(res => {}) |
||||
}, |
||||
// 查询排名 |
||||
getRank(whetherToPublish) { |
||||
// 已发布,则调已发布的排名接口 |
||||
if (whetherToPublish) { |
||||
console.log(44, this.active) |
||||
this.$post(this.api.manuallyRankTheUploadList, { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
competitionId: this.id, |
||||
isOverallRanking: this.active ? 0 : 1, |
||||
stageId: this.active || '' |
||||
}).then(({ message }) => { |
||||
this.list = message.records |
||||
this.total = message.total |
||||
}).catch(res => {}) |
||||
} else { // 未发布的排名接口 |
||||
if (!this.active) { |
||||
// 总分排名 |
||||
const ids = this.grades.map(e => e.stageId) |
||||
this.$post(this.api.overallStandingsInThePointsRace, { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
competitionId: this.id, |
||||
stageIds: ids.splice(0, ids.length - 1) |
||||
}).then(({ page }) => { |
||||
this.list = page |
||||
this.total = total |
||||
}).catch(res => {}) |
||||
} else { // 阶段排名 |
||||
this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}`).then(({ page, total }) => { |
||||
this.list = page |
||||
this.total = total |
||||
}).catch(res => {}) |
||||
} |
||||
} |
||||
}, |
||||
// 获取阶段 |
||||
getStage() { |
||||
this.$post(this.api.detailsOfCompetitionStage, { |
||||
pageNum: 1, |
||||
pageSize: 100, |
||||
contestId: this.id, |
||||
}).then(({ page }) => { |
||||
this.grades = page.records.slice(0, this.index + 1) |
||||
this.active = this.grades[this.index].stageId |
||||
// 积分赛才显示总分 |
||||
this.rule == 0 && this.grades.push({ |
||||
stageId: 0, |
||||
stageName: '总分' |
||||
}) |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}, |
||||
// 排序类型切换回调 |
||||
typeChange(val) { |
||||
this.getRank(val) |
||||
}, |
||||
initData() { |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
// tab回调 |
||||
tabChange(i) { |
||||
this.active = i |
||||
this.initData() |
||||
}, |
||||
// 查看详情 |
||||
show(row, i) { |
||||
// 个人:跳转实验报告,团队:弹框显示成员列表 |
||||
if (this.competitionType == 1) { |
||||
row.index = i + 1 |
||||
this.curRow = row |
||||
this.teamVisible = true |
||||
this.stageName = this.grades.find(e => e.stageId == this.active).stageName |
||||
const data = { |
||||
pageNum: 1, |
||||
pageSize: 100, |
||||
competitionId: this.id, |
||||
teamId: row.teamId |
||||
} |
||||
// 阶段传当前阶段的id,总分传所有阶段的id |
||||
if (this.active) { |
||||
data.stageId = this.active |
||||
this.$post(this.api.stageTeamScoreDetails, data).then(({ page }) => { |
||||
this.teams = page.records |
||||
}).catch(res => {}) |
||||
} else { |
||||
const ids = this.grades.map(e => e.stageId) |
||||
data.stageIds = ids.splice(0, ids.length - 1) |
||||
this.$post(this.api.detailsOfTotalTeamScores, data).then(({ data, resultCalculationMethod }) => { |
||||
const result = [] |
||||
let totalScore = 0 |
||||
// 合并数据 |
||||
data.map(e => { |
||||
const team = e.stageTeamInformation |
||||
if (team.length) { |
||||
// 第一条才赋值团队得分和合并行数 |
||||
const method = e.teamCalculationMethod |
||||
const scores = team.map(n => +n.score) |
||||
let score |
||||
// 根据团队规则计算方式计算团队得分 |
||||
if (method == 0) { // 最高分 |
||||
score = Math.max(scores) |
||||
} else if (method == 1) { // 平均分 |
||||
score = scores.reduce((prev, next) => prev + next) / scores.length |
||||
} else { // 求和 |
||||
score = scores.reduce((prev, next) => prev + next) |
||||
} |
||||
team[0].teamScore = score |
||||
team[0].rowspan = team.length |
||||
team.map(n => { |
||||
n = Object.assign(n, e) |
||||
}) |
||||
// 计算权重(权重为0则不计入总成绩) 团队得分*权重/100 总成绩计算方式选的是加权求和才需要计算 |
||||
if (e.pointWeight && !resultCalculationMethod) totalScore += score * e.pointWeight / 100 |
||||
result.push(...team) |
||||
} |
||||
}) |
||||
// 根据总成绩计算方式计算总分 |
||||
const teamScores = data.map(e => e.teamScore) |
||||
if (resultCalculationMethod === 1) { // 求和 |
||||
totalScore = teamScores.reduce((prev, next) => prev + next) |
||||
} else if (resultCalculationMethod === 2) { // 平均分 |
||||
totalScore = teamScores.reduce((prev, next) => prev + next) / teamScores.length |
||||
} |
||||
this.totalScore = totalScore |
||||
this.teams = result |
||||
}).catch(res => {}) |
||||
} |
||||
} else { |
||||
this.toReport(row) |
||||
} |
||||
}, |
||||
// 跳转实验报告 |
||||
toReport(row) { |
||||
this.$router.push(`/matchReport?reportId=${row.reportId}`) |
||||
}, |
||||
handleCurrentChange(val) { // 切换分页 |
||||
this.page = val; |
||||
this.getData(); |
||||
}, |
||||
// 发布排名 |
||||
publishSubmit() { |
||||
let data = this.uploadData // 手动上传后发布排名,数据直接取批量上传后返回的data |
||||
if (!this.type) { // 默认排序 |
||||
// 处理默认排序的数据 |
||||
const { list, id } = this |
||||
const isOverall = this.active ? 0 : 1 |
||||
if (list.length) { |
||||
const isPerson = this.competitionType == 0 |
||||
list.map(e => { |
||||
e.competitionId = id |
||||
e.isOverallRanking = isOverall |
||||
if (isOverall) delete e.stageId |
||||
if (isPerson) e.teamId = null // 个人赛则teamId传null |
||||
}) |
||||
data = list |
||||
} |
||||
} |
||||
// 发布前校验 |
||||
this.$post(`${this.api.releaseVerification}?competitionId=${this.id}&stageId=${this.active || ''}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => { |
||||
this.$post(this.api.publishRanking, data).then(res => { |
||||
this.uploadData = [] |
||||
this.getData() |
||||
util.successMsg('发布成功!') |
||||
}).catch(res => {}) |
||||
}).catch(res => {}) |
||||
}, |
||||
// 发布排名确认 |
||||
publish() { |
||||
// 如果已发布,并且上次发布的类型跟这次发布的类型不一致,则要提示确认 |
||||
if (this.published && this.sourceType != !this.type) { |
||||
this.$confirm(this.sourceType && !this.type ? |
||||
'手动排名已发布,是否要取消手动排名的内容,改为为系统排名的内容?' : |
||||
'默认系统排名已发布,是否要取消系统排名的内容,改为为手动发布的内容?', '提示', { |
||||
type: 'success' |
||||
}).then(() => { |
||||
this.publishSubmit() |
||||
}).catch(() => {}) |
||||
} else { |
||||
this.publishSubmit() |
||||
} |
||||
}, |
||||
// 取消发布排名 |
||||
cancelPublish(publish) { |
||||
const ids = this.grades.map(e => e.stageId) |
||||
const stageIds = ids.splice(0, ids.length - 1) |
||||
const query = [] |
||||
stageIds.map(e => { |
||||
query.push('stageIds=' + e) |
||||
}) |
||||
// 如果是发布排名,则先删除已发布的排名,再调发布排名的接口 |
||||
// 如果是取消发布,则直接调取消发布的接口 |
||||
if (publish) { |
||||
this.$post(this.api.deleteLastPublication, { |
||||
competitionId: this.id, |
||||
isOverallRanking: this.active ? 0 : 1, |
||||
stageIds: this.active ? [this.active] : stageIds |
||||
}).then(res => { |
||||
this.publish() |
||||
}).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.getData() |
||||
util.successMsg('取消发布成功!') |
||||
}).catch(res => {}) |
||||
} |
||||
}, |
||||
// 批量导入 |
||||
batchImport() { |
||||
this.importVisible = true |
||||
this.uploadList = [] |
||||
this.uploadFaild = false |
||||
}, |
||||
// 模板下载 |
||||
download() { |
||||
location.href = this.api[this.competitionType == 1 ? 'rankImportTeam' : 'rankImportPerson'] |
||||
}, |
||||
// 上传文件 |
||||
handleExceed(files, fileList) { |
||||
util.warningMsg( |
||||
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
||||
) |
||||
}, |
||||
// 下载失败文件 |
||||
showFaild() { |
||||
axios.get(`${this.api.rankExportFailure}?exportCode=${this.exportCode}&competitionId=${this.id}`, { |
||||
headers: this.headers, |
||||
responseType: 'blob' |
||||
}).then((res) => { |
||||
util.downloadFileDirect(`批量导入排名管理失败数据导出.xls`, new Blob([res.data])) |
||||
}).catch(res => {}) |
||||
}, |
||||
uploadSuccess(res, file, fileList) { |
||||
this.uploadFaild = false |
||||
if (res.status === 200) { |
||||
const { exportCode } = res.data |
||||
if (exportCode) { |
||||
this.exportCode = exportCode |
||||
this.uploadFaild = true |
||||
util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`) |
||||
} |
||||
this.uploadData = res.data.data |
||||
} else { |
||||
res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据") |
||||
} |
||||
}, |
||||
uploadError(err, file, fileList) { |
||||
this.$message({ |
||||
message: "上传出错,请重试!", |
||||
type: "error", |
||||
center: true |
||||
}) |
||||
}, |
||||
beforeRemove(file, fileList) { |
||||
return this.$confirm(`确定移除 ${file.name}?`) |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
this.uploadList = fileList |
||||
this.uploadFaild = false |
||||
}, |
||||
uploadSure() { |
||||
this.importVisible = false |
||||
this.list = this.uploadData |
||||
this.uploadData.length && util.successMsg('请检查数据后,点击发布排名以发布数据!') |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.table { |
||||
width: 100%; |
||||
border-collapse: collapse; |
||||
th, td { |
||||
padding: 12px; |
||||
border: 1px solid #ebeef5; |
||||
} |
||||
&.tc { |
||||
text-align: center; |
||||
} |
||||
th { |
||||
text-align: center; |
||||
background-color: #f8faff; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,370 @@ |
||||
<template> |
||||
<div class="wrap"> |
||||
<el-card shadow="hover" class="m-b-20"> |
||||
<el-page-header @back="$router.back()" content="查看报告"></el-page-header> |
||||
</el-card> |
||||
|
||||
<div class="content"> |
||||
<div class="text-right"> |
||||
<el-button type="primary" @click="exportPage">导出报告</el-button> |
||||
</div> |
||||
<h6 class="r-title">标准实验报告</h6> |
||||
<div class="info"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/info1.png" alt=""> |
||||
基本信息 |
||||
</h6> |
||||
<ul :class="['info-list', {edit: editing}]"> |
||||
<li> |
||||
<label>学生姓名:</label> |
||||
<el-input v-if="editing" v-model="infoData.userName" disabled></el-input> |
||||
<span v-else>{{ infoData.userName }}</span> |
||||
</li> |
||||
<li> |
||||
<label>学生学号:</label> |
||||
<el-input v-if="editing" v-model="infoData.workNumber" disabled></el-input> |
||||
<span v-else>{{ infoData.workNumber }}</span> |
||||
</li> |
||||
<li> |
||||
<label>实验时间:</label> |
||||
<el-input v-if="editing" v-model="infoData.submitTime" disabled></el-input> |
||||
<span v-else>{{ infoData.submitTime }}</span> |
||||
</li> |
||||
<li> |
||||
<label>实验成绩:</label> |
||||
<el-input v-if="editing" v-model="infoData.score" disabled></el-input> |
||||
<div v-else class="score-wrap"> |
||||
<em>{{ infoData.score }}</em> |
||||
<img src="@/assets/img/point.png" alt=""> |
||||
</div> |
||||
</li> |
||||
<li> |
||||
<label>学生班级:</label> |
||||
<el-input v-if="editing" v-model="infoData.workNumber"></el-input> |
||||
<span v-else>{{ infoData.workNumber }}</span> |
||||
</li> |
||||
<li> |
||||
<label>指导老师:</label> |
||||
<el-input v-if="editing" v-model="infoData.instructor"></el-input> |
||||
<span v-else>{{ infoData.instructor }}</span> |
||||
</li> |
||||
<li> |
||||
<label>实验学时:</label> |
||||
<el-input v-if="editing" v-model="infoData.period"></el-input> |
||||
<span v-else>{{ infoData.period }}</span> |
||||
</li> |
||||
</ul> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report2.png" alt=""> |
||||
实验项目名称 |
||||
</h6> |
||||
<el-input v-if="editing" v-model="form.projectName" type="textarea"></el-input> |
||||
<div v-else class="pre-wrap" v-html="form.projectName"></div> |
||||
</div> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report3.png" alt=""> |
||||
实验目的 |
||||
</h6> |
||||
<div :class="['pre-wrap', {edit: editing}]" v-html="form.purpose"></div> |
||||
</div> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report4.png" alt=""> |
||||
实验数据 |
||||
</h6> |
||||
<el-table :data="expData" class="table" border stripe header-align="center"> |
||||
<el-table-column type="index" label="序号" align="center" width="60"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.$index + 1 }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="judgmentName" label="判分点" width="270" align="center"></el-table-column> |
||||
<el-table-column v-if='project' prop="judgmentName" label="考核点" align="center" width="150"> |
||||
<template slot-scope="scope"> |
||||
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index"> |
||||
<span> |
||||
<span>{{index+1}}. </span>{{item.name}} |
||||
</span> |
||||
</div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="ruleAnswer" label="参考答案" style='word-wrap: break-word'> |
||||
<template slot-scope="scope"> |
||||
<div v-if='scope.row.lcRuleRecords'> |
||||
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index"> |
||||
<span> |
||||
<span>{{index+1}}. </span>{{item.ruleAnswer}} |
||||
</span> |
||||
</div> |
||||
</div> |
||||
<div v-else v-html="scope.row.referenceAnswer"></div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="userAnswer" label="学生答案"> |
||||
<template slot-scope="scope"> |
||||
<div v-if='scope.row.lcRuleRecords'> |
||||
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index"> |
||||
<span v-if='item.userAnswer'> |
||||
<span>{{index+1}}. </span>{{item.userAnswer}} |
||||
</span> |
||||
<span v-else> |
||||
<span>{{index+1}}. </span>未填写 |
||||
</span> |
||||
</div> |
||||
</div> |
||||
<div v-else v-html='scope.row.answer' style='white-space: pre-wrap'></div> |
||||
<template v-if="scope.row.runThePictureList"> |
||||
<img v-for="(img, i) in scope.row.runThePictureList" :key="i" width="200" class="result-pic" :src="img" alt=""> |
||||
</template> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="score" label="得分" width="80" align="center"></el-table-column> |
||||
</el-table> |
||||
</div> |
||||
<div class="m-b-20"> |
||||
<h6 class="l-title"> |
||||
<img src="@/assets/img/report5.png" alt=""> |
||||
实验总结与体会 |
||||
</h6> |
||||
<quill v-if="editing" :border="true" v-model="form.summarize" :minHeight="150" :height="150" /> |
||||
<div v-else class="pre-wrap" v-html="form.summarize"></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
reportId: this.$route.query.reportId, |
||||
title: "实验报告", |
||||
form: { |
||||
className: "", |
||||
instructor: "", |
||||
period: "", |
||||
projectName: "", |
||||
summarize: "", |
||||
}, |
||||
infoData: {}, |
||||
expData: [], |
||||
editing: false, |
||||
loadIns: null, |
||||
loading: false, |
||||
project:false, |
||||
userScores: [] |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
getData() { // 查询详情 |
||||
this.$get(`${this.api.reportDetail}?reportId=${this.reportId}`).then(({ report, userScores }) => { |
||||
this.form = report |
||||
this.expData = userScores |
||||
this.project = this.expData.find(e => e.lcRuleRecords) // 银行系统才有lcRuleRecords |
||||
let form = this.form; |
||||
this.infoData = { |
||||
workNumber: form.workNumber, |
||||
experimentalClassName: form.experimentalClassName, |
||||
instructor: form.instructor, |
||||
period: form.period, |
||||
laboratory: form.laboratory, |
||||
submitTime: form.submitTime, |
||||
score: form.score, |
||||
userName: form.userName |
||||
} |
||||
const data = report.data |
||||
this.userScores = userScores |
||||
// 如果没有data,则添加,否则,直接使用 |
||||
if (!data) { |
||||
this.handleList(userScores) |
||||
this.$post(this.api.editExperimentalData, { |
||||
reportId, |
||||
data: JSON.stringify(userScores) |
||||
}).then(res => {}).catch(err => {}) |
||||
} else { |
||||
this.handleList(userScores.find(e => e.lcRuleRecords) ? userScores : JSON.parse(data)) |
||||
} |
||||
}).catch(res => {}) |
||||
}, |
||||
// 处理实验数据 |
||||
handleList(list) { |
||||
this.project = list.find(e => e.lcRuleRecords) // 银行系统才有lcRuleRecords |
||||
if (this.project) { |
||||
list.map(e => { |
||||
e.assessmentPoint = '' |
||||
e.referenceAnswer = '' |
||||
e.answer = '' |
||||
e.lcRuleRecords.map((n, i) => { |
||||
e.assessmentPoint += `${i + 1}.${n.name}` |
||||
e.referenceAnswer += `${i + 1}.${n.ruleAnswer}` |
||||
e.answer += `${i + 1}.${n.userAnswer}` |
||||
}) |
||||
}) |
||||
} |
||||
this.expData = list |
||||
}, |
||||
exportPage() { |
||||
const form = Object.assign(this.form, this.infoData) |
||||
const list = JSON.parse(JSON.stringify(this.expData)) |
||||
list.map((e, i) => { |
||||
const item = this.userScores.find(n => n.judgmentId == e.judgmentId) |
||||
if (item && item.runThePicture) e.runThePicture = item.runThePicture |
||||
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList |
||||
e.id = i + 1 |
||||
// if (e.referenceAnswer && typeof e.referenceAnswer === 'string') e.referenceAnswer = e.referenceAnswer.replace(/<[^>]+>/g, '').replace(/( |&|%s)/g, '').replace(/>/g, '>').replace(/</g, '<') |
||||
if (e.answer && typeof e.answer === 'string') e.answer = e.answer.replace(/<[^>]+>/g, '').replace(/( |&|%s)/g, '').replace(/>/g, '>').replace(/</g, '<') |
||||
}) |
||||
for (const i in form) { |
||||
if (form[i] && typeof form[i] === 'string') form[i] = form[i].replace(/<[^>]+>/g, '') |
||||
} |
||||
form.purpose = form.purpose.replace(/<[^>]+>/g, '') |
||||
this.$post(this.project ? this.api.exportBankExperimentReport : this.api.exportLabReport, { |
||||
...form, |
||||
experimentalData: list |
||||
}).then(res => { |
||||
console.log(res) |
||||
util.downloadFileDirect(`实验报告.docx`,new Blob([res])) |
||||
}).catch(res => {}) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.wrap { |
||||
padding: 12px 300px 20px; |
||||
} |
||||
.text-right { |
||||
text-align: right; |
||||
} |
||||
code, kbd, samp{ |
||||
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; |
||||
word-wrap: break-word; |
||||
white-space: pre-wrap; |
||||
} |
||||
/deep/ pre{ |
||||
white-space: pre-wrap; /* css-3 */ |
||||
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ |
||||
white-space: pre-wrap; /* Opera 4-6 */ |
||||
white-space: -o-pre-wrap; /* Opera 7 */ |
||||
word-wrap: break-word; /* Internet Explorer 5.5+ */ |
||||
word-break:break-all; |
||||
overflow:hidden; |
||||
font-size: 12px; |
||||
font-weight:400; |
||||
font-family:'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif |
||||
} |
||||
.content { |
||||
padding: 16px 40px; |
||||
background: #fff; |
||||
&.loading { |
||||
padding-top: 30px; |
||||
} |
||||
.r-title { |
||||
margin-bottom: 40px; |
||||
font-size: 24px; |
||||
text-align: center; |
||||
color: #333; |
||||
} |
||||
.info { |
||||
padding: 20px 16px; |
||||
border: 1px solid #E1E6F2; |
||||
} |
||||
.l-title { |
||||
display: flex; |
||||
align-items: center; |
||||
padding: 5px 8px; |
||||
margin-bottom: 12px; |
||||
font-size: 14px; |
||||
color: #333; |
||||
background-color: #f7f5ff; |
||||
} |
||||
.info-list { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
padding: 10px 0 0 20px; |
||||
li { |
||||
display: inline-flex; |
||||
width: 23%; |
||||
padding: 0 10px; |
||||
margin-bottom: 34px; |
||||
} |
||||
&.edit { |
||||
li { |
||||
align-items: center; |
||||
} |
||||
} |
||||
label { |
||||
font-size: 14px; |
||||
color: #333; |
||||
white-space: nowrap; |
||||
} |
||||
span { |
||||
min-width: 150px; |
||||
padding: 0 10px 3px; |
||||
border-bottom: 1px solid #E1E6F2; |
||||
} |
||||
/deep/.el-input { |
||||
width: 174px; |
||||
} |
||||
} |
||||
.score-wrap { |
||||
position: relative; |
||||
min-width: 150px; |
||||
border-bottom: 1px solid #E1E6F2; |
||||
em { |
||||
position: absolute; |
||||
top: -12px; |
||||
left: 30px; |
||||
font-family: din; |
||||
font-size: 30px; |
||||
font-weight: 600; |
||||
color: #0B1D30; |
||||
} |
||||
img { |
||||
position: absolute; |
||||
bottom: -15px; |
||||
left: 0; |
||||
} |
||||
} |
||||
/deep/.el-textarea .el-textarea__inner, .pre-wrap { |
||||
min-height: 72px; |
||||
padding: 10px 16px; |
||||
font-size: 14px; |
||||
color: #333; |
||||
&.edit { |
||||
color: #ABB3C6; |
||||
border: 1px solid #CACFDB; |
||||
border-radius: 4px; |
||||
background-color: #F6F7F9; |
||||
} |
||||
} |
||||
/deep/ .table th { |
||||
background-color: #e5dfff !important; |
||||
.cell { |
||||
line-height: 35px; |
||||
color: #fff; |
||||
} |
||||
} |
||||
} |
||||
.result-pic { |
||||
margin: 10px 0; |
||||
} |
||||
@media (max-width: 1650px) { |
||||
.wrap { |
||||
padding: 12px 200px 20px; |
||||
} |
||||
} |
||||
@media (max-width: 1430px) { |
||||
.wrap { |
||||
padding: 12px 100px 20px; |
||||
} |
||||
} |
||||
</style> |
Loading…
Reference in new issue