资料下载--批量下载
This commit is contained in:
@@ -112,7 +112,8 @@ export default {
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/project/payWorkingGroupDistributionRecord/listForFile'
|
||||
list: '/project/payWorkingGroupDistributionRecord/listForFile',
|
||||
exportXlsUrl: '/project/payWorkingGroupDistributionRecord/zipFile'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -133,15 +134,19 @@ export default {
|
||||
this.$message.warn('请至少选择一个文件')
|
||||
return
|
||||
}
|
||||
// 获取文件名称
|
||||
let fileName = ''
|
||||
if (!fileName || typeof fileName != 'string') {
|
||||
fileName = '导出文件'
|
||||
}
|
||||
// 获取文件名称
|
||||
let firstFile = this.dataSource.filter(tt => tt.fileId === this.selectedRowKeys[0])
|
||||
fileName = `${firstFile[0].fileName}等${this.selectedRowKeys.length}个文件.zip`
|
||||
let fileIdStr = this.selectedRowKeys.join(',')
|
||||
batchDownloadFile({ ids: fileIdStr }).then(res => {
|
||||
// 调用a标签下载文件的方法
|
||||
downloadFileByA(res, fileName)
|
||||
})
|
||||
fileName = `${firstFile[0].fileName}等${this.selectedRowKeys.length}个文件`
|
||||
let param = this.getQueryParams()
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||
param['ids'] = this.selectedRowKeys.join(',')
|
||||
}
|
||||
console.log('导出参数', param)
|
||||
downloadFile(this.url.exportXlsUrl, fileName + '.zip', param)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user