|
|
@@ -15,6 +15,7 @@ import Right12 from './comps/right/top/2/index.vue'; |
|
|
|
import Right22 from './comps/right/middle/2/index.vue'; |
|
|
|
import Right32 from './comps/right/bottom/2/index.vue'; |
|
|
|
import Bottom2 from './comps/buttom/2/index.vue'; |
|
|
|
import Bottom1 from './comps/buttom/1/index.vue'; |
|
|
|
|
|
|
|
import { getConfigKey } from "@/api/system/config"; |
|
|
|
import { getInfo } from "@/api/login"; |
|
|
@@ -44,7 +45,8 @@ export default { |
|
|
|
Right12, |
|
|
|
Right22, |
|
|
|
Right32, |
|
|
|
Bottom2 |
|
|
|
Bottom2, |
|
|
|
Bottom1 |
|
|
|
}, |
|
|
|
data () { |
|
|
|
return { |
|
|
@@ -137,10 +139,53 @@ export default { |
|
|
|
if (dept.children) { |
|
|
|
this.addDeptLayer(dept.children, 'yellow.png'); |
|
|
|
} |
|
|
|
|
|
|
|
gis.getView().setCenter(fromLonLat(mapCenterLocation)) |
|
|
|
|
|
|
|
// 地图点击事件 |
|
|
|
gis.getMapContainer().on("click", (evt) => { |
|
|
|
let feature = this.map.forEachFeatureAtPixel( |
|
|
|
evt.pixel, |
|
|
|
(feature) => feature |
|
|
|
); |
|
|
|
if (feature) { |
|
|
|
// 镇级:加载村级坐标点 |
|
|
|
if (feature.get('level') === 'deptPoint') { |
|
|
|
let parentIds = []; |
|
|
|
this.findParentNodeIds(this.addrOptions, feature.get('deptId'), parentIds); |
|
|
|
this.addrText = parentIds; |
|
|
|
this.selectAddress(parentIds); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
selectAddress (value, isLocated = true) { // isLocated 控制地图是否跳转 |
|
|
|
this.queryParams.deptId = value[value.length - 1]; |
|
|
|
this.getData(DEPT_CHANGED); |
|
|
|
let node = this.$refs["cascader"].panel.getNodeByValue(value); |
|
|
|
this.drawMap(node, isLocated); |
|
|
|
}, |
|
|
|
|
|
|
|
// 查找指定deptId的所有父节点id |
|
|
|
findParentNodeIds (tree, deptId, result) { |
|
|
|
for (let node of tree) { |
|
|
|
if (node.id === deptId) { |
|
|
|
result.unshift(node.id); |
|
|
|
return true; |
|
|
|
} |
|
|
|
if (node.children && node.children.length > 0) { |
|
|
|
let isFind = this.findParentNodeIds(node.children, deptId, result); |
|
|
|
if (isFind) { |
|
|
|
result.unshift(node.id); |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 添加坐标点图层 |
|
|
|
addDeptLayer (nextDeptSet) { |
|
|
|
let features = []; |
|
|
@@ -161,6 +206,10 @@ export default { |
|
|
|
addTownBorder (deptIds) { |
|
|
|
gis.addImageLayer(this.mapGeoServerUrl, this.townBorderLayerName, deptIds) |
|
|
|
}, |
|
|
|
// 添加村边界 |
|
|
|
addVillageBorder (deptIds) { |
|
|
|
gis.addImageLayer(this.mapGeoServerUrl, this.villageBorderLayerName, deptIds) |
|
|
|
}, |
|
|
|
// 获取geoserver的地址 |
|
|
|
getGeoServerUrl () { |
|
|
|
// 获取geoserver的地址 |
|
|
|