【修改】调整下载传参

This commit is contained in:
zhoulingpo
2023-05-25 15:07:03 +08:00
parent 1f9d6948f3
commit 1cfcb3ce52
7 changed files with 1335 additions and 5 deletions
@@ -120,6 +120,7 @@
<el-upload :disabled="formControl" action="/library/api/report/uploadFile" :show-file-list="true"
:before-upload="beforeUploadFile" :on-remove="handleRemove"
:file-list="fileList" multiple :on-success="onSuccess"
:on-preview="handlePreview"
drag :class="{'disable':formControl}">
<i class="el-icon-upload" ></i>
<div class="el-upload__text">点击或拖拽上传文件</div>
@@ -297,7 +298,20 @@ export default {
}
},
methods: {
handlePreview(file){
let lastName=file.name.split('.')
let list=['xls','xlsx']
if(list.indexOf(lastName[lastName.length-1].toLower)==-1){
if(this.form.id|| this.form.reportId ) {
this.$api.report.reportDownload({reportId: this.form.id || this.form.reportId, fileId: file.id}).then(res => {
downloadFile(res)
})
}
}else{
this.$message.warning("当前.xls,.xlsx文件不支持下载")
}
},
changeDate(d){
this.form.secrecyLast = new Date(d)
},