|
|
@ -60,21 +60,26 @@ |
|
|
|
:label="1">是</el-radio> |
|
|
|
:label="1">是</el-radio> |
|
|
|
|
|
|
|
|
|
|
|
<template v-if="item.competitionStageContentSetting.whetherToUploadFiles"> |
|
|
|
<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" |
|
|
|
:on-error="uploadError" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
|
|
|
|
:on-preview="handlePreview" |
|
|
|
action="" |
|
|
|
action="" |
|
|
|
:file-list="item.competitionStageContentSetting.fileList" |
|
|
|
:file-list="item.competitionStageContentSetting.fileList" |
|
|
|
:http-request="res => handleRequest(res, item)"> |
|
|
|
:http-request="res => handleRequest(res, item)"> |
|
|
|
<el-button size="small" |
|
|
|
<el-button size="small" |
|
|
|
type="primary">上传文件</el-button> |
|
|
|
type="primary">上传文件</el-button> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div style="display: flex;align-items: flex-start;margin-top: 10px"> |
|
|
|
<span style="margin: 0 10px 0 30px;">说明</span> |
|
|
|
<span style="margin: 0 10px 0 30px;">说明</span> |
|
|
|
<el-input maxlength="1000" |
|
|
|
<el-input maxlength="1000" |
|
|
|
placeholder="请输入内容" |
|
|
|
placeholder="请输入内容" |
|
|
|
|
|
|
|
type="textarea" |
|
|
|
v-model="item.competitionStageContentSetting.stageExplain" |
|
|
|
v-model="item.competitionStageContentSetting.stageExplain" |
|
|
|
style="width: calc(80% - 216px);"></el-input> |
|
|
|
style="width: calc(80% - 216px);"></el-input> |
|
|
|
</template> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="req" |
|
|
|
<el-form-item class="req" |
|
|
@ -314,13 +319,19 @@ export default { |
|
|
|
center: true |
|
|
|
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) { |
|
|
|
beforeRemove (file, fileList) { |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleRemove (file, fileList, item) { |
|
|
|
handleRemove (file, fileList, item) { |
|
|
|
Oss.del(file.url) |
|
|
|
Oss.del(file.url) |
|
|
|
const i = item.competitionStageContentSetting.fileList.findIndex(e => e.url === file.url) |
|
|
|
item.competitionStageContentSetting.fileList = fileList |
|
|
|
item.competitionStageContentSetting.fileList.splice(i, 1) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 自定义上传 |
|
|
|
// 自定义上传 |
|
|
|
async handleRequest ({ file }, item) { |
|
|
|
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> |
|
|
|
</style> |