From 828fedaae4ff767e0b9696a2a0702ab4d3721c66 Mon Sep 17 00:00:00 2001
From: guoshipeng <3194674006@qq.com>
Date: Mon, 14 Aug 2023 13:43:20 +0800
Subject: [PATCH] fix:设备详情百度地图换高德地图,批量修改补偿修改
---
src/components/map/pickCoordinate1.vue | 198 +++++++++++++++++++++++++++++++++++++------------
1 files changed, 149 insertions(+), 49 deletions(-)
diff --git a/src/components/map/pickCoordinate1.vue b/src/components/map/pickCoordinate1.vue
index 4b75cec..8016aba 100644
--- a/src/components/map/pickCoordinate1.vue
+++ b/src/components/map/pickCoordinate1.vue
@@ -9,25 +9,67 @@
class="modalStyle"
>
<div>
- <p>
- <span>���������</span
- ><a-input
- v-model="keyword"
- style="display: inline; width: 160px; height: 26px"
- />
- <span style="margin-left: 25px">���������</span
- ><a-input
- v-model="clickPoint.lng"
- style="display: inline; width: 160px; height: 26px"
- />
- <span style="margin-left: 25px">���������</span
- ><a-input
- v-model="clickPoint.lat"
- style="display: inline; width: 160px; height: 26px"
- />
- </p>
+ <div style="display: flex">
+ <div style="display: flex; width: 300px">
+ <div>���������</div>
+ <a-input
+ placeholder="���������������"
+ id="tipinput"
+ style="width: 160px; height: 26px"
+ ></a-input>
+ <!-- <a-input
+ v-model="input"
+ placeholder="���������������"
+ id="tipinput"
+ style="width: 160px; height: 26px"
+ @change="searchMap"
+ ></a-input> -->
+ <!-- <a-button
+ size="small"
+ type="primary"
+ @click="searchMap"
+ style="margin-left: 10px"
+ >������</a-button
+ > -->
+
+ <!-- <el-amap-search-box
+ :search-option="searchOption"
+ :on-search-result="selectPoi"
+ style="width: 200px; height: 26px; margin-left: 10px;border;"
+ /> -->
+ <!-- <a-input style="width: 160px; height: 26px" @focus="selectPoi" /> -->
+ </div>
+ <div>
+ <span style="margin-left: 25px">���������</span
+ ><a-input
+ v-model="clickPoint[0]"
+ style="display: inline; width: 160px; height: 26px"
+ />
+ </div>
+ <div>
+ <span style="margin-left: 25px">���������</span
+ ><a-input
+ v-model="clickPoint[1]"
+ style="display: inline; width: 160px; height: 26px"
+ />
+ </div>
+ </div>
+ <el-amap
+ ref="map"
+ :center="clickPoint"
+ :events="{ click: mapClick }"
+ :zoom="zoom"
+ :scroll-wheel-zoom="true"
+ style="height: 400px; width: 100%; margin-top: 20px"
+ >
+ <el-amap-marker
+ :position="clickPoint"
+ animation="AMAP_ANIMATION_BOUNCE"
+ :dragging="true"
+ ></el-amap-marker>
+ </el-amap>
<!-- :scroll-wheel-zoom="true"-->
- <baidu-map
+ <!-- <baidu-map
:center="center"
:zoom="zoom"
@ready="handler"
@@ -48,7 +90,7 @@
>
</bm-marker>
</bm-control>
- </baidu-map>
+ </baidu-map> -->
</div>
</a-modal>
</template>
@@ -67,10 +109,10 @@
@Component({
})
export default class PickCoordinate extends Vue {
- private center: any = {
- lng: 120.726838,
- lat: 31.3421
- }
+ private center: any = [
+ 120.726838,
+ 31.3421
+ ]
@Prop({
type: String,
default: ''
@@ -84,13 +126,17 @@
private typeOperation!: string
private keyword: string = ''
- private zoom = 3
-
- @Watch('clickPoint', {deep: true})
- private monitorMapFlag(newVal: any, oldVal: any) {
- this.center.lng = newVal.lng
- this.center.lat = newVal.lat
+ private zoom = 19
+ private searchOption:any={
+ city: '������',
+ citylimit: false
}
+ @Watch('clickPoint', {deep: true, immediate: true},)
+ private monitorMapFlag(newVal: any, oldVal: any) {
+ console.log(newVal,'newVal');
+ this.center= [newVal.lng,newVal.lat]
+ }
+ private num1:any=1
@Watch('lnglat', {deep: true, immediate: true})
private lnglatWatch(newVal: any, oldVal: any) {
@@ -100,32 +146,68 @@
// this.center.lat = newVal.lat
}
private created() {
-
+ console.log(this.clickPoint,'clickPoint');
}
-
-
-
// ���������������
- private handler({BMap, map}) {
- this.center.lng = this.typeOperation === 'add' ? '120.726838' : this.lnglat.split(',')[1]
- this.center.lat = this.typeOperation === 'add' ? '31.3421' : this.lnglat.split(',')[0]
- this.zoom = 19
+ // private handler({BMap, map}) {
+ // this.center.lng = this.typeOperation === 'add' ? '120.726838' : this.lnglat.split(',')[1]
+ // this.center.lat = this.typeOperation === 'add' ? '31.3421' : this.lnglat.split(',')[0]
+ // this.zoom = 19
+
+ // }
+ private selectPoi(e){
+ console.log(e);
+ let poi = e
+ if (poi.length > 0) {
+ this.clickPoint = [poi[0].lng, poi[0].lat]
+ }
+ }
+ private input:any=''
+ private mark:any=''
+ private searchMap(){
+ var autoOptions = {
+ input: "tipinput"
+ };
+ var auto = new AMap.AutoComplete(autoOptions);
+ const placeSearch = new AMap.PlaceSearch(this.input);
+ console.log(window);
+ auto.on("select", select);//������������������������������������������������
+ function select(e) {
+ console.log(e.poi.adcode);
+ placeSearch.setCity(e.poi.adcode);
+ placeSearch.search(e.poi.name); //���������������������
+ }
+
+ // ���������������
+ // console.log(this.input);
+ // placeSearch.search(this.input, (status, result) => {
+ // // ������������������result������������������POI������
+
+ // console.log(result);//���������������������������������������������������������������������������
+ // });
+ // // ������������������������
+ // AMap.event.addListener(placeSearch, "selectChanged", (SelectChangeEvent) => {
+ // // ������������������������������������������
+ // this.mark = SelectChangeEvent.selected.data;
+ // console.log(SelectChangeEvent.selected.data,'������');
+ // });
}
// ���������������������������
- private clickPoint: any = this.lnglat === '' ? {
- lng: ' 120.726838',
- lat: ' 31.3421'
- } : {
- lng: this.lnglat.split(',')[1],
- lat: this.lnglat.split(',')[0]
- }
+ private clickPoint: any = this.lnglat === '' ? [
+ 120.720262,
+ 31.335757
+ ] : [
+ this.lnglat.split(',')[1],
+ this.lnglat.split(',')[0]
+ ]
private mapClick(e: any) {
- const { lng, lat } = e.point
- this.clickPoint.lng = lng
- this.clickPoint.lat = lat
+ const { lng, lat } = e.lnglat
+ this.clickPoint=[ lng, lat]
+ this.$forceUpdate()
+ // console.log(this.clickPoint);
}
private handleMapCancel() {
@@ -135,11 +217,12 @@
private addLonAndLat() {
if (this.typeOperation === 'add') {
+ console.log('add');
this.sendLonLat(this.clickPoint)
} else {
+ console.log('upa');
this.editLonLat(this.clickPoint)
}
-
this.flagSend(false)
}
@@ -150,17 +233,19 @@
@Emit('sendLonLat')
private sendLonLat(lonLat: any) {
+ console.log(lonLat,'jia');
return lonLat;
}
@Emit('editLonLat')
private editLonLat(lonLat: any) {
+ console.log(lonLat,'gai');
return lonLat;
}
}
</script>
-<style lang="less">
+<style lang="less" scoped>
.modalStyle {
.ant-modal {
margin-left: 25%;
@@ -173,4 +258,19 @@
.anchorBL {
display: none;
}
+/* ���������������������logo */
+/deep/.amap-logo {
+ display: none;
+ opacity: 0 !important;
+}
+/deep/.amap-copyright {
+ opacity: 0;
+}
+.amap-sug-result {
+ position: absolute;
+ z-index: 9999 !important;;
+ background-color: #fefefe;
+ border: 1px solid #d1d1d1;
+ bottom: auto;
+}
</style>
--
Gitblit v1.8.0