Forráskód Böngészése

Merge branch 'dev' of http://39.106.8.246:3003/web/persagy-plan-editer into dev

yunxing 4 éve
szülő
commit
ac9a168a4d

+ 14 - 6
src/components/editview/basePlanEditer.vue

@@ -20,11 +20,10 @@ import { mapState, mapMutations } from "vuex";
 import base64ToFile from "@/utils/base64ToFile";
 import { v1 as uuidv1 } from "uuid";
 import bus from "@/bus/bus";
-import { saveGroup } from "@/api/editer";
 import { publishGraph } from "@/api/home";
-import { planerSave, planerRead, pubPlanerRead } from "@/api/labsl";
+import { planerSave, planerRead, planerPublish } from "@/api/labsl";
 import { equipQuery } from "@/api/equipcomponent";
-import { imgBaseUrl, imgServeUpload } from "@/api/imageservice";
+import { imgBaseUrl } from "@/api/imageservice";
 export default {
     components: { topoTooltip },
     data() {
@@ -61,6 +60,7 @@ export default {
             "equipItemMap",
             "buildingId",
             "floorId",
+            "folderId",
             "objExtInfo",
             "styleMap",
             "ruleList",
@@ -488,7 +488,7 @@ export default {
                 .then((vals) => {
                     // 重设版本号
                     if (vals[1].version && vals[1].id && vals[1].graphId) {
-                        this.SETVERSION(vals[1].version);
+                        this.SETPROJECT(vals[1]);
                         this.$message.success(`保存成功${vals[1].version}`);
                         const { folderId, folderName, buildingId, floorId, floorLocalName, name, floorMap } = this.$route.query;
                         this.$router.replace({
@@ -598,8 +598,16 @@ export default {
                 graphId: this.graphId,
                 id: this.id,
             };
-            publishGraph(pa).then((res) => {
-                this.$message.success("发布成功");
+            planerPublish(pa).then((res) => {
+                if(res.result === "success"){
+                    this.$message.success("发布成功");
+                    console.log(this.folderId);
+                    this.$router.push({name: "Home", params: {folderId: this.folderId}});
+                } else {
+                    this.$message.error(`发布失败!失败原因:${res.message}`);
+                }
+            }).catch((error) =>{
+                this.$message.error(`发布失败!失败原因:${error}`);
             });
         },
     },

+ 6 - 1
src/components/homeView/leftFolder.vue

@@ -75,7 +75,12 @@ export default {
         };
     },
     created() {
-        this.getFolderData();
+        // 如果路由带文件夹参数,则定位到对应文件夹
+        if (this.$route.params?.folderId) {
+            this.getFolderData(this.$route.params.folderId);
+        } else {
+            this.getFolderData();
+        }
     },
     methods: {
         // 获取文件夹数据

+ 1 - 1
src/router/index.ts

@@ -16,7 +16,7 @@ const routes: Array<RouteConfig> = [
     },
     {
         path: "/home",
-        name: "home",
+        name: "Home",
         component: Home,
     },
 ];

+ 0 - 1
src/views/home.vue

@@ -197,7 +197,6 @@ export default {
             folderName: "", //文件夹名称
         };
     },
-    created() {},
     methods: {
         testClick(data) {
             console.log(data);