Browse Source

fix-更新一下

wangqin
IAMHERE 11 months ago
parent
commit
68bee86d8f
  1. 6
      ruoyi-ui/src/views/index.vue
  2. 29
      ruoyi-ui/src/views/map/index.vue

6
ruoyi-ui/src/views/index.vue

@ -240,9 +240,9 @@ export default {
boardEmitItem: {}, // boardEmitItem: {}, //
activeName: 'first', activeName: 'first',
dialogTit: '门架式可变信息标志YK16+270', dialogTit: '门架式可变信息标志YK16+270',
dialogInfoLeft: false, dialogInfoLeft: true,
dialogInfoRight: false, dialogInfoRight: false,
dialogInfoCamera: false, dialogInfoCamera: true,
mapDialogTop: '0px', mapDialogTop: '0px',
mapDialogLeft: '0px', mapDialogLeft: '0px',
keyMonitoringList: [ keyMonitoringList: [
@ -331,7 +331,7 @@ export default {
this.getTemplateHeaderFn() this.getTemplateHeaderFn()
// this.getTemplateFn() // this.getTemplateFn()
}, },
// // //
// watch: { // watch: {
// data: { // data: {
// // ,使handler // // ,使handler

29
ruoyi-ui/src/views/map/index.vue

@ -47,22 +47,35 @@ export default {
] ]
} }
}, },
// created() { created() {
// this.getEnergyBoardFn()
// },
mounted() {
this.getEnergyBoardFn() this.getEnergyBoardFn()
// this.initAMap() },
mounted() {
this.initAMap()
}, },
unmounted() { unmounted() {
this.map?.destroy() this.map?.destroy()
}, },
//
watch: {
markBoardDataList: {
// ,使handler
handler(newVal, oldVal) {
this.initAMap()
// console.log(newVal);
// console.log(oldVal);
},
// true(immediatefalse)
immediate: true
// true
// deep: true
}
},
methods: { methods: {
getEnergyBoardFn() { getEnergyBoardFn() {
getEnergyBoardAPi().then(res => { getEnergyBoardAPi().then(res => {
console.log('地图首页情报板点位', res) console.log('地图首页情报板点位', res)
this.markBoardDataList = res this.markBoardDataList = res
this.initAMap()
}) })
}, },
initAMap() { initAMap() {
@ -351,7 +364,7 @@ export default {
// Marker // Marker
let marker = new AMap.Marker({ let marker = new AMap.Marker({
position: new AMap.LngLat(...item.lnp.split(',')), // [116.39, 39.9] position: new AMap.LngLat(...item.lnp.split(',')), // [116.39, 39.9]
offset: new AMap.Pixel(0, 0), offset: new AMap.Pixel(-25, -50),
title: item.deviceName, title: item.deviceName,
map: this.map, map: this.map,
extData: item, extData: item,
@ -364,7 +377,7 @@ export default {
}) })
}) })
marker.setLabel({ marker.setLabel({
offset: new AMap.Pixel(0, 10), // offset: new AMap.Pixel(0, 0), //
content: '', // content: '', //
// content: "<div style='padding:1vh 1vw;background-color:rgba(0,0,0,0);border:0;font-size:19px;color:rgba(188, 218, 250, 1);'>" + item.tit + '</div>', // // content: "<div style='padding:1vh 1vw;background-color:rgba(0,0,0,0);border:0;font-size:19px;color:rgba(188, 218, 250, 1);'>" + item.tit + '</div>', //
direction: 'top' // direction: 'top' //

Loading…
Cancel
Save