【修改】调整下载传参
This commit is contained in:
@@ -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)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user