|
|
|
@ -74,7 +74,7 @@ |
|
|
|
|
<template v-if="form.releaseType"> |
|
|
|
|
<div class="l-title"><img src="@/assets/img/label.png" |
|
|
|
|
alt=""> 赛程、规则与内容</div> |
|
|
|
|
<h6 class="rule-title">共{{ form.competitionStage.length }}个竞赛阶段,同一个团队每个成员只能参加一个阶段赛项</h6> |
|
|
|
|
<h6 class="rule-title">共{{ form.competitionStage.length }}个竞赛阶段<template v-if="info.teamLimit">,同一个团队每个成员只能参加一个阶段赛项</template></h6> |
|
|
|
|
<div v-for="(rule, i) in form.competitionStage" |
|
|
|
|
:key="i" |
|
|
|
|
class="rule"> |
|
|
|
@ -617,16 +617,15 @@ |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="阶段赛名称" |
|
|
|
|
<el-dialog :title="curStage ? curStage.stageName : ''" |
|
|
|
|
:visible.sync="stageVisible" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
width="600px" |
|
|
|
|
@close="stageClose"> |
|
|
|
|
<template v-if="curStage && curStage.competitionStageContentSetting"> |
|
|
|
|
<div> |
|
|
|
|
<div v-if="curStage.competitionStageContentSetting.systemLink"> |
|
|
|
|
<span class="fs-14">进入比赛:</span> |
|
|
|
|
<el-button v-if="curStage.competitionStageContentSetting.systemLink" |
|
|
|
|
type="danger" |
|
|
|
|
<el-button type="danger" |
|
|
|
|
style="font-size: 13px" |
|
|
|
|
@click="toOffline">进入{{ curStage.stageName }}</el-button> |
|
|
|
|
</div> |
|
|
|
@ -643,7 +642,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- :http-request="handleRequest" --> |
|
|
|
|
<div class="flex m-b-20"> |
|
|
|
|
<span class="fs-14">文件上传:</span> |
|
|
|
|
<el-upload :before-upload="beforeUpload" |
|
|
|
@ -658,13 +657,14 @@ |
|
|
|
|
:file-list="fileList" |
|
|
|
|
name="file"> |
|
|
|
|
<el-button size="small" |
|
|
|
|
type="primary">上传文件</el-button> |
|
|
|
|
type="primary" |
|
|
|
|
:disabled="!!(fileList && fileList.length)">{{ fileList && fileList.length ? '已上传' : '上传文件' }}</el-button> |
|
|
|
|
<div slot="tip" |
|
|
|
|
class="el-upload__tip"> |
|
|
|
|
|
|
|
|
|
<el-progress v-if="showProgress" |
|
|
|
|
<!-- <el-progress v-if="showProgress" |
|
|
|
|
:stroke-width="3" |
|
|
|
|
:percentage="progressPercent"></el-progress> |
|
|
|
|
:percentage="progressPercent"></el-progress> --> |
|
|
|
|
<p>请上传大小1G以内的文件,支持常见文件格式。</p> |
|
|
|
|
<p>只允许上传一个文件,如有多个文件则需打包再上传。</p> |
|
|
|
|
</div> |
|
|
|
@ -689,6 +689,7 @@ import util from '@/libs/util' |
|
|
|
|
import Setting from "@/setting" |
|
|
|
|
import Const from '@/const/match' |
|
|
|
|
import axios from 'axios' |
|
|
|
|
import OSS from 'ali-oss' |
|
|
|
|
export default { |
|
|
|
|
name: 'matchdetail', |
|
|
|
|
data () { |
|
|
|
@ -922,7 +923,6 @@ export default { |
|
|
|
|
const e = stages[i] |
|
|
|
|
const startTime = new Date(e.startTime) |
|
|
|
|
const endTime = new Date(e.endTime) |
|
|
|
|
console.log("🚀 ~ file: index.vue:901 ~ //this.timer=setInterval ~ form.competitionRegistration:", stages, startTime, endTime, now >= startTime && now <= endTime) |
|
|
|
|
if (now < startTime) { // 阶段比赛未开始,不显示进入比赛按钮 |
|
|
|
|
endText = '阶段开始' |
|
|
|
|
total = startTime - now |
|
|
|
@ -942,7 +942,6 @@ export default { |
|
|
|
|
// 当系统链接不为空,且上传文件为否时,点击入口,直接跳转到链接页面,无需弹窗 |
|
|
|
|
// 当上传文件为是时,点击入口需弹窗,共两种样式 |
|
|
|
|
this.statusList[4] = '进入' + e.stageName |
|
|
|
|
console.log("🚀 ~ file: index.vue:924 ~ //this.timer=setInterval ~ e:", e, this.playingStages) |
|
|
|
|
curStage = e |
|
|
|
|
} |
|
|
|
|
endText = '阶段结束' |
|
|
|
@ -1456,6 +1455,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 删除文件表里的文件 |
|
|
|
|
handleRemove () { |
|
|
|
|
this.fileList = [] |
|
|
|
|
this.curFileId && this.$post(this.api.cCompetitionStageFileDel, [this.curFileId]).then(res => { |
|
|
|
|
this.curFileId = '' |
|
|
|
|
}).catch(res => { }) |
|
|
|
@ -1464,6 +1464,10 @@ export default { |
|
|
|
|
const result = res.filesResult |
|
|
|
|
// 有上传记录,则删除上次的文件 |
|
|
|
|
this.handleRemove() |
|
|
|
|
this.fileList = [{ |
|
|
|
|
name: result.originalFileName, |
|
|
|
|
url: result.fileUrl |
|
|
|
|
}] |
|
|
|
|
this.$post(this.api.cCompetitionStageFileSave, { |
|
|
|
|
competitionId: this.id, |
|
|
|
|
fileFormat: result.fileType, |
|
|
|
@ -1478,6 +1482,44 @@ export default { |
|
|
|
|
util.successMsg(`上传成功!`); |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
progress (p, _checkpoint) { |
|
|
|
|
// Object的上传进度。 |
|
|
|
|
console.log(p); |
|
|
|
|
// 分片上传的断点信息。 |
|
|
|
|
console.log(_checkpoint); |
|
|
|
|
}, |
|
|
|
|
// 自定义上传 |
|
|
|
|
async handleRequest (options) { |
|
|
|
|
const { file } = options |
|
|
|
|
const headers = { |
|
|
|
|
// 指定Object的存储类型。 |
|
|
|
|
'x-oss-storage-class': 'Standard', |
|
|
|
|
// 指定Object的访问权限。 |
|
|
|
|
// 'x-oss-object-acl': 'private', |
|
|
|
|
// 通过文件URL访问文件时,指定以附件形式下载文件,下载后的文件名称定义为example.txt。 |
|
|
|
|
// 'Content-Disposition': 'attachment; filename="example.txt"', |
|
|
|
|
// 设置Object的标签,可同时设置多个标签。 |
|
|
|
|
'x-oss-tagging': 'Tag1=1&Tag2=2', |
|
|
|
|
// 指定PutObject操作时是否覆盖同名目标Object。此处设置为true,表示禁止覆盖同名Object。 |
|
|
|
|
'x-oss-forbid-overwrite': 'true', |
|
|
|
|
}; |
|
|
|
|
const client = new OSS({ |
|
|
|
|
region: 'oss-cn-shenzhen', |
|
|
|
|
accessKeyId: 'LTAI4FzqQHnk4rozqLZ8jCNj', |
|
|
|
|
accessKeySecret: 'mveW7B1OyFoKUkHm8WsxmrjHmkJWHq', |
|
|
|
|
bucket: 'huoran' |
|
|
|
|
}) |
|
|
|
|
const res = await client.multipartUpload(file.name, file, { |
|
|
|
|
progress: this.progress, |
|
|
|
|
// headers, |
|
|
|
|
// 指定meta参数,自定义Object的元信息。通过head接口可以获取到Object的meta数据。 |
|
|
|
|
meta: { |
|
|
|
|
year: 2020, |
|
|
|
|
people: 'test', |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
console.log("🚀 ~ file: index.vue:1505 ~ handleRequest ~ res:", res) |
|
|
|
|
}, |
|
|
|
|
// 提交阶段内容 |
|
|
|
|
stageSubmit () { |
|
|
|
|
if (this.submiting) return false |
|
|
|
|