Browse Source

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-editer into develop

zhangyu 4 years ago
parent
commit
c19760a401

+ 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;
       this.scene.scenceUpdate = this.scenceUpdate;
     },
@@ -227,7 +233,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]) {
@@ -259,7 +265,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);
         });
       });
@@ -275,12 +286,12 @@ export default {
                 AttachObjectIds: [],
                 Pos: { x: t.x, y: t.y },
                 OutLine: t.pointArr[0],
-                SubType: '',
+                SubType: "",
                 Properties: {
                   StrokeColor: "#3d73c0",
                   FillColor: "#72f5f980",
                   font: 0,
-                  color: '',
+                  color: "",
                   TextPos: { X: 0, Y: 0 }
                 },
                 Num: 1
@@ -339,6 +350,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);
+    //     }
+    //   });
+    // });
       //创建区域是否点选
       bus.$on("changeDrawType", val => {
         this.scene.isSelecting = val == "select";
@@ -351,8 +374,7 @@ export default {
         projectId: this.urlMsg.projectId,
         BuildingID: this.urlMsg.BuildingID, // 建筑ID
         FloorID: this.urlMsg.FloorID, // 楼层id
-        Pub:false   //是否获取草稿 //获取草稿
-
+        Pub: false //是否获取草稿 //获取草稿
       };
       return readGroup(data);
     },
@@ -363,7 +385,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

@@ -124,6 +124,7 @@ export default {
       spinning: false, //全局加载
       systemName: "",
       floorName: "",
+      floorId:'',    //楼层id
       BuildingID: "1", // 建筑id
       categoryId: "" //系统类id
     };
@@ -136,7 +137,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);
@@ -284,13 +285,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;

+ 13 - 12
vue.config.js

@@ -1,9 +1,10 @@
 module.exports = {
     devServer: {
+        port: 8091,
         // 关闭esline
         overlay: {
             warnings: false,
-            errors: false
+            errors: false,
         },
         proxy: {
             '/wdfn': {
@@ -13,34 +14,34 @@ module.exports = {
                     '^/wdfn': '/editor',
                 },
             },
-            "/serve": {
+            '/serve': {
                 target: 'http://192.168.200.87:8088/',
                 // target: 'http://192.168.200.83:8085/',
                 changeOrigin: true,
                 secure: false,
                 pathRewrite: {
-                    "^/serve": "",
+                    '^/serve': '',
                 },
             },
-            "/data": {
-                target: "http://192.168.200.87:9003",
+            '/data': {
+                target: 'http://192.168.200.87:9003',
                 changeOrigin: true,
                 secure: false,
                 pathRewrite: {
-                    "^/data": "",
+                    '^/data': '',
                 },
             },
-        }
+        },
     },
     chainWebpack: (config) => {
-        const svgRule = config.module.rule('svg');
-        svgRule.uses.clear();
+        const svgRule = config.module.rule('svg')
+        svgRule.uses.clear()
         svgRule
             .use('babel-loader')
             .loader('babel-loader')
             .end()
             .use('vue-svg-loader')
-            .loader('vue-svg-loader');
+            .loader('vue-svg-loader')
     },
     lintOnSave: false,
     // publicPath: '/dist',
@@ -48,5 +49,5 @@ module.exports = {
     // 打包名称
     outputDir: 'wandaEditer',
     // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录
-    assetsDir: "static",
-}
+    assetsDir: 'static',
+}