强制重新加载地图,并增加兼容旧样式的埋点

This commit is contained in:
aixianling
2023-04-11 16:16:33 +08:00
parent 481f3f13b3
commit 7330da14eb
3 changed files with 14 additions and 8 deletions

View File

@@ -111,10 +111,7 @@ export default {
watch: { watch: {
values: { values: {
immediate: true, immediate: true,
deep: true, handler(v) { deep: true, handler() {
if (this.currentType == 'map') {
this.renderMap()
}
if (this.currentType === 'AiDvTable') { if (this.currentType === 'AiDvTable') {
this.dvTableConfig = this.data[this.data.dataType].map((v, i) => { this.dvTableConfig = this.data[this.data.dataType].map((v, i) => {
return { return {
@@ -123,7 +120,6 @@ export default {
align: this.data.config[i] ? (this.data.config[i].align || '') : '' align: this.data.config[i] ? (this.data.config[i].align || '') : ''
} }
}) })
this.data.config = this.dvTableConfig this.data.config = this.dvTableConfig
} }
} }
@@ -168,7 +164,7 @@ export default {
renderMap(count = 0) { renderMap(count = 0) {
let {lib: AMap, map} = this let {lib: AMap, map} = this
this.timer && clearInterval(this.timer) this.timer && clearInterval(this.timer)
if (AMap) { if (AMap && map) {
let infoWin = new AMap.InfoWindow({content: ""}) let infoWin = new AMap.InfoWindow({content: ""})
map.clearMap() map.clearMap()
this.values.filter(e => e.lng).map(e => { this.values.filter(e => e.lng).map(e => {

View File

@@ -146,6 +146,15 @@
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="layout-config__item">
<label>样式设置</label>
<div class="layout-config__item--right">
<el-select size="mini" v-model="dashboard.style" placeholder="请选择">
<el-option label="默认" value="black"/>
<el-option label="经典" value="classic"/>
</el-select>
</div>
</div>
<div class="layout-config__item"> <div class="layout-config__item">
<label>背景图</label> <label>背景图</label>
<div class="layout-config__item--right layout-config__item--bg"> <div class="layout-config__item--right layout-config__item--bg">
@@ -261,7 +270,8 @@ export default {
height: 1080, height: 1080,
theme: '0', theme: '0',
backgroundColor: '', backgroundColor: '',
backgroundImage: [] backgroundImage: [],
style: 'black'
}, },
menuX: 0, menuX: 0,
menuY: 0, menuY: 0,

View File

@@ -72,7 +72,7 @@ export default {
this.$emit("loaded") this.$emit("loaded")
this.mapLoaded() this.mapLoaded()
} }
}) }).catch(this.initMap)
}, },
getMapArea() { getMapArea() {
const {mapLib: AMap} = this const {mapLib: AMap} = this