导出增加节流锁
This commit is contained in:
		| @@ -55,12 +55,16 @@ export default { | |||||||
|       return this.$slots.default |       return this.$slots.default | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|  |   data() { | ||||||
|  |     return {lock: false} | ||||||
|  |   }, | ||||||
|   methods: { |   methods: { | ||||||
|     onExport() { |     onExport() { | ||||||
|       if (this.disabled) { |       if (this.disabled) { | ||||||
|         return this.$message.error('暂无数据') |         return this.$message.error('暂无数据') | ||||||
|       } |       } | ||||||
|  |       if (this.lock) return this.$message.warn("正在处理中,请勿重复操作!") | ||||||
|  |       this.lock = true | ||||||
|       this.instance.post(this.url, this.params, { |       this.instance.post(this.url, this.params, { | ||||||
|         responseType: 'blob', |         responseType: 'blob', | ||||||
|         params: this.params, |         params: this.params, | ||||||
| @@ -87,7 +91,7 @@ export default { | |||||||
|           link.click() |           link.click() | ||||||
|           document.body.removeChild(link) |           document.body.removeChild(link) | ||||||
|         } |         } | ||||||
|       }) |       }).finally(() => this.lock = false) | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user