Bläddra i källkod

解决点击发布按钮提示图片不存在

xiebeibei 4 år sedan
förälder
incheckning
d3d86aaa4e
1 ändrade filer med 14 tillägg och 7 borttagningar
  1. 14 7
      src/components/baseEditer.vue

+ 14 - 7
src/components/baseEditer.vue

@@ -283,6 +283,7 @@ export default {
         saveGroup(data).then(res => {
           Message.close()
           console.log("aaaaaaaaaaaaaa", res);
+          this.graphId = res.Data;
         });
       });
       bus.$on("exportByKey", val => {
@@ -377,6 +378,10 @@ export default {
       }),
       //发布图
       bus.$on("publishMap", () => {
+        if(this.graphId==''){
+          this.$message.error('请先保存');
+          return false;
+        }
        this.publishBtn()
       })
       /**
@@ -425,13 +430,15 @@ export default {
       publishGraph(data).then(res => {
         loadings.close();
         if (res.Result == "success") {
-          this.$message.success(res.Message);
-          const data = `categoryId=${this.urlMsg.categoryId}&projectId=${this.urlMsg.projectId}&BuildingID=${this.urlMsg.BuildingID}&FloorID=${this.urlMsg.FloorID}&fmapID=${this.urlMsg.fmapID}`;
-          const url =
-                  window.location.origin +
-                  "/wandaEditer/drafts?" +
-                  encodeURIComponent(data);
-          window.open(url, true);
+          this.$message.success('发布成功');
+         setTimeout(()=>{
+           const data = `categoryId=${this.urlMsg.categoryId}&projectId=${this.urlMsg.projectId}&BuildingID=${this.urlMsg.BuildingID}&FloorID=${this.urlMsg.FloorID}&fmapID=${this.urlMsg.fmapID}`;
+           const url =
+                   window.location.origin +
+                   "/wandaEditer/drafts?" +
+                   encodeURIComponent(data);
+           window.open(url, true);
+         },1000);
         } else {
           this.$message.error(res.Message);
         }