Merge pull request #11782 from dataease/pr@dev-v2@chart-symbolic-fix

fix(图表-符号地图): 修复切换图表时,前端报错的问题,以及自定义提示无法换行的问题
This commit is contained in:
jianneng-fit2cloud 2024-08-27 14:27:17 +08:00 committed by GitHub
commit e9886b8b2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 14 deletions

View File

@ -193,7 +193,8 @@ watch(
const state = reactive({
tooltipForm: {
tooltipFormatter: DEFAULT_TOOLTIP.tooltipFormatter
tooltipFormatter: DEFAULT_TOOLTIP.tooltipFormatter,
carousel: DEFAULT_TOOLTIP.carousel
} as DeepPartial<ChartTooltipAttr>
})

View File

@ -6,7 +6,7 @@ import {
L7Wrapper
} from '@/views/chart/components/js/panel/types/impl/l7'
import { MAP_EDITOR_PROPERTY_INNER } from '@/views/chart/components/js/panel/charts/map/common'
import { flow, hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
import { hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
import { deepCopy } from '@/utils/utils'
import { GaodeMap } from '@antv/l7-maps'
import { Scene } from '@antv/l7-scene'
@ -310,8 +310,4 @@ export class FlowMap extends L7ChartView<Scene, L7Config> {
chart.customAttr.misc.flowMapConfig.lineConfig.mapLineAnimate = true
return chart
}
protected setupOptions(chart: Chart, config: L7Config): L7Config {
return flow(this.configEmptyDataStrategy)(chart, config)
}
}

View File

@ -6,7 +6,7 @@ import {
L7Wrapper
} from '@/views/chart/components/js/panel/types/impl/l7'
import { MAP_EDITOR_PROPERTY_INNER } from '@/views/chart/components/js/panel/charts/map/common'
import { flow, hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
import { hexColorToRGBA, parseJson } from '@/views/chart/components/js/util'
import { deepCopy } from '@/utils/utils'
import { GaodeMap } from '@antv/l7-maps'
import { Scene } from '@antv/l7-scene'
@ -307,7 +307,7 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
* @returns {string}
*/
buildTooltipContent = (tooltip, fieldData, showFields) => {
let content = ''
let content = ``
if (tooltip.customContent) {
content = tooltip.customContent
showFields.forEach(field => {
@ -320,7 +320,7 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
}</span><br>`
})
}
return content
return content.replace(/\n/g, '<br>')
}
/**
@ -394,8 +394,4 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
}
return chart
}
protected setupOptions(chart: Chart, config: L7Config): L7Config {
return flow(this.configEmptyDataStrategy, this.configLabel)(chart, config)
}
}

View File

@ -553,7 +553,7 @@ export class CarouselManager {
}</span><br>`
})
}
return content
return content.replace(/\n/g, '<br>')
}
/**
* 合并详情到 map