Browse Source

Merge branch 'develop' into develop-new

YaolongHan 4 years ago
parent
commit
821b971314

+ 3 - 3
package.json

@@ -9,10 +9,10 @@
   },
   "dependencies": {
     "@saga-web/base": "2.1.27",
-    "@saga-web/big": "1.0.111",
+    "@saga-web/big": "1.0.112",
     "@saga-web/draw": "2.1.107",
-    "@saga-web/feng-map": "1.0.44",
-    "@saga-web/graph": "2.1.124",
+    "@saga-web/feng-map": "1.0.45",
+    "@saga-web/graph": "2.1.125",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",
     "element-ui": "^2.13.2",

+ 14 - 8
src/components/baseEditer.vue

@@ -257,10 +257,12 @@ export default {
         this.fParser.casementList.forEach(t => this.scene.addItem(t));
         this.fParser.pList = [];
         res.PList.forEach(t => {
-          const item = new SCircleItem(null, t);
-          this.fParser.pList.push(item);
-          this.scene.fidToItem[t.SourceId] = item;
-          this.scene.addItem(item);
+          if (t.Pos.X >= 0 && t.Pos.Y <= 0) {
+            const item = new SCircleItem(null, t);
+            this.fParser.pList.push(item);
+            this.scene.fidToItem[t.SourceId] = item;
+            this.scene.addItem(item);
+          }
         });
         this.view.scene = this.scene;
         this.readGraph();
@@ -351,8 +353,12 @@ export default {
             }
           });
         }
-        console.log(11111111111111111111111111);
+
+        // if(this.urlMsg.projectId==1000384 && this.urlMsg.FloorID =='f2'){
+        //           console.log('对河南红谷滩兼容');
+        // }else{
         this.view.fitSceneToView();
+        // }
         // 设置初始化缩放比例
         this.initScale = this.view.scale;
         this.view.maxScale = this.initScale * 10;
@@ -684,8 +690,8 @@ export default {
         this.changeScaleByClick = false;
       });
       // 更改图例数据工程化数据
-      bus.$on("changeAttachObjectIds", arr => {
-        this.scene.upadatAttachObjectIds(arr);
+      bus.$on("changeAttachObjectIds", (arr, flag) => {
+        this.scene.upadatAttachObjectIds(arr, flag);
       });
       // redo
       bus.$on("changeRedo", () => {
@@ -700,7 +706,7 @@ export default {
       bus.$on("toggleItem", item => {
         this.scene.toggleItem(item);
       });
-      // 
+      //
       bus.$on('itemAngle', ang => {
         this.scene.updateItemAng(ang);
       })

+ 39 - 8
src/components/edit/edit-dialog.vue

@@ -144,14 +144,23 @@
                         title: '对象名称',
                         dataIndex: 'sbjc',
                         key: 'sbjc',
-                        width: '75%',
+                        width: '60%',
+                        ellipsis: true,
                         scopedSlots: {customRender: 'sbjc'},
                     },
                     {
                         title: '对象内码',
                         dataIndex: 'sbjbm',
                         key: 'sbjbm',
-                        width: '25%',
+                        width: '20%',
+                        className: 'column-center',
+                    },
+                    {
+                        title: '所属楼层',
+                        dataIndex: 'floorcode',
+                        key: 'floorcode',
+                        width: '20%',
+                        className: 'column-center',
                     },
                 ],
                 columnsSys: [
@@ -159,14 +168,23 @@
                         title: '设备名称',
                         dataIndex: 'sbjc',
                         key: 'sbjc',
-                        width: '75%',
+                        width: '60%',
+                        ellipsis: true,
                         scopedSlots: {customRender: 'sbjc'},
                     },
                     {
                         title: '设备内码',
                         dataIndex: 'assetnum',
                         key: 'assetnum',
-                        width: '25%',
+                        width: '20%',
+                        className: 'column-center',
+                    },
+                    {
+                        title: '所属楼层',
+                        dataIndex: 'floorcode',
+                        key: 'floorcode',
+                        width: '20%',
+                        className: 'column-center',
                     },
                 ],
                 columnsLocal: [
@@ -174,14 +192,23 @@
                         title: '位置名称',
                         dataIndex: 'wzjc',
                         key: 'wzjc',
-                        width: '75%',
+                        width: '60%',
+                        ellipsis: true,
                         scopedSlots: {customRender: 'wzjc'},
                     },
                     {
                         title: '位置内码',
                         dataIndex: 'location',
                         key: 'location',
-                        width: '25%',
+                        width: '20%',
+                        className: 'column-center',
+                    },
+                    {
+                        title: '所属楼层',
+                        dataIndex: 'floorcode',
+                        key: 'floorcode',
+                        width: '20%',
+                        className: 'column-center',
                     },
                 ],
                 tableData: [],
@@ -246,7 +273,7 @@
                         }
                     })
                     console.log(lists);
-                    bus.$emit('changeAttachObjectIds', lists)
+                    bus.$emit('changeAttachObjectIds', lists, true)
                     bus.$emit('updateAttachMsg', lists)
                 }, 1000);
             },
@@ -266,7 +293,7 @@
 
                 })
                 console.log(lists);
-                bus.$emit('changeAttachObjectIds', lists)
+                bus.$emit('changeAttachObjectIds', lists, false)
             },
             onSearch(value) {
                 this.queryGlsmsasset()
@@ -690,6 +717,10 @@
 </script>
 
 <style scoped lang="less">
+   /deep/ th.column-center,
+   /deep/ td.column-center {
+        text-align: center !important;
+    }
     .edit-dialog {
         .dialog-content {
             width: 1136px;

+ 53 - 7
src/components/mapClass/EditScence.ts

@@ -65,10 +65,10 @@ export class EditScence extends SGraphScene {
     isAbsorbing: boolean = false;
     /** 吸附展示item    */
     highLight: HighlightItem | null = null;
-    /** 矩形选择区域  */
-    rectSelectItem: SRectSelectItem | null = null;
-    /** 框选    */
-    isRectSelection: number = 0;
+    // /** 矩形选择区域  */
+    // rectSelectItem: SRectSelectItem | null = null;
+    // /** 框选    */
+    // isRectSelection: number = 0;
     /** 当前选中焦点Item */
     focusItem: SGraphItem | null = null;
     /** 当前选中焦点ItemList */
@@ -740,7 +740,7 @@ export class EditScence extends SGraphScene {
      * 更新工程信息化的相关数据
      * @param AttachObjectIds Array
      */
-    upadatAttachObjectIds(AttachObjectIds: []): void {
+    upadatAttachObjectIds(AttachObjectIds: [], flag: boolean): void {
         if (this.focusItem) {
             this.focusItem.data.AttachObjectIds = AttachObjectIds;
             // 重新选中focusitem
@@ -754,7 +754,7 @@ export class EditScence extends SGraphScene {
                 item instanceof SFHFQZoneLegendItem
             ) {
                 let arr = item.data.AttachObjectIds;
-                if (arr && arr.length && arr[arr.length - 1].name) {
+                if (arr && arr.length && arr[arr.length - 1].name && flag) {
                     let name = item.name;
                     if (name) {
                         item.name = name + `\n${arr[arr.length - 1].name}`;
@@ -1044,6 +1044,11 @@ export class EditScence extends SGraphScene {
             return this.grabItem.onMouseDown(event);
         }
         switch (this.cmd) {
+            // case 'choice':
+            //     if (!super.onMouseDown(event)){
+            //         this.addRectSelect(event);
+            //     }
+            //     break
             case 'baseLine':
                 this.addLine(event);
                 break;
@@ -1093,6 +1098,8 @@ export class EditScence extends SGraphScene {
                     event.y = p.y;
                     return this.grabItem.onMouseMove(event);
                 }
+            } else if (this.grabItem instanceof SRectSelectItem) {
+                return this.grabItem.onMouseMove(event);
             }
         }
         return super.onMouseMove(event)
@@ -1109,6 +1116,14 @@ export class EditScence extends SGraphScene {
             } else if (this.grabItem instanceof TipelineItem) {
                 this.updateTipeAnc(event);
                 return true;
+            } else if (this.grabItem instanceof SRectSelectItem) {
+                this.groupSelect();
+                this.removeItem(this.grabItem);
+                this.grabItem = null;
+                if (this.view) {
+                    this.view.update()
+                }
+                return true;
             }
             return this.grabItem.onMouseUp(event);
         }
@@ -1885,6 +1900,37 @@ export class EditScence extends SGraphScene {
         let point = new SPoint(event.x, event.y);
         let rect = new SRectSelectItem(null, point);
         this.addItem(rect);
-        this.rectSelectItem = rect;
+        this.grabItem = rect;
+    }
+
+    /**
+     * 计算框选交集
+    */
+    groupSelect(){
+        this.selectContainer.clear()
+        if (this.grabItem instanceof SRectSelectItem) {
+            const rect = this.grabItem.boundingRect();
+            this.arrToSelect(this.Nodes, rect)
+            this.arrToSelect(this.Markers, rect)
+            this.arrToSelect(this.Relations, rect)
+        }    
+    }
+    /**
+     * 选中item:框选
+    */
+    private arrToSelect(arr: SGraphItem[], rect:SRect){
+        if(Array.isArray(arr) && arr.length) {
+            arr.forEach(t => {
+                if (t.parent) {
+                    let temp = t.boundingRect();
+                    let lefttop = t.mapToScene(temp.left, temp.top)
+                    let rightbottom = t.mapToScene(temp.right, temp.bottom)
+                    let r = new SRect(lefttop, rightbottom)
+                    if (rect.isIn(r)){
+                        this.selectContainer.toggleItem(t)
+                    }
+                }
+            })
+        }
     }
 }