fix: 系统组件修改配置时,修复出现'TypeError: _this99220refs.customStyle is not a function'的问题

main
wu.jian2 2 years ago
parent 89c5f95e2f
commit 9781e2c783

@ -90,7 +90,8 @@ export default {
},
linkage (row) {
this.$emit('linkage', row)
}
},
customStyle () {}
}
}
</script>

@ -20,7 +20,9 @@
'font-weight':customize.firstWeight,
'margin-bottom':customize.lineDistance +'px'
}"
>{{tableData?tableData:'' }}</div>
>
{{ tableData?tableData:'' }}
</div>
<div
:style="{
'font-size': customize.secondSize + 'px',
@ -28,7 +30,8 @@
color:customize.secondColor,
'font-weight':customize.secondWeight,
}"
class="content-right-second">
class="content-right-second"
>
{{ customize.secondLine }}
</div>
</div>
@ -49,7 +52,7 @@ export default {
default: () => ({})
}
},
data() {
data () {
return {
customClass: {}
}
@ -81,6 +84,7 @@ export default {
}
},
methods: {
customStyle () {}
}
}
</script>

@ -14,6 +14,7 @@
<script>
import AMapLoader from '@amap/amap-jsapi-loader'
import cloneDeep from 'lodash/cloneDeep'
export default {
name: 'RemoteMap',
props: {
@ -44,13 +45,14 @@ export default {
},
mounted () {
this.initMap()
this.initMap(this.customize)
},
methods: {
initMap () {
initMap (customize) {
this.loading = true
this.updateKey = 0
AMapLoader.load({
key: this.customize.mapKey || '1b0a1423b70bbcbc20c9c87327e5e94e', // WebKey load
key: customize.mapKey || '1b0a1423b70bbcbc20c9c87327e5e94e', // WebKey load
version: '1.4.15', // JSAPI 1.4.15
plugins: [
'AMap.ToolBar',
@ -64,12 +66,12 @@ export default {
// eslint-disable-next-line no-undef
this.map = new AMap.Map(`map-${this.config.code}`, {
resizeEnable: true, //
lang: this.customize.lang,
mapStyle: `amap://styles/${this.customize.mapStyle}`,
center: [this.customize.lng, this.customize.lat],
features: this.customize.features,
zoom: this.customize.zoom,
viewMode: this.customize.viewMode,
lang: customize.lang,
mapStyle: `amap://styles/${customize.mapStyle}`,
center: [customize.lng, customize.lat],
features: customize.features,
zoom: customize.zoom,
viewMode: customize.viewMode,
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.MapType', 'AMap.Geolocation']
})
this.loading = false
@ -85,7 +87,7 @@ export default {
// eslint-disable-next-line no-undef
this.map.addControl(new AMap.Geolocation())
let marker = null //
if (this.customize.markerSpan) {
if (customize.markerSpan) {
//
const markerContent = document.createElement('div')
markerContent.style.position = 'absolute'
@ -102,7 +104,7 @@ export default {
//
const markerSpan = document.createElement('span')
markerSpan.className = 'marker'
markerSpan.innerHTML = this.customize.markerSpan
markerSpan.innerHTML = customize.markerSpan
markerContent.appendChild(markerSpan)
//
if (marker) {
@ -111,7 +113,7 @@ export default {
//
// eslint-disable-next-line no-undef
marker = new AMap.Marker({
position: [this.customize.markerLng, this.customize.markerLat],
position: [customize.markerLng, customize.markerLat],
content: markerContent,
// eslint-disable-next-line no-undef
offset: new AMap.Pixel(0, 0) // 使
@ -130,6 +132,11 @@ export default {
}
}
})
},
customStyle (config) {
if (config && config.option && config.option.customize) {
this.initMap(config.option.customize)
}
}
}
}

@ -71,6 +71,7 @@ export default {
}
},
methods: {
customStyle () {}
}
}
</script>

@ -116,6 +116,13 @@ const option = {
export default {
title,
option,
setting
setting,
option: {
...option,
displayOption: {
dataAllocation: {
enable: false
}
}
}
}

@ -141,7 +141,9 @@ export default {
rightDiagonal.style.top = `${this.customize.borderWidth / 2}px`
}
},
methods: {}
methods: {
customStyle () {}
}
}
</script>
<style lang="scss" scoped>

@ -36,7 +36,7 @@
'font-weight':customize.firstWeight,
'margin-bottom':customize.lineDistance +'px'
}"
>{{tableData?tableData:'' }}</span>
>{{ tableData?tableData:'' }}</span>
<span
:style="{
'font-size': customize.secondSize + 'px',
@ -44,7 +44,8 @@
color:customize.secondColor,
'font-weight':customize.secondWeight,
}"
class="content-right-second">
class="content-right-second"
>
{{ customize.secondLine }}
</span>
</div>
@ -63,7 +64,7 @@ export default {
default: () => ({})
}
},
data() {
data () {
return {
customClass: {}
}
@ -94,6 +95,7 @@ export default {
}
},
methods: {
customStyle () {}
}
}
</script>

Loading…
Cancel
Save