Browse Source

'添加电井关联商铺高亮;文本图片图标和区域(文本)设置不可缩放属性;更新依赖'

zhangyu 4 years ago
parent
commit
c0fc5105a5

+ 2 - 2
package.json

@@ -9,10 +9,10 @@
     },
     "dependencies": {
         "@saga-web/base": "2.1.22",
-        "@saga-web/big": "1.0.59",
+        "@saga-web/big": "1.0.63",
         "@saga-web/draw": "2.1.100",
         "@saga-web/feng-map": "1.0.15",
-        "@saga-web/graph": "2.1.96",
+        "@saga-web/graph": "2.1.100",
         "ant-design-vue": "^1.4.10",
         "axios": "^0.19.2",
         "core-js": "^3.4.4",

+ 75 - 8
src/components/floorMap/index.vue

@@ -12,12 +12,13 @@
 </template>
 <script>
 import { SFengParser } from '@saga-web/feng-map'
-import { SFloorParser } from '@saga-web/big'
+import { SFloorParser, ItemOrder } from '@saga-web/big'
 import { FloorView } from '@/lib/FloorView'
 import { FloorScene } from '@/lib/FloorScene'
 import RoomBox from '@/views/room/index'
 import canvasFun from '@/components/floorMap/canvasFun'
 import { readGroup, queryStatis } from '@/api/public'
+import { queryShops } from '@/api/equipmentList.js'
 import { STopologyParser } from '@/lib/parsers/STopologyParser'
 import { mapGetters, mapActions } from 'vuex'
 import { SImageItem } from '@saga-web/graph/lib'
@@ -39,7 +40,8 @@ export default {
             canvasID: 'canvas',
             floorid: '', //楼层id
             topologyParser: null, // 解析器数据
-            fParser: null // 底图解析器
+            fParser: null, // 底图解析器
+            wellMap: {}, // 电井控制商铺映射
         }
     },
     props: {
@@ -198,13 +200,78 @@ export default {
             this.view = new FloorView(`canvas${this.id}`)
         },
         listChange(item, ev) {
-            let name = ev[0][0].data.Name,
-                location = ev[0][0].data.AttachObjectIds[0] ? ev[0][0].data.AttachObjectIds[0].id : ''
-            if (!location) {
-                this.$message('未添加位置类型')
+            if (ev[0].length) {
+                let selectItem1 = ev[0][0],
+                    name = selectItem1.data.Name,
+                    location = selectItem1.data.AttachObjectIds[0] ? selectItem1.data.AttachObjectIds[0].id : ''
+                if (!location) {
+                    this.$message('未添加位置类型')
+                }
+                if (name.slice(name.length - 2, name.length) == '机房' && location) {
+                    this.$refs.boxRoom.open({ name: name, type: this.type, location: location })
+                }
+                // 选中电井设置电井关联的商铺高亮
+                this.setHightLight(ev[0]);
             }
-            if (name.slice(name.length - 2, name.length) == '机房' && location) {
-                this.$refs.boxRoom.open({ name: name, type: this.type, location: location })
+        },
+        // 选中电井关联的商铺高亮
+        setHightLight(arr) {
+            this.clearHightLight()
+            arr.forEach(item => {
+                let location = item.data.AttachObjectIds[0] ? item.data.AttachObjectIds[0].id : ''
+                // 添加了位置类型并且选中的类型为电井类型
+                if (
+                    (item.data.GraphElementId == "100050" ||
+                    item.data.GraphElementId == "100055" ||
+                    item.data.GraphElementId == "100056" ||
+                    item.data.GraphElementId == "100057") &&
+                    location
+                ) {
+                    if (this.wellMap.hasOwnProperty(location)) {
+                        this.wellMap[location].forEach(item => {
+                            item.highLightFlag = true
+                            item.zOrder = 30
+                        })
+                    } else {
+                        let getParams = {
+                            plazaId: this.plazaId,
+                            floor: this.floorid,
+                            keyword: `${location}:wellnum;`,
+                        }
+                        queryShops({getParams}).then(res => {
+                            let shopsnumList = [];
+                            let shopsnumItemList = [];
+                            if (res.data && res.data.length) {
+                                for(let floor in res.data[0]) {
+                                    if (res.data[0][floor].length) {
+                                        res.data[0][floor].forEach(v => {
+                                            shopsnumList = shopsnumList.concat(v.shopsnumList.split(","))
+                                        }) 
+                                    }
+                                }
+                            }
+                            if (shopsnumList.length) {
+                                this.fParser.spaceList.forEach(item => {
+                                    if (shopsnumList.findIndex(name => name == item.data.Name) != -1) {
+                                        item.highLightFlag = true
+                                        item.zOrder = 30
+                                        shopsnumItemList.push(item)
+                                    }
+                                });
+                                this.wellMap[location] = shopsnumItemList
+                            }
+                        })
+                    }
+                }
+            })
+        },
+        // 清除电井关联商铺的高亮状态
+        clearHightLight() {
+            for(let key in this.wellMap) {
+                this.wellMap[key].forEach(item => {
+                    item.highLightFlag = false
+                    item.zOrder = ItemOrder.spaceOrder
+                })
             }
         },
         // 适配底图到窗口

+ 1 - 0
src/lib/FloorScene.js

@@ -1,3 +1,4 @@
+import { SMouseEvent } from "@saga-web/base";
 import {
   SGraphScene
 } from "@saga-web/graph/lib"

+ 1 - 0
src/lib/items/SFHFQZoneLegendItem.ts

@@ -105,6 +105,7 @@ export class SFHFQZoneLegendItem extends SPolygonItem {
      */
     constructor(parent: SGraphItem | null, data: Legend) {
         super(parent);
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;

+ 1 - 0
src/lib/items/SImageLegendItem.ts

@@ -38,6 +38,7 @@ export class SImageLegendItem extends SIconTextItem {
      */
     constructor(parent: SGraphItem | null, data: Legend) {
         super(parent);
+        this.isTransform = false;
         this.zOrder = ItemOrder.markOrder;
         this.data = data;
         this.id = data.ID;

+ 1 - 0
src/lib/items/SImageMarkerItem.ts

@@ -22,6 +22,7 @@ export class SImageMarkerItem extends SImageItem {
     constructor(parent: SGraphItem | null, data: Marker) {
         super(parent);
         this.zOrder = ItemOrder.imageOrder;
+        this.isTransform = false;
         this.data = data;
         this.id = data.ID;
         this.name = data.Name;

+ 1 - 0
src/lib/items/SSCPZZoneLegendItem.ts

@@ -113,6 +113,7 @@ export class SSCPZZoneLegendItem extends SPolygonItem {
      */
     constructor(parent: SGraphItem | null, data: Legend) {
         super(parent);
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;

+ 1 - 0
src/lib/items/STextMarkerItem.ts

@@ -20,6 +20,7 @@ export class STextMarkerItem extends STextItem {
      */
     constructor(parent: SGraphItem | null, data: Marker) {
         super(parent);
+        this.isTransform = false;
         this.zOrder = ItemOrder.textOrder;
         this.data = data;
         this.id = data.ID;

+ 2 - 0
src/lib/items/SZoneLegendItem.ts

@@ -5,6 +5,7 @@ import { SPainter, SColor, SFont, SPoint, SLineCapStyle } from "@saga-web/draw";
 import { STextItem } from '@saga-web/graph/lib';
 import { hexify } from "@/components/mapClass/until"
 import { SItemStatus, ItemOrder, SPolygonItem } from '@saga-web/big/lib';
+import { SMouseEvent } from "@saga-web/base/lib";
 /**
  * 图例节点Item(区域类型)
  *
@@ -105,6 +106,7 @@ export class SZoneLegendItem extends SPolygonItem {
      */
     constructor(parent: SGraphItem | null, data: Legend) {
         super(parent);
+        this.textItem.isTransform = false;
         this.zOrder = ItemOrder.polygonOrder;
         this.data = data;
         this.id = data.ID;

+ 3 - 2
src/views/equipment/table/djspTable.vue

@@ -57,7 +57,7 @@ export default {
         }
     },
     computed: {
-        ...mapGetters(['floorSelect'])
+        ...mapGetters(['floorSelect', 'plazaId'])
     },
     props: ['param'],
     methods: {
@@ -82,7 +82,8 @@ export default {
         },
         getList() {
             let getParams = {
-                orderBy: `floor,0;welldesm,1;meterbox,1;`
+                orderBy: `floor,0;welldesm,1;meterbox,1;`,
+                plazaId: this.plazaId
             }
             if (this.floor) {
                 getParams.floor = this.floor