From 53db46f90ab005f5c8556092e891ecda730c2df5 Mon Sep 17 00:00:00 2001
From: weicw <594098497@qq.com>
Date: Thu, 3 Feb 2022 17:22:31 +0800
Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E4=BD=8D=E4=BF=AE=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/ecology/noise/road-noise-place.js | 7 +-
src/views/sound/road/dict/place.vue | 54 +++---
src/views/visualiz/sound/road/index.vue | 193 +++++++++++++++++++++-
3 files changed, 218 insertions(+), 36 deletions(-)
diff --git a/src/api/ecology/noise/road-noise-place.js b/src/api/ecology/noise/road-noise-place.js
index 594f91a..fae5729 100644
--- a/src/api/ecology/noise/road-noise-place.js
+++ b/src/api/ecology/noise/road-noise-place.js
@@ -6,6 +6,10 @@ const listAllUrl = baseUri + "";
const savePlace = function (data) {
return axios.post("/sound/road/place",data)
}
+// 添加
+const getPlace = function (id) {
+ return axios.get("/sound/road/place/" + id)
+}
// 批量添加
const savePlaceBatch = function (data) {
return axios.post("/sound/road/place/batch",data)
@@ -37,6 +41,7 @@ export {
removePlace,
getColumnOptions,
copyBatchPlace,
- savePlaceBatch
+ savePlaceBatch,
+ getPlace
}
diff --git a/src/views/sound/road/dict/place.vue b/src/views/sound/road/dict/place.vue
index fb8fb05..5c258b0 100644
--- a/src/views/sound/road/dict/place.vue
+++ b/src/views/sound/road/dict/place.vue
@@ -21,7 +21,8 @@
查询
- 重置
+ 重置
+
@@ -90,22 +91,18 @@
-
-
+
+
选择位置
-
-
-
- 选择位置
-
-
-
-
+
+
确定
@@ -167,7 +164,8 @@
>
导入
- 导出
+ 导出
+
@@ -284,15 +282,11 @@ export default {
where: this.where,
});
},
- showRoadMap(roadAttr,lng,lat) {
+ showRoadMap(form) {
+ const {placeLng,placeLat,correctLng,correctLat} = form
this.visibleRoadMap = true
- if(roadAttr === "start"){
- this.roadMapTitle = "选择道路起点"
- }else {
- this.roadMapTitle = "选择道路终点"
- }
+ this.roadMapTitle = "选择修正后的道路坐标"
this.$nextTick(() => {
- console.log(lat,lng)
console.log(this.$refs.roadMap)
// eslint-disable-next-line no-undef
var map = new BBMap.Map(this.$refs.roadMap); // 创建Map实例
@@ -300,22 +294,18 @@ export default {
map.addControl(new BBMap.NavigationControl()); //初始化地图控件
map.addControl(new BBMap.ScaleControl());
map.addControl(new BBMap.OverviewMapControl());
- var point = new BBMap.Point(lng?lng:108.33, lat?lat:22.84);
+ var point = new BBMap.Point(correctLng?correctLng:placeLng?placeLng:108.33,correctLat?correctLat:placeLat?placeLat:22.84);
+ // var point = new BBMap.Point(form.placeLng ? form.placeLng : 108.33, form.placeLat ? form.placeLat : 22.84);
map.centerAndZoom(point, 13);//初始化地图中心点
var marker = new BBMap.Marker(point); //初始化地图标记
marker.enableDragging(); //标记开启拖拽
var gc = new BBMap.Geocoder();//地址解析类
//添加标记拖拽监听
- marker.addEventListener("dragend", (e)=> {
+ marker.addEventListener("dragend", (e) => {
//获取地址信息
- if(roadAttr === "start"){
- this.form['roadStartLng'] = e.point.lng
- this.form['roadStartLat'] = e.point.lat
- }else {
- this.form['roadEndLng'] = e.point.lng
- this.form['roadEndLat'] = e.point.lat
- }
+ this.form['correctLng'] = e.point.lng
+ this.form['correctLat'] = e.point.lat
gc.getLocation(e.point, function (rs) {
showLocationInfo(e.point, rs);
@@ -332,11 +322,11 @@ export default {
map.centerAndZoom(point, 15); //设置中心点坐标和地图级别
map.addOverlay(marker); //将标记添加到地图中
//显示地址信息窗口
- function showLocationInfo(pt, rs){
+ function showLocationInfo(pt, rs) {
var opts = {
- width : 250, //信息窗口宽度
+ width: 250, //信息窗口宽度
height: 100, //信息窗口高度
- title : "" //信息窗口标题
+ title: "" //信息窗口标题
}
var addComp = rs.addressComponents;
var addr = "当前位置:" + addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber + "
";
diff --git a/src/views/visualiz/sound/road/index.vue b/src/views/visualiz/sound/road/index.vue
index c5e2437..aa2de41 100644
--- a/src/views/visualiz/sound/road/index.vue
+++ b/src/views/visualiz/sound/road/index.vue
@@ -28,6 +28,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 选择位置
+
+
+
+
+
+
+
+ 确定
+
+
+
+
+
+
+
+