From 927b05713a25340f3ba3a58bdd42ca2129060c4a Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期五, 25 二月 2022 11:51:29 +0800
Subject: [PATCH] 组件fileUpload支持多文件同时选择上传

---
 ruoyi-ui/src/components/ImageUpload/index.vue |   23 +++++++----------------
 1 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue
index bf04c5b..71172c1 100644
--- a/ruoyi-ui/src/components/ImageUpload/index.vue
+++ b/ruoyi-ui/src/components/ImageUpload/index.vue
@@ -133,7 +133,7 @@
         this.uploadList = [];
         this.number = 0;
         this.$emit("input", this.listToString(this.fileList));
-        this.loading.close();
+        this.$modal.closeLoading();
       }
     },
     // 涓婁紶鍓峫oading鍔犺浇
@@ -154,36 +154,27 @@
       }
 
       if (!isImg) {
-        this.$message.error(
-          `鏂囦欢鏍煎紡涓嶆纭�, 璇蜂笂浼�${this.fileType.join("/")}鍥剧墖鏍煎紡鏂囦欢!`
-        );
+        this.$modal.msgError(`鏂囦欢鏍煎紡涓嶆纭�, 璇蜂笂浼�${this.fileType.join("/")}鍥剧墖鏍煎紡鏂囦欢!`);
         return false;
       }
       if (this.fileSize) {
         const isLt = file.size / 1024 / 1024 < this.fileSize;
         if (!isLt) {
-          this.$message.error(`涓婁紶澶村儚鍥剧墖澶у皬涓嶈兘瓒呰繃 ${this.fileSize} MB!`);
+          this.$modal.msgError(`涓婁紶澶村儚鍥剧墖澶у皬涓嶈兘瓒呰繃 ${this.fileSize} MB!`);
           return false;
         }
       }
-      this.loading = this.$loading({
-        lock: true,
-        text: "涓婁紶涓�",
-        background: "rgba(0, 0, 0, 0.7)",
-      });
+      this.$modal.loading("姝e湪涓婁紶鍥剧墖锛岃绋嶅��...");
       this.number++;
     },
     // 鏂囦欢涓暟瓒呭嚭
     handleExceed() {
-      this.$message.error(`涓婁紶鏂囦欢鏁伴噺涓嶈兘瓒呰繃 ${this.limit} 涓�!`);
+      this.$modal.msgError(`涓婁紶鏂囦欢鏁伴噺涓嶈兘瓒呰繃 ${this.limit} 涓�!`);
     },
     // 涓婁紶澶辫触
     handleUploadError() {
-      this.$message({
-        type: "error",
-        message: "涓婁紶澶辫触",
-      });
-      this.loading.close();
+      this.$modal.msgError("涓婁紶鍥剧墖澶辫触锛岃閲嶈瘯");
+      this.$modal.closeLoading();
     },
     // 棰勮
     handlePictureCardPreview(file) {

--
Gitblit v1.9.3