From d9e54388e7fde2462e8b7e0165c5e7da3f202593 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 07 七月 2022 19:07:59 +0800
Subject: [PATCH] add 整合 springdoc-openapi-javadoc 基于代码注释生成文档

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

diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue
index acd4670..6219979 100644
--- a/ruoyi-ui/src/components/ImageUpload/index.vue
+++ b/ruoyi-ui/src/components/ImageUpload/index.vue
@@ -44,7 +44,7 @@
 
 <script>
 import { getToken } from "@/utils/auth";
-import { delOss } from "@/api/system/oss";
+import { listByIds, delOss } from "@/api/system/oss";
 
 export default {
   props: {
@@ -87,10 +87,17 @@
   },
   watch: {
     value: {
-      handler(val) {
+      async handler(val) {
         if (val) {
           // 棣栧厛灏嗗�艰浆涓烘暟缁�
-          const list = Array.isArray(val) ? val : this.value.split(',');
+          let list;
+          if (Array.isArray(val)) {
+            list = val;
+          } else {
+            await listByIds(val).then(res => {
+              list = res.data;
+            })
+          }
           // 鐒跺悗灏嗘暟缁勮浆涓哄璞℃暟缁�
           this.fileList = list.map(item => {
             // 姝ゅname浣跨敤ossId 闃叉鍒犻櫎鍑虹幇閲嶅悕
@@ -120,7 +127,7 @@
         let ossId = this.fileList[findex].ossId;
         delOss(ossId);
         this.fileList.splice(findex, 1);
-        this.$emit("input", this.fileList);
+        this.$emit("input", this.listToString(this.fileList));
       }
     },
     // 涓婁紶鎴愬姛鍥炶皟
@@ -131,7 +138,7 @@
           this.fileList = this.fileList.concat(this.uploadList);
           this.uploadList = [];
           this.number = 0;
-          this.$emit("input", this.fileList);
+          this.$emit("input", this.listToString(this.fileList));
           this.$modal.closeLoading();
         }
       } else {
@@ -184,6 +191,15 @@
       this.dialogImageUrl = file.url;
       this.dialogVisible = true;
     },
+    // 瀵硅薄杞垚鎸囧畾瀛楃涓插垎闅�
+    listToString(list, separator) {
+      let strs = "";
+      separator = separator || ",";
+      for (let i in list) {
+        strs += list[i].ossId + separator;
+      }
+      return strs != "" ? strs.substr(0, strs.length - 1) : "";
+    },
   }
 };
 </script>

--
Gitblit v1.9.3