From f8b590e4c573dc5c9351b643be658deb784908ba Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Tue, 8 Oct 2024 18:08:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BB=8E=E5=85=B6=E4=BB=96=E5=9B=BE=E8=A1=A8=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=88=B0=E5=9C=B0=E5=9B=BE=E6=88=96=E8=80=85=E6=B0=94=E6=B3=A1?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E6=97=B6=EF=BC=8C=E7=BC=BA=E5=B0=91=E5=9C=B0?= =?UTF-8?q?=E5=8C=BA=E7=9A=84=E9=80=89=E6=8B=A9=E6=97=B6=EF=BC=8C=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=98=BE=E7=A4=BA=E7=BC=A9=E7=95=A5=E5=9B=BE=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/chart/components/views/index.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/views/chart/components/views/index.vue b/core/core-frontend/src/views/chart/components/views/index.vue index dc59e7f983..a43c0f547f 100644 --- a/core/core-frontend/src/views/chart/components/views/index.vue +++ b/core/core-frontend/src/views/chart/components/views/index.vue @@ -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