修改异步执行

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 * @param parameter
* @returns {*} * @returns {*}
*/ */
export function downloadFile(url, fileName, parameter) { export function downloadFile(url, fileName, parameter,callback) {
return downFile(url, parameter).then((data) => { return downFile(url, parameter).then((data) => {
if (!data || data.size === 0) { if (!data || data.size === 0) {
Vue.prototype['$message'].warning('文件下载失败') Vue.prototype['$message'].warning('文件下载失败')
@@ -139,6 +139,7 @@ export function downloadFile(url, fileName, parameter) {
document.body.removeChild(link) //下载完成移除元素 document.body.removeChild(link) //下载完成移除元素
window.URL.revokeObjectURL(url) //释放掉blob对象 window.URL.revokeObjectURL(url) //释放掉blob对象
} }
callback && callback()
}) })
} }
@@ -41,6 +41,7 @@
editTable再传操作按钮的同时把事件定义名称也传过去 editTable再传操作按钮的同时把事件定义名称也传过去
--> -->
<tableData <tableData
ref="tableDataRef"
:flag="'1'" :flag="'1'"
:OperationList="OperationList" :OperationList="OperationList"
@editTable="editTable" @editTable="editTable"
@@ -125,18 +126,22 @@
//导出 //导出
handleExport() { handleExport() {
let query = { let query = {
...this.$refs.searchRef.queryParam, ...this.$refs.searchRef.queryParam,
id:this.idList.join(',') 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() { handleFileExport() {
let query = { let query = {
...this.$refs.searchRef.queryParam, ...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() { handleAdd() {
@@ -175,7 +180,7 @@
}) })
}, },
//导入 //导入
handleImport(){ handleImport() {
}, },
//编辑按钮 //编辑按钮