fix(地图): 多地图场景清除联动后指标选项恢复到第一个指标

This commit is contained in:
fit2cloud-chenyw 2022-11-30 10:29:48 +08:00
parent 4d6842ed4b
commit 6ccaf22ee5
4 changed files with 33 additions and 7 deletions

View File

@ -13,6 +13,7 @@
:canvas-id="canvasId" :canvas-id="canvasId"
:chart="chart" :chart="chart"
:show-position="showPosition" :show-position="showPosition"
:series-id-map="seriesIdMap"
@showViewDetails="showViewDetails" @showViewDetails="showViewDetails"
/> />
<div <div
@ -149,7 +150,10 @@ export default {
data() { data() {
return { return {
previewVisible: false, previewVisible: false,
chart: null chart: null,
seriesIdMap: {
id: ''
}
} }
}, },
computed: { computed: {

View File

@ -144,6 +144,7 @@
<map-layer-controller <map-layer-controller
v-if="chart && showMapLayerController" v-if="chart && showMapLayerController"
:chart="chart" :chart="chart"
:series-id-map="seriesIdMap"
/> />
</div> </div>
@ -239,6 +240,14 @@ export default {
chart: { chart: {
type: Object, type: Object,
default: null default: null
},
seriesIdMap: {
type: Object,
default: () => {
return {
id: ''
}
}
} }
}, },
data() { data() {

View File

@ -40,6 +40,7 @@
:canvas-id="canvasId" :canvas-id="canvasId"
:element="element" :element="element"
:chart="chart" :chart="chart"
:series-id-map="seriesIdMap"
@showViewDetails="showViewDetails" @showViewDetails="showViewDetails"
@amRemoveItem="amRemoveItem" @amRemoveItem="amRemoveItem"
@amAddItem="amAddItem" @amAddItem="amAddItem"
@ -431,7 +432,10 @@ export default {
// snapshot // snapshot
hasMove: false, hasMove: false,
// //
latestMoveY: 0 latestMoveY: 0,
seriesIdMap: {
id: ''
}
} }
}, },
computed: { computed: {

View File

@ -42,6 +42,14 @@ export default {
chart: { chart: {
type: Object, type: Object,
required: true required: true
},
seriesIdMap: {
type: Object,
default: () => {
return {
id: ''
}
}
} }
}, },
data() { data() {
@ -79,11 +87,12 @@ export default {
id: this.chart.id, id: this.chart.id,
seriesId: this.currentSeriesId seriesId: this.currentSeriesId
} }
this.seriesIdMap.id = this.currentSeriesId
bus.$emit('change-series-id', param) bus.$emit('change-series-id', param)
}, },
init() { init() {
this.currentSeriesId = this.customAttr.currentSeriesId this.currentSeriesId = this.seriesIdMap?.id || this.customAttr.currentSeriesId
} }
} }
} }