Pārlūkot izejas kodu

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

haojianlong 4 gadi atpakaļ
vecāks
revīzija
ea2f0c3faf

+ 7 - 25
package-lock.json

@@ -1064,29 +1064,11 @@
       "integrity": "sha512-Oy5eRCxqJoP3RzT8w6auuk1M3u93CXfW7fhzL3BNhl71WnDk0hjpJ2/TXOOdS8kVqYm7zLx5PhmO/EU0CCoZTQ=="
     },
     "@saga-web/big": {
-      "version": "1.0.43",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/big/-/big-1.0.43.tgz",
-      "integrity": "sha512-AAi/EBXfdb4nuMYkY6Tl2/bB9uNt/X7Py0BBR1L6Yof8xqpALULKFT4dZoU+3CU7yG6yNAW6+jK3wGzd3ApMwQ==",
+      "version": "1.0.44",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/big/-/big-1.0.44.tgz",
+      "integrity": "sha512-7xRC4Qe3aly5x/3jpGCnzb12b+gcMBwfgMx3ZGD2uxdmPkisQzPNZuPxp6j4+RrYILhgRnL+AiaUQdEv9go3JQ==",
       "requires": {
-        "@saga-web/graph": "2.1.84"
-      },
-      "dependencies": {
-        "@saga-web/draw": {
-          "version": "2.1.94",
-          "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/draw/-/draw-2.1.94.tgz",
-          "integrity": "sha512-niu1zEvTv4l3Gnx+Qv7LPjgaPAgKQIIjUGM0H2nyvfJlRZb96LVJSum77cGJunhTl7ak6opg28JWCUUCKW/qRw==",
-          "requires": {
-            "@saga-web/base": "^2.1.19"
-          }
-        },
-        "@saga-web/graph": {
-          "version": "2.1.84",
-          "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.84.tgz",
-          "integrity": "sha512-7RwFNoVQcjrmWmzZhOrSUkvCeBfJsf7i0HElXvouN8ooy9R3KP1xcJnDGZ2MP9i9udmw09JEbjMVHrLhXZrEsQ==",
-          "requires": {
-            "@saga-web/draw": "2.1.94"
-          }
-        }
+        "@saga-web/graph": "2.1.87"
       }
     },
     "@saga-web/draw": {
@@ -1133,9 +1115,9 @@
       }
     },
     "@saga-web/graph": {
-      "version": "2.1.86",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.86.tgz",
-      "integrity": "sha512-ZapOQ7BJymzsYcW5qjv5dWjUiDeI3gHOZOIv8UV3/CuQ3s09WMv75jGG/D0dQtiDhICoUYc5IVZlZVBS184a5g==",
+      "version": "2.1.87",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.87.tgz",
+      "integrity": "sha512-83CNK2dLurIaBIt6BNz+1rGaVd1tY2mOuVf0TuMP/3CZ/VyqVZ4Jg7m39/dxNWdsrhjsjBecrN5GudMut41iig==",
       "requires": {
         "@saga-web/draw": "2.1.97"
       }

+ 2 - 0
src/App.vue

@@ -4,6 +4,8 @@
   </div>
 </template>
 
+<script>
+</script>
 <style lang="less">
 #app {
   width: 100%;

+ 38 - 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,8 +132,9 @@ export default {
         }
       });
       // 获取typeid
-      this.getTypeId()
+      this.getTypeId();
       this.scene.emitChange = this.emitChange;
+      this.scene.scenceUpdate = this.scenceUpdate;
     },
     parserData(floor) {
       if (floor == "g80") {
@@ -178,6 +185,10 @@ export default {
       this.$emit("changeFocusItem", itemMsg);
       bus.$emit("FocusItemChanged", itemMsg);
     },
+    // 监听场景元素数据变化
+    scenceUpdate(scence) {
+      bus.$emit("elementDataChange", scence);
+    },
     clearGraphy() {
       if (this.view) {
         this.view.scene = null;
@@ -222,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]) {
@@ -254,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);
         });
       });
@@ -270,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
@@ -334,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";
@@ -346,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);
     },
@@ -358,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 - 2
src/components/edit/right_toolbar.vue

@@ -26,7 +26,7 @@
         <div class="element">
           <a-input-search placeholder="搜索" style="margin-bottom: 12px;" v-model="key" @search="onSearch" />
           <ul class="element-list">
-            <li v-for="ele in elementData" :key="ele.id" v-show="ele.name == key">
+            <li v-for="ele in elementData" :key="ele.id" v-show="key?ele.name.search(key) != -1:true">
               <el-image style="width: 45px; height: 26px; margin-top: 6px;" :src="ele.data.Properties.IconUrl" fit="contain"></el-image>
               <span class="element-name">{{ele.name}}</span>
             </li>
@@ -111,6 +111,7 @@ export default {
         if (val.Relations.length) {
           this.elementData = this.elementData.concat(val.Relations);
         }
+        console.log(this.elementData);
       });
     },
     callback(key) {
@@ -118,7 +119,7 @@ export default {
     },
     // 元素检索
     onSearch(key) {
-
+      console.log(key);
     },
     // 改变状态
     changeStatus(item) {

+ 4 - 2
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 {
@@ -160,7 +161,7 @@ export default {
       console.log(this.focusItem);
       if (this.focusItem) {
         bus.$emit("deleiteItem");
-        this.focusItem = null;
+        // this.focusItem = null;
         this.$message.success("删除成功", 1);
       } else {
         this.$message.error("请选择指定对象!", 1);
@@ -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>

+ 56 - 29
src/components/mapClass/EditScence.ts

@@ -1,6 +1,6 @@
 import { SMouseEvent, SUndoStack } from "@saga-web/base";
 import { SGraphScene, SGraphLayoutType } from '@saga-web/graph/lib';
-import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder } from "@saga-web/big";
+import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder, STooltipItem } from "@saga-web/big";
 import { SGraphItem, SLineStyle, SImageItem, STextItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate, SGraphAddCommand } from "@saga-web/graph/lib";
 import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
 import { SSCPZZoneLegendItem } from "@/lib/items/SSCPZZoneLegendItem";
@@ -143,7 +143,8 @@ export class EditScence extends SGraphScene {
         this.addItem(item);
         item.connect("finishCreated", this, this.finishCreated);
         this.grabItem = item;
-        this.Markers.push(item)
+        this.Markers.push(item);
+        this.scenceUpdate(this);
         // this.undoStack.push(new SGraphAddCommand(this, item));
         // item.connect("onMove", this, this.onItemMove.bind(this));
         return true
@@ -196,6 +197,7 @@ export class EditScence extends SGraphScene {
         // this.undoStack.push(new SGraphAddCommand(this, item));
         this.grabItem = item;
         this.focusItem = item;
+        this.scenceUpdate(this);
         return true
     }
 
@@ -244,6 +246,7 @@ export class EditScence extends SGraphScene {
         this.grabItem = Polylines;
         this.focusItem = Polylines;
         this.Nodes.push(Polylines);
+        this.scenceUpdate(this);
     }
 
     /**
@@ -268,6 +271,7 @@ export class EditScence extends SGraphScene {
                 OutLine: item.pointArr[0],
                 SubType: SubType,
                 Properties: {
+                    IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                     StrokeColor: this._legend.Color,
                     FillColor: this._legend.FillColor,
                     LineDash: this._legend.LineDash,
@@ -292,6 +296,7 @@ export class EditScence extends SGraphScene {
             Polylines.connect("finishCreated", this, this.finishCreated);
             this.focusItem = Polylines;
             this.Nodes.push(Polylines);
+            this.scenceUpdate(this);
         }
     }
 
@@ -323,7 +328,8 @@ export class EditScence extends SGraphScene {
         this.grabItem == null;
         this.focusItem = item;
         this.cmd = 'choice';
-        this.Markers.push(item)
+        this.Markers.push(item);
+        this.scenceUpdate(this);
     }
 
     /**
@@ -356,7 +362,8 @@ export class EditScence extends SGraphScene {
         this.addItem(item);
         this.grabItem == null
         this.cmd = 'choice';
-        this.Markers.push(item)
+        this.Markers.push(item);
+        this.scenceUpdate(this);
     }
 
     /**
@@ -393,6 +400,7 @@ export class EditScence extends SGraphScene {
         // item.moveTo(event.x, event.y);
         this.addItem(item);
         this.Nodes.push(item);
+        this.scenceUpdate(this);
     }
 
     /**
@@ -410,6 +418,7 @@ export class EditScence extends SGraphScene {
         if (this.focusItem) {
             const old = this.focusItem.text;
             this.focusItem.text = str;
+            this.scenceUpdate(this);
             // this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "text", old, str));
         }
     }
@@ -565,7 +574,8 @@ export class EditScence extends SGraphScene {
      */
     upadataLengedName(val: string): void {
         if (this.focusItem && this.focusItem.data) {
-            this.focusItem.text = val
+            this.focusItem.text = val;
+            this.scenceUpdate(this); 
         }
     }
 
@@ -575,7 +585,7 @@ export class EditScence extends SGraphScene {
      */
     upadatImageNum(num: number): void {
         if (this.focusItem && this.focusItem.num) {
-            this.focusItem.num = num
+            this.focusItem.num = num;
         }
     }
 
@@ -603,34 +613,51 @@ export class EditScence extends SGraphScene {
      */
     deleiteItem(): void {
         if (this.focusItem) {
-            this.removeItem(this.focusItem);
-            let a = -1
-            this.Nodes.forEach((item: any, index: number) => {
-                if (item.id == this.focusItem.id) {
-                    a = index
+            if ((this.focusItem instanceof SZoneLegendItem ||
+                this.focusItem instanceof SSCPZZoneLegendItem ||
+                this.focusItem instanceof SFHFQZoneLegendItem ||
+                this.focusItem instanceof TipelineItem) &&
+                this.focusItem.curIndex != -1
+            ) {
+                this.focusItem.deletePoint(this.focusItem.curIndex);
+            } else {
+                this.removeItem(this.focusItem);
+                let a = -1
+                this.Nodes.forEach((item: any, index: number) => {
+                    if (item.id == this.focusItem.id) {
+                        a = index
+                    }
+                });
+                if(a > -1) {
+                    this.Nodes.splice(a, 1);
                 }
-            });
-            this.Nodes.splice(a, 1);
-            let b = -1;
-            this.Markers.forEach((item: any, index: number) => {
-                if (item.id == this.focusItem.id) {
-                    b = index
+                let b = -1;
+                this.Markers.forEach((item: any, index: number) => {
+                    if (item.id == this.focusItem.id) {
+                        b = index
+                    }
+                });
+                if (b > -1) {
+                    this.Markers.splice(b, 1);
                 }
-            });
-            this.Markers.splice(b, 1);
-            let c = -1;
-            this.Relations.forEach((item: any, index: number) => {
-                if (item.id == this.focusItem.id) {
-                    c = index
+                let c = -1;
+                this.Relations.forEach((item: any, index: number) => {
+                    if (item.id == this.focusItem.id) {
+                        c = index
+                    }
+                });
+                if (c > -1) {
+                    this.Relations.splice(c, 1);
                 }
-            });
-            this.Relations.splice(c, 1);
-            this.focusItem = null;
-        }
-        if (this.view) {
-            this.view.update();
+                this.focusItem = null;
+                if (this.view) {
+                    this.view.update();
+                }
+                this.scenceUpdate(this);
+            }
         }
     }
+    scenceUpdate(scence: any) {}
 
     /**
      * 对齐指定item

+ 17 - 11
src/views/drafts.vue

@@ -1,6 +1,7 @@
 <template>
-  <a-spin :spinning="spinning">
+
     <div id="drafts">
+      <a-spin :spinning="spinning">
       <div class="tit">草稿箱</div>
       <div class="conent">
         <div class="left-nav">
@@ -62,8 +63,9 @@
           </div>
         </div>
       </div>
+      </a-spin>
     </div>
-  </a-spin>
+
 </template>
 <script>
 import Tree from "./../components/Tree/Tree.vue";
@@ -122,6 +124,7 @@ export default {
       spinning: false, //全局加载
       systemName: "",
       floorName: "",
+      floorId:'',    //楼层id
       BuildingID: "1", // 建筑id
       categoryId: "" //系统类id
     };
@@ -134,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);
@@ -246,7 +249,9 @@ export default {
         console.log(res);
         this.spinning = false;
         if (res.Result == "success") {
-          this.$message.success(res.Message);
+          this.$message.success('删除成功');
+          this.getTreeData();
+          this.legendData = [];
         } else {
           this.$message.error(res.Message);
         }
@@ -280,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);
     },
     // 切换草稿箱楼层
@@ -372,6 +372,12 @@ export default {
 };
 </script>
 <style lang="less" scoped>
+  /deep/ .ant-spin-nested-loading{
+    height: 100% !important;
+   .ant-spin-container{
+     height: 100% !important;
+   }
+  }
 #drafts {
   widows: 100%;
   height: 100%;

+ 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',
+}