Quellcode durchsuchen

添加移除全部方法

xiaohaizhao vor 2 Jahren
Ursprung
Commit
cd469b047c
1 geänderte Dateien mit 16 neuen und 0 gelöschten Zeilen
  1. 16 0
      components/Yl_Files/index.js

+ 16 - 0
components/Yl_Files/index.js

@@ -171,6 +171,22 @@ Component({
                 data.list.push(v);
             });
             return data
+        },
+        deleteAll() {
+            let linksids = this.getFiles().list.map(v => v.linksid);
+            if (linksids.length) _Http.basic({
+                "classname": "system.attachment.Attachment",
+                "method": "deleteFileLink",
+                "content": {
+                    linksids
+                }
+            }).then(res => {
+                console.log("删除所有未保存附件", linksids, res)
+                if (res.msg != '成功') return wx.showToast({
+                    title: res.data,
+                    icon: "none"
+                });
+            });
         }
     }
 })