From 94310c4f3d89b936bed834dad5aaa44c0b58747d Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Sat, 18 Sep 2021 21:20:45 +0800
Subject: [PATCH] 代码生成点击预览重置激活tab

---
 ruoyi-ui/src/components/ImageUpload/index.vue |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue
index 8597595..1f3a9c1 100644
--- a/ruoyi-ui/src/components/ImageUpload/index.vue
+++ b/ruoyi-ui/src/components/ImageUpload/index.vue
@@ -111,9 +111,11 @@
   methods: {
     // 删除图片
     handleRemove(file, fileList) {
-      const findex = this.fileList.indexOf(file.name);
-      this.fileList.splice(findex, 1);
-      this.$emit("input", this.listToString(this.fileList));
+      const findex = this.fileList.map(f => f.name).indexOf(file.name);
+      if(findex > -1) {
+        this.fileList.splice(findex, 1);
+        this.$emit("input", this.listToString(this.fileList));
+      }
     },
     // 上传成功回调
     handleUploadSuccess(res) {

--
Gitblit v1.9.3