From f9589b3619d57b30964ecfebd996a4d5d4344107 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 1 Aug 2022 11:00:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE-=E5=9C=B0=E5=9B=BE):=20?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=9C=B0=E5=9B=BE=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/senior/MapMapping.vue | 54 +++++++++---------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/frontend/src/views/chart/components/senior/MapMapping.vue b/frontend/src/views/chart/components/senior/MapMapping.vue index 82290d59b7..3fb04c60c7 100644 --- a/frontend/src/views/chart/components/senior/MapMapping.vue +++ b/frontend/src/views/chart/components/senior/MapMapping.vue @@ -49,7 +49,7 @@ - +
{ 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() }, @@ -182,7 +180,7 @@ export default { }, buildGridList() { this.currentDatas = [] - if(!this.currentAreaCode || !this.mappingForm[this.currentAreaCode])return + if (!this.currentAreaCode || !this.mappingForm[this.currentAreaCode]) return this.gridList = Object.keys(this.mappingForm[this.currentAreaCode]).map(key => { return { mapArea: key, @@ -204,13 +202,13 @@ export default { initMapping() { const innerCallBack = (json, cCode) => { const features = json.features - if(!this.mappingForm) { + if (!this.mappingForm) { this.mappingForm = {} } - if(!this.mappingForm[cCode]) { + if (!this.mappingForm[cCode]) { this.mappingForm[cCode] = {} } - + features.forEach(feature => { this.mappingForm[cCode][feature.properties.name || feature.properties.NAME] = null })