Merge pull request #12574 from dataease/pr@dev-v2@chart-show-thumbnail-fix

fix(图表): 修复从其他图表切换到地图或者气泡地图时,缺少地区的选择时,无法显示缩略图的问题
This commit is contained in:
jianneng-fit2cloud 2024-10-08 18:09:22 +08:00 committed by GitHub
commit 8235e06ef2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,7 +27,7 @@ import {
watch
} from 'vue'
import { useEmitt } from '@/hooks/web/useEmitt'
import { hexColorToRGBA } from '@/views/chart/components/js/util.js'
import { hexColorToRGBA, parseJson } from '@/views/chart/components/js/util.js'
import {
CHART_FONT_FAMILY_MAP,
DEFAULT_TITLE_STYLE
@ -578,6 +578,11 @@ const checkFieldIsAllowEmpty = (allField?) => {
showEmpty.value = false
if (view.value?.render && view.value?.type) {
const chartView = chartViewManager.getChartView(view.value.render, view.value.type)
const map = parseJson(view.value.customAttr).map
if (['bubble-map', 'map'].includes(view.value?.type) && !map?.id) {
showEmpty.value = true
return
}
const axisConfigMap = new Map(Object.entries(chartView.axisConfig))
//
let includeDatasetField = false