ソースを参照

大数据量导出加确认 框

chenken 6 年 前
コミット
f35a0d5e14
1 ファイル変更30 行追加24 行削除
  1. 30 24
      src/modules/oe/component/commonExport.vue

+ 30 - 24
src/modules/oe/component/commonExport.vue

@@ -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;
+          });
+      });
     }
   }
 };