diff --git a/src/apps/AppBuilding/components/searchMap.vue b/src/apps/AppBuilding/components/searchMap.vue
index 987bb198..20910316 100644
--- a/src/apps/AppBuilding/components/searchMap.vue
+++ b/src/apps/AppBuilding/components/searchMap.vue
@@ -331,7 +331,7 @@ export default {
addMakert(points) {
this.$nextTick(() =>{
let {lib: TMap, map} = this
- var center = new TMap.LatLng(this.latLngCenter.lat, this.latLngCenter.lng)
+ var center = new TMap.LatLng(this.latLngCenter.lat, this.latLngCenter.lng)
map.setCenter(center)
var marker = null;
map.setZoom(18)
diff --git a/src/apps/AppGridManagement/components/detail.vue b/src/apps/AppGridManagement/components/detail.vue
index dc15ca0a..31550c96 100644
--- a/src/apps/AppGridManagement/components/detail.vue
+++ b/src/apps/AppGridManagement/components/detail.vue
@@ -1,13 +1,12 @@
-
+
网格选择
-
-
-
-
+
+ {{form.gridName || '请选择社区居委会'}}
+
@@ -33,6 +32,8 @@
+
+
@@ -47,80 +48,80 @@ export default {
lib: '',
map: null,
show: false,
- form: {},
- treeList: []
+ form: {gridName: '', id: ''},
+ treeList: [],
+ showSelect: false,
+ editor: null,
}
},
computed: { ...mapState(['user']) },
mounted() {
this.areaId = this.user.areaId
this.initMap()
+ this.getTreeList()
},
methods: {
- handerSelect() {
-
+ handerSelect(e) {
+ console.log(e)
+ this.form.gridName = e.girdName
+ this.form.id = e.id
+ this.initMap(e.points)
},
- initMap() {
+ initMap(points) {
//初始化地图
-
this.$nextTick(() =>{
let {lib: TMap, map} = this
- var center = new TMap.LatLng(40.040422, 116.273521)
- var marker = null;
- var points = []
+ var center = new TMap.LatLng(points[0].lat, points[0].lng)
map.setCenter(center)
- map.setZoom(18)
+ map.setZoom(15)
- marker = new TMap.MultiMarker({
- id: 'marker-layer', // 图层id
- map: map,
- styles: {
- // 点标注的相关样式
- marker: new TMap.MarkerStyle({
- width: 25,
- height: 35,
- anchor: { x: 16, y: 32 },
- src:'',
- }),
- },
- geometries: [
+ console.log(points)
+ var simplePath = []
+
+ points.map((item) => {
+ var info = new TMap.LatLng(item.lat, item.lng)
+ simplePath.push(info)
+ })
+
+ // 初始化几何图形及编辑器
+ this.editor = new TMap.tools.GeometryEditor({
+ map, // 编辑器绑定的地图对象
+ overlayList: [ // 可编辑图层
{
- // 点标注数据数组
- id: 'demo',
- styleId: 'marker',
- position: new TMap.LatLng(40.040422, 116.273521),
- },
+ overlay: new TMap.MultiPolygon({
+ map,
+ styles: {
+ highlight: new TMap.PolygonStyle({
+ color: 'rgba(255, 255, 0, 0.6)'
+ })
+ },
+ geometries: [
+ {
+ paths: simplePath
+ },
+ ]
+ }),
+ id: 'polygon',
+ selectedStyleId: 'highlight'
+ }
],
+ actionMode: TMap.tools.constants.EDITOR_ACTION.INTERACT, // 编辑器的工作模式
+ activeOverlayId: 'polygon', // 激活图层
+ selectable: true, // 开启点选功能
+ snappable: true // 开启吸附
});
- var infoWindow = null;
- var infoWindow2 = null
- var html = `
`
- +`腾讯大厦
`
-
- infoWindow = new TMap.InfoWindow(
- {
- map: map,
- enableCustom: true,
- position: new TMap.LatLng(40.040422, 116.273521),
- offset: { y: -70, x: -5 },
- content: html
- },
- );
-
- infoWindow2 = new TMap.InfoWindow(
- {
- map: map,
- enableCustom: true,
- position: new TMap.LatLng(40.03592, 116.27058),
- offset: { y: -70, x: -5 },
- content: html
- },
- );
})
},
+ getTreeList() {
+ this.$http.post(`/app/appgirdinfo/listAll`).then((res) => {
+ if (res.code == 0) {
+ this.treeList = res.data
+ }
+ })
+ }
}
}
@@ -202,4 +203,7 @@ ai-tree-picker{
}
}
}
+.grid-name{
+ display: inline-block;
+}
\ No newline at end of file
diff --git a/src/components/AiTreePicker.vue b/src/components/AiTreePicker.vue
index bc818028..6b591434 100644
--- a/src/components/AiTreePicker.vue
+++ b/src/components/AiTreePicker.vue
@@ -4,18 +4,18 @@
@@ -51,8 +51,8 @@ export default {
while (meta.length > 0) {
let p = meta.shift()
origin.push(p)
- if (p.children?.length > 0) {
- meta.push(p.children.map((c) => ({ ...c, parent: p.id })))
+ if (p.girdList?.length > 0) {
+ meta.push(p.girdList.map((c) => ({ ...c, parent: p.id })))
}
}
return origin.flat()
@@ -82,12 +82,12 @@ export default {
this.fullSelected = pend.reverse()
}
},
- getChildren(id) {
- if (id) this.list = this.origin?.find((e) => e.id == id)?.children || []
+ getgirdList(id) {
+ if (id) this.list = this.origin?.find((e) => e.id == id)?.girdList || []
else this.list = this.ops
},
handleSelect(op) {
- if (op.children?.length > 0) {
+ if (op.girdList?.length > 0) {
this.getChild(op)
} else {
if (op.id != this.index) {
@@ -102,21 +102,21 @@ export default {
getChild(op) {
this.fullSelected.push(op)
this.index = op.id
- this.getChildren(op.id)
+ this.getgirdList(op.id)
},
selectNode(item, i) {
this.fullSelected.splice(i + 1, this.fullSelected.length - i)
- if (item.children?.length <= 0) {
+ if (item.girdList?.length <= 0) {
this.index = item.id
}
- this.getChildren(item.id)
+ this.getgirdList(item.id)
},
handleInit() {
this.index = this.currentSelected.id
- this.getChildren(this.currentSelected.id)
+ this.getgirdList(this.currentSelected.id)
},
showArrow(op) {
- return this.index != op.id && op.children?.length > 0
+ return this.index != op.id && op.girdList?.length > 0
},
},
created() {