Quellcode durchsuchen

editer:feat:保存

haojianlong vor 4 Jahren
Ursprung
Commit
4ab1aee972
1 geänderte Dateien mit 20 neuen und 17 gelöschten Zeilen
  1. 20 17
      src/components/editview/baseTopoEditer.vue

+ 20 - 17
src/components/editview/baseTopoEditer.vue

@@ -162,24 +162,27 @@ export default {
           graphId: this.graphId,
           id: this.id,
         });
-        console.log(obj);
         saveGroup(obj).then((res) => {
-          // 设置发布状态为 未发布
-          this.SETISPUB(0);
-          const gid = res.entityList[0].graphId;
-          const id = res.entityList[0].id;
-          // 重设图id 与 id
-          this.SETPROJECT({ graphId: gid, id: id });
-          // 修改url参数
-          this.$router.push({
-            name: "Editer",
-            query: {
-              graphId: gid,
-              id: id,
-              categoryName: encodeURI(this.categoryName),
-              isPub: 0,
-            },
-          });
+          // 如果是从已发布跳转过来
+          if (this.isPub == 1) {
+            // 设置发布状态为 未发布
+            this.SETISPUB(0);
+            const gid = res.entityList[0].graphId;
+            const id = res.entityList[0].id;
+            // 重设图id 与 id
+            this.SETPROJECT({ graphId: gid, id: id });
+            // 修改url参数
+            this.$router.push({
+              name: "Editer",
+              query: {
+                graphId: gid,
+                id: id,
+                categoryName: encodeURI(this.categoryName),
+                isPub: 0,
+              },
+            });
+          }
+          this.$message.success(`保存成功${res.entityList[0].version}`);
         });
       });
       // 设置实例置顶置底