From 1af4450dc37206b82f8aef3234d8ab6395cf457f Mon Sep 17 00:00:00 2001 From: wisonic Date: Tue, 20 Jan 2026 19:14:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E9=A3=8E=E6=A0=BC=E6=98=BE=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor-style/components/BasicStyleSelector.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue index 4bc9d1f740..0ec14dd830 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/BasicStyleSelector.vue @@ -25,6 +25,7 @@ import { tdtMapStyleOptions } from '@/views/chart/components/js/panel/charts/map/common' import { useEmitt } from '@/hooks/web/useEmitt' +import { find } from 'lodash-es' const dvMainStore = dvMainStoreWithOut() const localeStore = useLocaleStoreWithOut() @@ -122,6 +123,10 @@ const init = () => { file && (state.fileList[0] = { url: file }) } state.basicStyleForm = defaultsDeep(basicStyle, cloneDeep(DEFAULT_BASIC_STYLE)) as ChartBasicStyle + const mapStyle = basicStyle.mapStyle + if (mapStyle && !find(mapStyleOptions.value, s => s.value === mapStyle)) { + state.basicStyleForm.mapStyle = 'normal' + } state.miscForm = defaultsDeep(miscStyle, cloneDeep(DEFAULT_MISC)) as ChartMiscAttr if (!state.customColor) { state.customColor = state.basicStyleForm.colors[0] @@ -352,13 +357,13 @@ const validateInput = (value, field) => { } state.basicStyleForm[field] = num } -onMounted(() => { - init() - getMapKey().then(res => { +onMounted(async () => { + await getMapKey().then(res => { if (res) { mapType.value = res.mapType } }) + init() useEmitt({ name: 'chart-type-change', callback: () => {