|
@@ -34,30 +34,36 @@ export default {
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
|
- this.exportLoading = true;
|
|
|
- this.$http
|
|
|
- .get(this.exportUrl, {
|
|
|
- params: {
|
|
|
- query: this.form
|
|
|
- },
|
|
|
- responseType: "arraybuffer"
|
|
|
- })
|
|
|
- .then(response => {
|
|
|
- if (response.data) {
|
|
|
- var blob = new Blob([response.data], {
|
|
|
- type:
|
|
|
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
- });
|
|
|
- var url = URL.createObjectURL(blob);
|
|
|
- var a = document.createElement("a");
|
|
|
- a.href = url;
|
|
|
- a.download = this.exportFileName + ".xlsx";
|
|
|
- a.target = "_blank";
|
|
|
- a.click();
|
|
|
- URL.revokeObjectURL(url);
|
|
|
- }
|
|
|
- this.exportLoading = false;
|
|
|
- });
|
|
|
+ this.$confirm("确定执行导出?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.exportLoading = true;
|
|
|
+ this.$http
|
|
|
+ .get(this.exportUrl, {
|
|
|
+ params: {
|
|
|
+ query: this.form
|
|
|
+ },
|
|
|
+ responseType: "arraybuffer"
|
|
|
+ })
|
|
|
+ .then(response => {
|
|
|
+ if (response.data) {
|
|
|
+ var blob = new Blob([response.data], {
|
|
|
+ type:
|
|
|
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
+ });
|
|
|
+ var url = URL.createObjectURL(blob);
|
|
|
+ var a = document.createElement("a");
|
|
|
+ a.href = url;
|
|
|
+ a.download = this.exportFileName + ".xlsx";
|
|
|
+ a.target = "_blank";
|
|
|
+ a.click();
|
|
|
+ URL.revokeObjectURL(url);
|
|
|
+ }
|
|
|
+ this.exportLoading = false;
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|