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: {
@ -274,7 +278,7 @@ export default {
} else { } else {
return { return {
... ...
getStyle(style, ['top', 'left', 'width', 'height', 'rotate']), getStyle(style, ['top', 'left', 'width', 'height', 'rotate']),
position: 'relative' position: 'relative'
} }
} }

View File

@ -137,13 +137,14 @@
:target="curComponent.hyperlinks.openMode " :target="curComponent.hyperlinks.openMode "
:href="curComponent.hyperlinks.content " :href="curComponent.hyperlinks.content "
> >
<i class="icon iconfont icon-com-jump"/> <i class="icon iconfont icon-com-jump" />
</a> </a>
</span> </span>
<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"
@ -65,7 +66,7 @@
@mousedown.stop.prevent="handleDown(handlei, $event)" @mousedown.stop.prevent="handleDown(handlei, $event)"
@touchstart.stop.prevent="handleTouchDown(handlei, $event)" @touchstart.stop.prevent="handleTouchDown(handlei, $event)"
> >
<slot :name="handlei"/> <slot :name="handlei" />
</div> </div>
<div <div
:id="componentCanvasId" :id="componentCanvasId"
@ -78,7 +79,7 @@
class="svg-background" class="svg-background"
:icon-class="mainSlotSvgInner" :icon-class="mainSlotSvgInner"
/> />
<slot/> <slot />
</div> </div>
</div> </div>
</div> </div>
@ -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
} }
} }
} }