修改异步执行

This commit is contained in:
qq787203167
2022-02-25 10:48:32 +08:00
parent 54efa7fe1a
commit b6f9b323ea
2 changed files with 13 additions and 7 deletions
+2 -1
View File
@@ -120,7 +120,7 @@ export function downFile(url,parameter){
* @param parameter
* @returns {*}
*/
export function downloadFile(url, fileName, parameter) {
export function downloadFile(url, fileName, parameter,callback) {
return downFile(url, parameter).then((data) => {
if (!data || data.size === 0) {
Vue.prototype['$message'].warning('文件下载失败')
@@ -139,6 +139,7 @@ export function downloadFile(url, fileName, parameter) {
document.body.removeChild(link) //下载完成移除元素
window.URL.revokeObjectURL(url) //释放掉blob对象
}
callback && callback()
})
}
@@ -41,6 +41,7 @@
editTable再传操作按钮的同时把事件定义名称也传过去
-->
<tableData
ref="tableDataRef"
:flag="'1'"
:OperationList="OperationList"
@editTable="editTable"
@@ -125,18 +126,22 @@
//导出
handleExport() {
let query = {
...this.$refs.searchRef.queryParam,
id:this.idList.join(',')
...this.$refs.searchRef.queryParam,
id: this.idList.join(',')
}
downloadFile('document/bussDocumentLibraryEO/exportTemplate', '文档库.xls', query)
downloadFile('document/bussDocumentLibraryEO/exportTemplate', '文档库.xls', query,this.Deselect)
},
Deselect() {
this.$refs.tableDataRef.selectedRowKeys = []
this.idList = []
},
//带文件导出
handleFileExport() {
let query = {
...this.$refs.searchRef.queryParam,
id:this.idList.join(',')
id: this.idList.join(',')
}
downloadFile('document/bussDocumentLibraryEO/exportZip', '文档库.zip', query)
downloadFile('document/bussDocumentLibraryEO/exportZip', '文档库.zip', query,this.Deselect)
},
//新增
handleAdd() {
@@ -175,7 +180,7 @@
})
},
//导入
handleImport(){
handleImport() {
},
//编辑按钮