Procházet zdrojové kódy

上传中状态添加loading

lkk před 8 měsíci
rodič
revize
429c730f80
1 změnil soubory, kde provedl 14 přidání a 1 odebrání
  1. 14 1
      src/views/remote/satellite/index.vue

+ 14 - 1
src/views/remote/satellite/index.vue

@@ -368,6 +368,7 @@ export default {
       rules: {},
       fileList: [],
       fileUpload: false, //文件上传弹窗
+      loading2:null,
     };
   },
   created() {
@@ -387,9 +388,21 @@ export default {
       console.log(file, "filefile");
       const formdata = new FormData();
       formdata.append("file", file.raw);
+      // this.loading2 = true;
+      this.loading2 = this.$loading({
+        lock: true,
+        text: "文件上传中",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
+      });
+
       tiffUpload(formdata).then((res) => {
         if (res.success) {
-          this.$message(res.message);
+          // this.loading2 = false;
+          this.loading2.close();
+          this.fileUpload = false;
+          this.getList();
+          this.$message.success(res.message);
         }
       });
     },