diff --git a/ui/packages/ai/AiCopilot.vue b/ui/packages/ai/AiCopilot.vue index 06aeebc6..3d0d0e21 100644 --- a/ui/packages/ai/AiCopilot.vue +++ b/ui/packages/ai/AiCopilot.vue @@ -382,6 +382,7 @@ export default { white-space: nowrap; text-overflow: ellipsis; position: relative; + margin-bottom: 2px; .operation { position: absolute; diff --git a/ui/packages/tools/AiLocateDialog.vue b/ui/packages/tools/AiLocateDialog.vue index 875cf230..b6722a97 100644 --- a/ui/packages/tools/AiLocateDialog.vue +++ b/ui/packages/tools/AiLocateDialog.vue @@ -39,7 +39,6 @@ export default { map: null, AMap: null, selected: {}, - geo: null } }, watch: { @@ -63,33 +62,19 @@ export default { this.selected = {location: res.lnglat} this.poi?.searchNearBy('', res.lnglat, 100) }); - if (this.latlng) { - let marker = new AMap.Marker({ - position: [this.latlng.lng, this.latlng.lat] - }) - this.map.add(marker) - } - this.poi = new AMap.PlaceSearch().on('complete', ({poiList}) => { - this.map.clearMap() - if (poiList?.length > 0) { - poiList?.pois?.map(e => { - let marker = new AMap.Marker({ - position: e.location, - }).on('click', () => this.selected = e) - this.map.add(marker) - }) - } else { - let marker = new AMap.Marker({ - position: this.selected.location, - }) - this.map.add(marker) - } + this.poi = new AMap.PlaceSearch({map: this.map}).on('markerClick', ({data}) => { + const {name, location} = data + this.selected = {location, name} }) - this.geo = new AMap.Geolocation({ + if (this.latlng) { + this.map.add(new AMap.Marker({ + position: [this.latlng.lng, this.latlng.lat] + })) + } + this.map.addControl(new AMap.Geolocation({ enableHighAccuracy: true,//是否使用高精度定位 zoomToAccuracy: true//定位成功后是否自动调整地图视野到定位点 - }) - this.map.addControl(this.geo) + })) }) }, handleSearch(v) { @@ -114,7 +99,7 @@ export default {