|
@@ -51,8 +51,8 @@ export default {
|
|
init() {
|
|
init() {
|
|
this.map = new AMap.Map('mapInit', {
|
|
this.map = new AMap.Map('mapInit', {
|
|
resizeEnable: true, //是否监控地图容器尺寸变化
|
|
resizeEnable: true, //是否监控地图容器尺寸变化
|
|
- center: this.centet,
|
|
|
|
- zoom: 8, //初始化地图层级
|
|
|
|
|
|
+ center: !!this.centet[0] ? this.centet : '',
|
|
|
|
+ zoom: !!this.centet[0] ? 8 : 5, //初始化地图层级
|
|
mapStyle: 'amap://styles/darkblue',
|
|
mapStyle: 'amap://styles/darkblue',
|
|
defaultCursor: 'pointer'
|
|
defaultCursor: 'pointer'
|
|
});
|
|
});
|
|
@@ -177,7 +177,6 @@ export default {
|
|
let arrs = [];
|
|
let arrs = [];
|
|
this.fitersValue(arrs, data);
|
|
this.fitersValue(arrs, data);
|
|
this.centet = this.getPointsCenter(arrs);
|
|
this.centet = this.getPointsCenter(arrs);
|
|
-
|
|
|
|
resolve && resolve(true);
|
|
resolve && resolve(true);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -226,9 +225,11 @@ export default {
|
|
let thisValue = this.globalCommunity.value;
|
|
let thisValue = this.globalCommunity.value;
|
|
value.map((item) => {
|
|
value.map((item) => {
|
|
if (item.type == 'org') {
|
|
if (item.type == 'org') {
|
|
- this.fitersValue(arrs, item.children);
|
|
|
|
|
|
+ if (!!item.children) {
|
|
|
|
+ this.fitersValue(arrs, item.children);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- if (thisValue.includes(item.parentId)) {
|
|
|
|
|
|
+ if (!!thisValue && thisValue.includes(item.parentId)) {
|
|
arrs.push(item);
|
|
arrs.push(item);
|
|
}
|
|
}
|
|
}
|
|
}
|