浏览代码

替换时如果上一张是临时图片 执行删除

xiaohaizhao 1 年之前
父节点
当前提交
b4d7c05a51
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      packageA/dailyYttendance/makePoster.vue

+ 5 - 4
packageA/dailyYttendance/makePoster.vue

@@ -146,7 +146,7 @@ export default {
         }
     },
     beforeDestroy() {
-        if (this.file.ownertable == "temporary") this.deteleFiles([this.file.linksid])
+        this.deteleFiles()
     },
     methods: {
         saveTheImage() {
@@ -216,6 +216,7 @@ export default {
             });
         },
         handleFileLink(attachmentids, ownertable = "temporary", ownerid = 1, data) {
+            this.deteleFiles()
             this.$Http.basic({
                 "classname": "system.attachment.Attachment",
                 "method": "createFileLink",
@@ -232,12 +233,12 @@ export default {
             })
         },
         //删除附件
-        deteleFiles(linksids) {
-            this.$Http.basic({
+        deteleFiles() {
+            if (this.file.ownertable == "temporary") this.$Http.basic({
                 "classname": "system.attachment.Attachment",
                 "method": "deleteFileLink",
                 "content": {
-                    linksids
+                    linksids: [this.file.linksid]
                 }
             }).then(res => {
                 console.log("处理删除附件", res)