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"
:chart="chart"
:show-position="showPosition"
:series-id-map="seriesIdMap"
@showViewDetails="showViewDetails"
/>
<div
@ -149,7 +150,10 @@ export default {
data() {
return {
previewVisible: false,
chart: null
chart: null,
seriesIdMap: {
id: ''
}
}
},
computed: {
@ -274,7 +278,7 @@ export default {
} else {
return {
...
getStyle(style, ['top', 'left', 'width', 'height', 'rotate']),
getStyle(style, ['top', 'left', 'width', 'height', 'rotate']),
position: 'relative'
}
}

View File

@ -137,13 +137,14 @@
:target="curComponent.hyperlinks.openMode "
:href="curComponent.hyperlinks.content "
>
<i class="icon iconfont icon-com-jump"/>
<i class="icon iconfont icon-com-jump" />
</a>
</span>
<map-layer-controller
v-if="chart && showMapLayerController"
:chart="chart"
:series-id-map="seriesIdMap"
/>
</div>
@ -239,6 +240,14 @@ export default {
chart: {
type: Object,
default: null
},
seriesIdMap: {
type: Object,
default: () => {
return {
id: ''
}
}
}
},
data() {

View File

@ -40,6 +40,7 @@
:canvas-id="canvasId"
:element="element"
:chart="chart"
:series-id-map="seriesIdMap"
@showViewDetails="showViewDetails"
@amRemoveItem="amRemoveItem"
@amAddItem="amAddItem"
@ -65,7 +66,7 @@
@mousedown.stop.prevent="handleDown(handlei, $event)"
@touchstart.stop.prevent="handleTouchDown(handlei, $event)"
>
<slot :name="handlei"/>
<slot :name="handlei" />
</div>
<div
:id="componentCanvasId"
@ -78,7 +79,7 @@
class="svg-background"
:icon-class="mainSlotSvgInner"
/>
<slot/>
<slot />
</div>
</div>
</div>
@ -431,7 +432,10 @@ export default {
// snapshot
hasMove: false,
//
latestMoveY: 0
latestMoveY: 0,
seriesIdMap: {
id: ''
}
}
},
computed: {

View File

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