Sfoglia il codice sorgente

feat:调试编辑器

YaolongHan 4 anni fa
parent
commit
4ff3209c43

+ 33 - 11
src/components/baseEditer.vue

@@ -18,7 +18,8 @@ import { uuid } from "@/components/mapClass/until";
 import { SImageItem } from "@saga-web/graph/lib";
 import { SPainter, SColor, SFont, SPoint } from "@saga-web/draw";
 import store from "../store";
-
+import { Loading } from "element-ui";
+import { Message } from 'element-ui';
 let fengmap = null;
 
 export default {
@@ -47,7 +48,7 @@ export default {
       floorList: {},
       urlMsg: {},
       chiceItemList: [], //选中itemlist
-      hasTypeList: [], // 当前类型下包含的typeid(提取)
+      hasTypeList: [] // 当前类型下包含的typeid(提取)
     };
   },
   mounted() {
@@ -60,7 +61,12 @@ export default {
   },
   methods: {
     init() {
-      // const loadings = this.$loading({type: 'global'});
+      const loadings = Loading.service({
+        lock: true,
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
+      });
       document.getElementById(`canvas`).focus();
       this.clearGraphy();
       this.scene = new EditScence();
@@ -71,7 +77,6 @@ export default {
         this.appName,
         null
       );
-      console.log(this.urlMsg.fmapID);
       const floorid = this.urlMsg.FloorID;
       fengmap.loadMap(this.urlMsg.fmapID, resp => {
         this.floorList = resp;
@@ -82,6 +87,7 @@ export default {
           .then(response => {
             console.log("获取rf成功", response);
             this.parserData(floorid);
+            loadings.close();
           });
         this.view.fitSceneToView();
       });
@@ -126,7 +132,7 @@ export default {
         }
       });
       // 获取typeid
-      this.getTypeId()
+      this.getTypeId();
       this.scene.emitChange = this.emitChange;
     },
     parserData(floor) {
@@ -222,7 +228,7 @@ export default {
       });
       bus.$on("extractItem", () => {
         const map = {};
-        console.log(this.hasTypeList)
+        console.log(this.hasTypeList);
         this.fParser.spaceList.forEach(t => {
           if (this.hasTypeList.indexOf(t.data.Type) > -1) {
             if (map[t.data.Type]) {
@@ -254,7 +260,12 @@ export default {
           BuildingID: this.urlMsg.BuildingID, // 建筑ID
           FloorID: this.urlMsg.FloorID // 楼层id
         };
+         Message({
+          message: '上传中,切勿关闭窗口!',
+          type: 'warning'
+        });
         saveGroup(data).then(res => {
+          Message.close()
           console.log("aaaaaaaaaaaaaa", res);
         });
       });
@@ -270,12 +281,12 @@ export default {
                 AttachObjectIds: [],
                 Pos: { x: t.x, y: t.y },
                 OutLine: t.pointArr[0],
-                SubType: '',
+                SubType: "",
                 Properties: {
                   strokeColor: "#3d73c0",
                   fillColor: "#eda986",
                   font: 0,
-                  color: '',
+                  color: "",
                   TextPos: { X: 0, Y: 0 }
                 },
                 Num: 1
@@ -334,6 +345,18 @@ export default {
       bus.$on("changeitemExplain", val => {
         this.scene.upadatitemExplain(val);
       });
+      //发布图
+      bus.$on("publishGraph", val => {
+            this.spinning = true;
+    //   publishGraph({ graphId: this.graphId, pubUser: "" }).then(res => {
+    //     this.spinning = false;
+    //     if (res.Result == "success") {
+    //       this.$message.success(res.Message);
+    //     } else {
+    //       this.$message.error(res.Message);
+    //     }
+    //   });
+    // });
     },
     // 读取数据
     readGroup() {
@@ -342,8 +365,7 @@ export default {
         projectId: this.urlMsg.projectId,
         BuildingID: this.urlMsg.BuildingID, // 建筑ID
         FloorID: this.urlMsg.FloorID, // 楼层id
-        Pub:false   //是否获取草稿 //获取草稿
-
+        Pub: false //是否获取草稿 //获取草稿
       };
       return readGroup(data);
     },
@@ -354,7 +376,7 @@ export default {
       };
       queryTypeGraph(data).then(res => {
         this.hasTypeList = res.Data.map(t => Number(t));
-      })
+      });
     }
   },
   watch: {

+ 15 - 0
src/components/edit/codeMapSystem.js

@@ -0,0 +1,15 @@
+export default {
+    SCPZ: '石材铺装(土建装饰)',
+    DTXT: '电梯系统',
+    FZQZL: '分支器支路分布图(暖通系统)',
+    GDXT: '供电系统',
+    JPSXT: '给排水系统',
+    LCFB: '楼层分布',
+    LCGN: '楼层功能',
+    NTXT: '暖通系统',
+    RDXT: '弱电系统',
+    RQXT: '燃气系统',
+    XFBFYCFL: '消防泵房引出管路分布图(消防系统)',
+    XFXT: '消防系统',
+    XTYLT: '系统原理图'
+}

+ 3 - 1
src/components/edit/top_toolbar.vue

@@ -85,6 +85,7 @@
 <script>
 import bus from "@/bus";
 import { SGraphLayoutType } from "@saga-web/graph/lib";
+import systym from "./codeMapSystem.js"
 export default {
   data() {
     return {
@@ -198,7 +199,8 @@ export default {
     });
     this.urlMsg = obj;
     // ///////////测试代码
-    this.urlMsg.floorName = "消防系统-4F";
+    const FloorName =  this.urlMsg.FloorName ? this.urlMsg.FloorName:'';
+    this.urlMsg.floorName = systym[this.urlMsg.categoryId] + '-' + FloorName;
   }
 };
 </script>

+ 4 - 8
src/views/drafts.vue

@@ -122,6 +122,7 @@ export default {
       spinning: false, //全局加载
       systemName: "",
       floorName: "",
+      floorId:'',    //楼层id
       BuildingID: "1", // 建筑id
       categoryId: "" //系统类id
     };
@@ -134,7 +135,7 @@ export default {
       if (data.Gname) {
         this.systemName = node.parent.data.Gcode;
         this.floorName = data.Gcode;
-        console.log(node.parent.data.Id)
+        this.floorId = data.Gname;
         this.categoryId = node.parent.data.Id;
         this.getLegend();
         this.checkFloor(data.Gname);
@@ -280,13 +281,8 @@ export default {
      * @description t跳转editer编辑器
      */
     goToEditer() {
-      console.log(this.$cookie);
-      const FloorID = this.$cookie.get("floorMapId") || "f1";
-      const categoryId = this.$cookie.get("categoryId");
-      const { conf } = window.__systemConf,
-        { editerUrl } = conf;
-      const data = `categoryId=${categoryId}&projectId=${this.plazaId}&BuildingID=1&FloorID=${FloorID}&fmapID=${this.fmapID}`;
-      const url = editerUrl + "editer?" + encodeURIComponent(data);
+      const data = `categoryId=${this.categoryId}&projectId=${this.projectId}&BuildingID=1&FloorID=${this.floorId}&FloorName=${this.floorName}&fmapID=${this.fmapID}`;
+      const url = window.location.origin + "/wandaEditer/editer?" + encodeURIComponent(data);
       window.open(url, true);
     },
     // 切换草稿箱楼层

+ 0 - 1
src/views/editer.vue

@@ -56,7 +56,6 @@ export default {
     },
     setCmdType(cmdType) {
       this.cmdType = cmdType;
-      console.log(cmdType,'12313')
     },
     changeFocusItem(item) {
       this.focusItemList = item;