|
@@ -198,7 +198,6 @@ movable-view {
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
-
|
|
|
<template>
|
|
|
<div class="page-intelligent-control" v-on:click="flodFloorFun">
|
|
|
<div class="top-bar"></div>
|
|
@@ -316,7 +315,7 @@ import config from '@/config';
|
|
|
import { mapState } from '@wepy/x';
|
|
|
import { saveCompanyConfig } from '@/service/companyConfig';
|
|
|
import { getCompanyMapData } from '@/api/home';
|
|
|
-import { getFloorList } from '@/packagesEnv/api/mapApi.js';
|
|
|
+import { getBuildingList, getFloorList } from '@/packagesEnv/api/mapApi.js';
|
|
|
|
|
|
let h5StaticPath = config.h5StaticPath + '/page-intelligent-control/';
|
|
|
const tarBarHeight = 96;
|
|
@@ -372,7 +371,6 @@ wepy.component({
|
|
|
mapWidth: 2336,
|
|
|
mapScale: 1,
|
|
|
screenScale: 1,
|
|
|
-
|
|
|
mapMoveByTouch: false,
|
|
|
touchScale: 1,
|
|
|
isShowLocationEntrance: false,
|
|
@@ -381,7 +379,9 @@ wepy.component({
|
|
|
pageHide: false,
|
|
|
query: {},
|
|
|
floors: [],
|
|
|
- companyId: ''
|
|
|
+ companyId: '',
|
|
|
+ buildingData: [],
|
|
|
+ buildingItem: {}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState({
|
|
@@ -393,95 +393,11 @@ wepy.component({
|
|
|
})
|
|
|
},
|
|
|
ready() {
|
|
|
- // 页面加载
|
|
|
- // let from = query.from;
|
|
|
- // this.canSearchPerson = query.from !== 'visit'; // 从访客进入的页面无法搜索人
|
|
|
- // 如果从博瑞尚格智慧空间过来,面板是折叠起来,并且不能滑动
|
|
|
- if (from == 'officehome') {
|
|
|
- this.foldStatus = 'fold';
|
|
|
- this.canSlideExpanel = false;
|
|
|
- }
|
|
|
-
|
|
|
// 获取地图数据
|
|
|
- this.getFloorList();
|
|
|
-
|
|
|
- // checkHasUserInfo()
|
|
|
- // .then(userInfo => {
|
|
|
- // // let companyId =
|
|
|
- // // query.from !== 'visit' ? userInfo.companyId : query.companyId;
|
|
|
- // let companyId = this.companyIdProp || userInfo.companyId;
|
|
|
- // this.companyId = companyId;
|
|
|
- // return getCompanyMapData(companyId);
|
|
|
- // })
|
|
|
- // .then(res => {
|
|
|
- // CompanyMapData = JSON.parse(res.data);
|
|
|
- // this.selectedFloor = CompanyMapData.floorInfo[0].floorId;
|
|
|
- // this.floors = CompanyMapData.floorInfo;
|
|
|
- // this.isShowLocationEntrance = CompanyMapData.sagaCareBluetooth || false;
|
|
|
- // this.getMapSize();
|
|
|
- // return this.getHistorySelectedArea();
|
|
|
- // })
|
|
|
- // .then(historyArea => {
|
|
|
- // // let historyAreaInfo = CompanyMapData.mapInfo.find(
|
|
|
- // // e => e.id == historyArea.spaceId
|
|
|
- // // );
|
|
|
- // return getMapInfoHttp(this.companyId).then(res => {
|
|
|
- // const result = JSON.parse(res.data);
|
|
|
- // const httpDdata = (result && result.content) || [];
|
|
|
- // return {
|
|
|
- // historyArea,
|
|
|
- // httpDdata
|
|
|
- // };
|
|
|
- // });
|
|
|
- // })
|
|
|
- // .then(res => {
|
|
|
- // const { httpDdata, historyArea } = res;
|
|
|
- // let historyAreaInfo;
|
|
|
- // let selectarea;
|
|
|
- // let selectAraeId = null;
|
|
|
- // if (from == 'officehome') {
|
|
|
- // selectAraeId = this.spaceIdProp;
|
|
|
- // } else {
|
|
|
- // selectAraeId = historyArea.spaceId;
|
|
|
- // }
|
|
|
- // CompanyMapData.mapInfo.forEach(item => {
|
|
|
- // item.canClick =
|
|
|
- // typeof item.canClick === 'boolean'
|
|
|
- // ? item.canClick
|
|
|
- // : JSON.parse(item.canClick);
|
|
|
- // item.borderRadius = item.borderRadius
|
|
|
- // ? item.borderRadius instanceof Array
|
|
|
- // ? item.borderRadius
|
|
|
- // : item.borderRadius
|
|
|
- // .slice(2, item.borderRadius.length - 2)
|
|
|
- // .split(',')
|
|
|
- // : undefined;
|
|
|
- // });
|
|
|
- // combinedData = httpDdata.reduce((acc, cur) => {
|
|
|
- // let target = acc.find(e => e.id == cur.id);
|
|
|
-
|
|
|
- // selectarea = acc.find(e => e.id == selectAraeId);
|
|
|
- // if (target) {
|
|
|
- // Object.assign(target, { title: cur.localName });
|
|
|
- // } else {
|
|
|
- // }
|
|
|
-
|
|
|
- // if (target && target.id == selectAraeId) {
|
|
|
- // selectarea = { ...target }; // 如果有新数据,则更新选中的数据
|
|
|
- // }
|
|
|
- // return acc;
|
|
|
- // }, CompanyMapData.mapInfo);
|
|
|
- // this.mapAreasInfo = combinedData;
|
|
|
- // // 如果从博瑞尚格智慧空间过来,面板是折叠起来,并且不能滑动
|
|
|
- // if (from == 'officehome') {
|
|
|
- // this.foldPanelFun();
|
|
|
- // this.doSelectArea(selectarea);
|
|
|
- // // this.getSpaceTem();
|
|
|
- // } else {
|
|
|
- // this.autoSelectArea(selectarea);
|
|
|
- // }
|
|
|
- // });
|
|
|
+ this.init();
|
|
|
},
|
|
|
+ // 页面激活
|
|
|
+ attached() {},
|
|
|
watch: {
|
|
|
// 父亲传过来的空间id 搜索返回才会有这个传递
|
|
|
spaceIdProp: function(newSpaceId, oldSpaceId) {
|
|
@@ -494,13 +410,34 @@ wepy.component({
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ init() {
|
|
|
+ this.projectId = 'Pj1101080259';
|
|
|
+ this.getPageBuildingList();
|
|
|
+ },
|
|
|
+ //获取建筑数据
|
|
|
+ getPageBuildingList() {
|
|
|
+ let params = {
|
|
|
+ criteria: {
|
|
|
+ projectId: 'Pj1101080259'
|
|
|
+ }
|
|
|
+ };
|
|
|
+ console.log(this.projectId);
|
|
|
+ getBuildingList(params).then(res => {
|
|
|
+ console.log('获取常驻空间');
|
|
|
+ console.log(res);
|
|
|
+ this.buildingData = res.content || [];
|
|
|
+ this.buildingItem = this.buildingData[0];
|
|
|
+ this.getFloorList();
|
|
|
+ });
|
|
|
+ },
|
|
|
/**
|
|
|
* 查询楼层信息
|
|
|
*/
|
|
|
getFloorList() {
|
|
|
let params = {
|
|
|
criteria: {
|
|
|
- projectId: this.projectId
|
|
|
+ projectId: 'Pj1101080259',
|
|
|
+ buildingId: this.buildingItem.id
|
|
|
}
|
|
|
};
|
|
|
getFloorList(params).then(res => {
|