Skip to content

Commit

Permalink
fix(components): 百度地图
Browse files Browse the repository at this point in the history
修复位置回显错误的问题
  • Loading branch information
h7ml committed Jun 23, 2022
1 parent a0e11b4 commit 38d6fd5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

### Features

* **components:** 百度地图 ([2028435](https://github.com/dgiot/dgiot-dashboard/commit/2028435e76e2a7de221266fa54b40d793c9495cb))
* **components:** 设备管理 ([0a9756c](https://github.com/dgiot/dgiot-dashboard/commit/0a9756cadaa45a0796f345fa064c1f1f239af7ee))
* **components:** 云压测 ([ed99eee](https://github.com/dgiot/dgiot-dashboard/commit/ed99eee177a5947609cfa35998bdd1f8b3d3a9ab))
* **projects:** 云压测 ([97a7f62](https://github.com/dgiot/dgiot-dashboard/commit/97a7f62e0b32949dc2bc4d1297a30befa76fe583))
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

### Features

* **components:** 百度地图 ([2028435](https://github.com/dgiot/dgiot-dashboard/commit/2028435e76e2a7de221266fa54b40d793c9495cb))
* **components:** 设备管理 ([0a9756c](https://github.com/dgiot/dgiot-dashboard/commit/0a9756cadaa45a0796f345fa064c1f1f239af7ee))
* **components:** 云压测 ([ed99eee](https://github.com/dgiot/dgiot-dashboard/commit/ed99eee177a5947609cfa35998bdd1f8b3d3a9ab))
* **projects:** 云压测 ([97a7f62](https://github.com/dgiot/dgiot-dashboard/commit/97a7f62e0b32949dc2bc4d1297a30befa76fe583))
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

### Features

* **components:** 百度地图 ([2028435](https://github.com/dgiot/dgiot-dashboard/commit/2028435e76e2a7de221266fa54b40d793c9495cb))
* **components:** 设备管理 ([0a9756c](https://github.com/dgiot/dgiot-dashboard/commit/0a9756cadaa45a0796f345fa064c1f1f239af7ee))
* **components:** 云压测 ([ed99eee](https://github.com/dgiot/dgiot-dashboard/commit/ed99eee177a5947609cfa35998bdd1f8b3d3a9ab))
* **projects:** 云压测 ([97a7f62](https://github.com/dgiot/dgiot-dashboard/commit/97a7f62e0b32949dc2bc4d1297a30befa76fe583))
Expand Down
30 changes: 9 additions & 21 deletions src/views/DeviceCloud/manage/js/proddetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,8 @@ export default {
methods: {
async handleAddressClose() {
this.dialog_address = !this.dialog_address
await putProduct(this.productObj.objectId, {
config: this.productdetail.config,
await putProduct(this.productObj.objectId, {
config: this.productdetail.config,
})
this.$message({
type: 'success',
Expand All @@ -918,7 +918,7 @@ export default {
},
inputAddress() {
const address = this.productdetail.config.addres
console.log(1111111111111111,addres)
console.log(1111111111111111, addres)
// https://lbsyun.baidu.com/jsdemo.htm#wAddressParseSingle 根据位置解析
var map = new BMapGL.Map('container')
map.centerAndZoom(new BMapGL.Point(116.331398, 39.897445), 12)
Expand All @@ -930,9 +930,7 @@ export default {
function (point) {
if (point) {
map.centerAndZoom(point, 16)
map.addOverlay(
new BMapGL.Marker(point, { title: address })
)
map.addOverlay(new BMapGL.Marker(point, { title: address }))
} else {
alert('您选择的地址没有解析到结果!')
}
Expand All @@ -944,10 +942,10 @@ export default {
mapClick(e) {
this.productdetail.config.location = {
__type: 'GeoPoint',
latitude: e.point.lat,
longitude: e.point.lng,
latitude: e.point.lng,
longitude: e.point.lat,
}
console.log(e,this.productdetail.config)
console.log(e, this.productdetail.config)
// this.center.lng = e.point.lng
// this.center.lat = e.point.lat
// this.addresspointer =
Expand Down Expand Up @@ -1155,6 +1153,7 @@ export default {
this.productObj = res
this.modules.data = setThing
this.productdetail.thing = setThing
this.productdetail.config = res.config
},
async submitModules(type, form) {
form.data.outputParams = []
Expand Down Expand Up @@ -3248,18 +3247,7 @@ export default {
if (response) {
this.productInfo = _.merge(response, {
decoder: { code: '' },
thing: { properties: [] },
config: {
parser: [],
profile: [],
basedate: { params: [] },
address: '余杭区良渚平高创业城c1座',
location: {
latitude: '120.161324',
longitude: '30.262441',
__type: 'GeoPoint',
},
},
thing: { properties: [] }
})
this.productName = response.name
for (var key in response) {
Expand Down

0 comments on commit 38d6fd5

Please sign in to comment.