|
|
|
@ -60,22 +60,27 @@ |
|
|
|
|
:label="1">是</el-radio> |
|
|
|
|
|
|
|
|
|
<template v-if="item.competitionStageContentSetting.whetherToUploadFiles"> |
|
|
|
|
<el-upload :on-remove="(file, fileList) => handleRemove(file, fileList, item)" |
|
|
|
|
<el-upload class="file-upload" |
|
|
|
|
:on-remove="(file, fileList) => handleRemove(file, fileList, item)" |
|
|
|
|
:on-error="uploadError" |
|
|
|
|
:before-remove="beforeRemove" |
|
|
|
|
:on-preview="handlePreview" |
|
|
|
|
action="" |
|
|
|
|
:file-list="item.competitionStageContentSetting.fileList" |
|
|
|
|
:http-request="res => handleRequest(res, item)"> |
|
|
|
|
<el-button size="small" |
|
|
|
|
type="primary">上传文件</el-button> |
|
|
|
|
</el-upload> |
|
|
|
|
<span style="margin: 0 10px 0 30px;">说明</span> |
|
|
|
|
<el-input maxlength="1000" |
|
|
|
|
placeholder="请输入内容" |
|
|
|
|
v-model="item.competitionStageContentSetting.stageExplain" |
|
|
|
|
style="width: calc(80% - 216px);"></el-input> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
<div style="display: flex;align-items: flex-start;margin-top: 10px"> |
|
|
|
|
<span style="margin: 0 10px 0 30px;">说明</span> |
|
|
|
|
<el-input maxlength="1000" |
|
|
|
|
placeholder="请输入内容" |
|
|
|
|
type="textarea" |
|
|
|
|
v-model="item.competitionStageContentSetting.stageExplain" |
|
|
|
|
style="width: calc(80% - 216px);"></el-input> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item class="req" |
|
|
|
|
label="比赛内容"> |
|
|
|
@ -314,13 +319,19 @@ export default { |
|
|
|
|
center: true |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
downloadFile () { |
|
|
|
|
// const { name, url } = this.fileList[0] |
|
|
|
|
// util.downloadFile(name, url) |
|
|
|
|
}, |
|
|
|
|
handlePreview (file) { |
|
|
|
|
window.open((util.isDoc(util.getFileExt(file.name)) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + file.url) |
|
|
|
|
}, |
|
|
|
|
beforeRemove (file, fileList) { |
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
|
}, |
|
|
|
|
handleRemove (file, fileList, item) { |
|
|
|
|
Oss.del(file.url) |
|
|
|
|
const i = item.competitionStageContentSetting.fileList.findIndex(e => e.url === file.url) |
|
|
|
|
item.competitionStageContentSetting.fileList.splice(i, 1) |
|
|
|
|
item.competitionStageContentSetting.fileList = fileList |
|
|
|
|
}, |
|
|
|
|
// 自定义上传 |
|
|
|
|
async handleRequest ({ file }, item) { |
|
|
|
@ -460,4 +471,15 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/deep/.file-upload { |
|
|
|
|
width: 500px; |
|
|
|
|
.download { |
|
|
|
|
position: absolute; |
|
|
|
|
bottom: -63px; |
|
|
|
|
right: 0; |
|
|
|
|
font-size: 12px; |
|
|
|
|
color: #007eff; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |