|
@@ -126,7 +126,7 @@ movable-view {
|
|
|
word-break: break-all;
|
|
|
}
|
|
|
|
|
|
-.area-items-wrapper{
|
|
|
+.area-items-wrapper {
|
|
|
position: relative;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
@@ -137,7 +137,7 @@ movable-view {
|
|
|
width: 144rpx;
|
|
|
position: absolute;
|
|
|
z-index: 9999;
|
|
|
- transform-origin: 36px 54px;//偏移量决定的
|
|
|
+ transform-origin: 36px 54px; //偏移量决定的
|
|
|
}
|
|
|
|
|
|
.room-item.selected .text {
|
|
@@ -385,82 +385,6 @@ wepy.component({
|
|
|
computed: {
|
|
|
...mapState({ userInfo: state => state.user.userInfo })
|
|
|
},
|
|
|
- // ready() {
|
|
|
- // // let from = query.from;
|
|
|
- // // 页面加载
|
|
|
- // // this.canSearchPerson = query.from !== 'visit'; // 从访客进入的页面无法搜索人
|
|
|
- // // 如果从博瑞尚格智慧空间过来,面板是折叠起来,并且不能滑动
|
|
|
- // if (from == 'officehome') {
|
|
|
- // this.foldStatus = 'fold';
|
|
|
- // this.canSlideExpanel = false;
|
|
|
- // }
|
|
|
- // let qrcodeUrl = '';
|
|
|
- // // if (query.q) {
|
|
|
- // // qrcodeUrl = decodeURIComponent(query.q);
|
|
|
- // // let params = utils.getUrlParams(qrcodeUrl);
|
|
|
- // // }
|
|
|
- // // this.query = { ...query };
|
|
|
- // let queryId = '';
|
|
|
- // checkLogin()
|
|
|
- // .then(() => {
|
|
|
- // return this.getHistorySelectedArea();
|
|
|
- // })
|
|
|
- // .then(historyArea => {
|
|
|
- // let historyAreaInfo = data.find(e => e.id == historyArea.spaceId);
|
|
|
- // return getMapInfoHttp().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 = queryId || historyArea.spaceId;
|
|
|
- // console.log('httpDdata----', httpDdata);
|
|
|
- // console.log('historyArea----', historyArea);
|
|
|
- // const combinedData = httpDdata.reduce((acc, cur) => {
|
|
|
- // const target = acc.find(e => e.id == cur.id);
|
|
|
- // selectarea = acc.find(e => e.id == selectAraeId);
|
|
|
- // if (target) {
|
|
|
- // Object.assign(target, { title: cur.localName });
|
|
|
- // // console.log('找到了', cur, index);
|
|
|
- // } else {
|
|
|
- // // console.log('data有没找到', cur.id);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (target && target.id == selectAraeId) {
|
|
|
- // selectarea = { ...target }; // 如果有新数据,则更新选中的数据
|
|
|
- // }
|
|
|
- // return acc;
|
|
|
- // }, data);
|
|
|
- // this.mapAreasInfo = data;
|
|
|
- // // 如果从博瑞尚格智慧空间过来,面板是折叠起来,并且不能滑动
|
|
|
- // // if (from == 'officehome' && queryId) {
|
|
|
- // if (from == 'officehome') {
|
|
|
- // // this.foldPanelFun();
|
|
|
- // this.doSelectArea(selectarea);
|
|
|
- // // this.getSpaceTem();
|
|
|
- // } else {
|
|
|
- // this.autoSelectArea(selectarea);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // getScreenInfo().then(res => {
|
|
|
- // this.screenScale = res.screenScale;
|
|
|
- // });
|
|
|
-
|
|
|
- // this.getMapScale().then(res => {
|
|
|
- // this.mapScale = res.mapScale;
|
|
|
- // this.mapWidth = Math.ceil(res.mapScale * standerMapWidth); // 因为有小数点的误差,故增加一部分
|
|
|
- // this.mapHeight = res.mapHeight;
|
|
|
- // this.mapParentHeight = res.mapHeight;
|
|
|
- // this.mapParentWidth = res.screenWidth;
|
|
|
- // });
|
|
|
- // },
|
|
|
ready() {
|
|
|
// 页面加载
|
|
|
// let from = query.from;
|
|
@@ -470,21 +394,16 @@ wepy.component({
|
|
|
this.foldStatus = 'fold';
|
|
|
this.canSlideExpanel = false;
|
|
|
}
|
|
|
- // let qrcodeUrl = '';
|
|
|
- // if (query.q) {
|
|
|
- // qrcodeUrl = decodeURIComponent(query.q);
|
|
|
- // let params = utils.getUrlParams(qrcodeUrl);
|
|
|
- // }
|
|
|
- // this.query = { ...query };
|
|
|
+
|
|
|
checkHasUserInfo()
|
|
|
- .then((userInfo) => {
|
|
|
+ .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) => {
|
|
|
+ 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;
|
|
@@ -492,11 +411,11 @@ wepy.component({
|
|
|
this.getMapSize();
|
|
|
return this.getHistorySelectedArea();
|
|
|
})
|
|
|
- .then((historyArea) => {
|
|
|
+ .then(historyArea => {
|
|
|
let historyAreaInfo = CompanyMapData.mapInfo.find(
|
|
|
- (e) => e.id == historyArea.spaceId
|
|
|
+ e => e.id == historyArea.spaceId
|
|
|
);
|
|
|
- return getMapInfoHttp(this.companyId).then((res) => {
|
|
|
+ return getMapInfoHttp(this.companyId).then(res => {
|
|
|
const result = JSON.parse(res.data);
|
|
|
const httpDdata = (result && result.content) || [];
|
|
|
return {
|
|
@@ -505,29 +424,33 @@ wepy.component({
|
|
|
};
|
|
|
});
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
const { httpDdata, historyArea } = res;
|
|
|
let historyAreaInfo;
|
|
|
let selectarea;
|
|
|
let selectAraeId = null;
|
|
|
if (from == 'officehome') {
|
|
|
- selectAraeId = this.spaceIdProp
|
|
|
+ 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
|
|
|
+ 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;
|
|
|
+ .split(',')
|
|
|
+ : undefined;
|
|
|
});
|
|
|
combinedData = httpDdata.reduce((acc, cur) => {
|
|
|
- let target = acc.find((e) => e.id == cur.id);
|
|
|
+ let target = acc.find(e => e.id == cur.id);
|
|
|
|
|
|
- selectarea = acc.find((e) => e.id == selectAraeId);
|
|
|
+ selectarea = acc.find(e => e.id == selectAraeId);
|
|
|
if (target) {
|
|
|
Object.assign(target, { title: cur.localName });
|
|
|
} else {
|
|
@@ -804,7 +727,9 @@ wepy.component({
|
|
|
wx.uma.trackEvent('officeHome_map-find', { key: '环境调节-地图-找找' });
|
|
|
|
|
|
wx.navigateTo({
|
|
|
- url: `/packagesEnv/pages/intelligentControl/search/search?canSearchPerson=${this.canSearchPerson}&companyId=${this.companyId}&from=officehome`
|
|
|
+ url: `/packagesEnv/pages/intelligentControl/search/search?canSearchPerson=${
|
|
|
+ this.canSearchPerson
|
|
|
+ }&companyId=${this.companyId}&from=officehome`
|
|
|
});
|
|
|
},
|
|
|
goBack() {
|