|
@@ -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
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
// 适配底图到窗口
|