From 49fef6c91f214633db6745ce01279ec6af1af8a0 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 8 May 2026 19:45:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E7=9A=84?= =?UTF-8?q?=20watch=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=9C=B0=E5=9B=BE=E4=B8=AD?= =?UTF-8?q?=E8=8B=B1=E6=96=87=E5=88=87=E6=8D=A2=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/admin/index.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/admin/index.vue b/frontend/src/pages/admin/index.vue index aaa401d..fd8efa8 100644 --- a/frontend/src/pages/admin/index.vue +++ b/frontend/src/pages/admin/index.vue @@ -8,7 +8,7 @@ import { useRouter } from 'vue-router' import { BasicPage } from '@/components/global-layout' import { BASE_URL } from '@/services/api' -const { t } = useI18n() +const { t, locale } = useI18n() const router = useRouter() const colorMode = useColorMode() const isDark = computed(() => colorMode.value === 'dark') @@ -522,6 +522,7 @@ function updateMapOption() { const maxCount = Math.max(...data.map((d: any) => d.count || 0), 1) const dark = isDark.value + const isZh = locale.value === 'zh' || locale.value.startsWith('zh') const seriesData = data.map((d: any) => { const ratio = d.count / maxCount @@ -537,7 +538,7 @@ function updateMapOption() { b = Math.round(253 + (235 - 253) * ratio) } return { - name: worldNameMap[d.name] || d.name, + name: isZh ? (worldNameMap[d.name] || d.name) : d.name, value: d.count, count: d.count, online: d.online || 0, @@ -591,7 +592,7 @@ function updateMapOption() { map: 'world', roam: true, zoom: 1.2, - nameMap: worldNameMap, + nameMap: isZh ? worldNameMap : undefined, label: { show: false, }, @@ -750,9 +751,9 @@ watch(isDark, () => { updateMapOption() }) -watch(provinces, () => { +watch(locale, () => { updateMapOption() -}, { deep: true }) +}) onUnmounted(() => { if (chartInstance) {