From 2af534eea471f4adb104906c7a814bcc66d4d68d Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期一, 13 九月 2021 13:03:58 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev

---
 ruoyi-ui/src/components/ImageUpload/index.vue |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue
index ba088b9..fcf010d 100644
--- a/ruoyi-ui/src/components/ImageUpload/index.vue
+++ b/ruoyi-ui/src/components/ImageUpload/index.vue
@@ -18,7 +18,7 @@
     >
       <i class="el-icon-plus"></i>
     </el-upload>
-
+    
     <!-- 涓婁紶鎻愮ず -->
     <div class="el-upload__tip" slot="tip" v-if="showTip">
       璇蜂笂浼�
@@ -113,8 +113,10 @@
     // 鍒犻櫎鍥剧墖
     handleRemove(file, fileList) {
       const findex = this.fileList.map(f => f.name).indexOf(file.name);
-      this.fileList.splice(findex, 1);
-      this.$emit("input", this.listToString(this.fileList));
+      if(findex > -1) {
+        this.fileList.splice(findex, 1);
+        this.$emit("input", this.listToString(this.fileList));
+      }
     },
     // 涓婁紶鎴愬姛鍥炶皟
     handleUploadSuccess(res) {
@@ -187,24 +189,23 @@
       for (let i in list) {
         strs += list[i].url + separator;
       }
-      return strs != "" ? strs.substr(0, strs.length - 1) : "";
-    },
-  },
+      return strs != '' ? strs.substr(0, strs.length - 1) : '';
+    }
+  }
 };
 </script>
 <style scoped lang="scss">
 // .el-upload--picture-card 鎺у埗鍔犲彿閮ㄥ垎
 ::v-deep.hide .el-upload--picture-card {
-  display: none;
+    display: none;
 }
 // 鍘绘帀鍔ㄧ敾鏁堟灉
 ::v-deep .el-list-enter-active,
 ::v-deep .el-list-leave-active {
-  transition: all 0s;
+    transition: all 0s;
 }
 
-::v-deep .el-list-enter,
-.el-list-leave-active {
+::v-deep .el-list-enter, .el-list-leave-active {
   opacity: 0;
   transform: translateY(0);
 }

--
Gitblit v1.9.3