fix: 地图组件的颜色配置项优化

main
hong.yang 1 year ago
parent bb5ba79e4e
commit 097db38403

@ -422,7 +422,7 @@
@click="addColor" @click="addColor"
/> />
<span <span
v-if="colors.length" v-if="colors.length > 2"
class="el-icon-remove-outline" class="el-icon-remove-outline"
style="color: #ea0b30; font-size: 20px" style="color: #ea0b30; font-size: 20px"
@click="delColor" @click="delColor"
@ -456,6 +456,7 @@ export default {
props: {}, props: {},
data () { data () {
return { return {
colors: [],
mapList: [], mapList: [],
predefineThemeColors: predefineColors, predefineThemeColors: predefineColors,
mapTree: [], mapTree: [],
@ -504,6 +505,7 @@ export default {
watch: {}, watch: {},
mounted () { mounted () {
this.getMapTree() this.getMapTree()
this.colors = this.config.customize.rangeColor
}, },
methods: { methods: {
getMapTree() { getMapTree() {
@ -526,11 +528,12 @@ export default {
this.getMapTree() this.getMapTree()
}, },
delColor () { delColor () {
this.colors = [] if (this.colors.length <= 2) return
this.config.customize.rangeColor = [] this.colors.pop()
this.config.customize.rangeColor.pop()
}, },
addColor () { addColor () {
this.colors.push('') this.colors.push('#fff')
}, },
updateColorScheme (colors) { updateColorScheme (colors) {
this.colors = [...colors] this.colors = [...colors]

Loading…
Cancel
Save