fix(视图-地图): 格式化地图区域映射代码
This commit is contained in:
parent
b9fccb5178
commit
f9589b3619
@ -49,7 +49,7 @@
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-empty slot="empty" :description="!!currentAreaCode ? $t('map_mapping.empty'): $t('map_mapping.please_select_map')"></el-empty>
|
||||
<el-empty slot="empty" :description="!!currentAreaCode ? $t('map_mapping.empty'): $t('map_mapping.please_select_map')" />
|
||||
</el-table>
|
||||
<div class="mapping-pagination">
|
||||
<el-pagination
|
||||
@ -95,6 +95,26 @@ export default {
|
||||
usePage: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
chartId() {
|
||||
return this.chart.id
|
||||
},
|
||||
currentAreaCode() {
|
||||
if (this.dynamicAreaCode) {
|
||||
return this.dynamicAreaCode
|
||||
}
|
||||
const customAttr = this.chart.customAttr
|
||||
if (!customAttr) return ''
|
||||
let attr = null
|
||||
if ((typeof customAttr) === 'string') {
|
||||
attr = JSON.parse(customAttr)
|
||||
} else {
|
||||
attr = JSON.parse(JSON.stringify(customAttr))
|
||||
}
|
||||
return attr.areaCode
|
||||
}
|
||||
|
||||
},
|
||||
watch: {
|
||||
'chart': {
|
||||
handler: function() {
|
||||
@ -112,32 +132,10 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.initData()
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
chartId() {
|
||||
return this.chart.id
|
||||
},
|
||||
currentAreaCode() {
|
||||
|
||||
if(this.dynamicAreaCode) {
|
||||
return this.dynamicAreaCode
|
||||
}
|
||||
const customAttr = this.chart.customAttr
|
||||
if(!customAttr) return ''
|
||||
let attr = null
|
||||
if((typeof customAttr) === 'string' ) {
|
||||
attr = JSON.parse(customAttr)
|
||||
} else {
|
||||
attr = JSON.parse(JSON.stringify(customAttr))
|
||||
}
|
||||
return attr.areaCode
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.initData()
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user