From cbeca8fbf188a057bd2ca3f2bcc18134455e57fb Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 8 May 2026 16:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=96=E7=95=8C=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将地图配置从 geo + geoIndex 改为直接在 series 中使用 map: 'world' - nameMap 放在 series 中,避免 geo.nameMap 导致的名称匹配失败 - 工具提示中动态翻译国家名称显示中文 --- frontend/src/pages/admin/index.vue | 59 +++++++++++++++--------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/frontend/src/pages/admin/index.vue b/frontend/src/pages/admin/index.vue index 08b01ee..51964f2 100644 --- a/frontend/src/pages/admin/index.vue +++ b/frontend/src/pages/admin/index.vue @@ -558,8 +558,9 @@ function updateMapOption() { }, formatter: (params: any) => { if (params.data && params.data.count > 0) { + const displayName = worldNameMap[params.name] || params.name return `
-
${params.name}
+
${displayName}
${t('admin.online')}: ${params.data.online} @@ -574,44 +575,42 @@ function updateMapOption() {
` } + const displayName = worldNameMap[params.name] || params.name return `
-
${params.name}
+
${displayName}
${t('admin.noUserData')}
` }, }, - geo: { - map: 'world', - roam: true, - zoom: 1.2, - nameMap: worldNameMap, - label: { - show: false, - }, - emphasis: { - label: { - show: true, - color: dark ? '#f8fafc' : '#0f172a', - fontSize: 11, - fontWeight: 600, - }, - itemStyle: { - areaColor: dark ? '#334155' : '#f1f5f9', - borderColor: dark ? '#475569' : '#94a3b8', - borderWidth: 1, - }, - }, - itemStyle: { - areaColor: dark ? '#1e293b' : '#e2e8f0', - borderColor: dark ? '#334155' : '#cbd5e1', - borderWidth: 0.5, - }, - }, series: [ { name: t('admin.userDistribution'), type: 'map', - geoIndex: 0, + map: 'world', + roam: true, + zoom: 1.2, + nameMap: worldNameMap, + label: { + show: false, + }, + emphasis: { + label: { + show: true, + color: dark ? '#f8fafc' : '#0f172a', + fontSize: 11, + fontWeight: 600, + }, + itemStyle: { + areaColor: dark ? '#334155' : '#f1f5f9', + borderColor: dark ? '#475569' : '#94a3b8', + borderWidth: 1, + }, + }, + itemStyle: { + areaColor: dark ? '#1e293b' : '#e2e8f0', + borderColor: dark ? '#334155' : '#cbd5e1', + borderWidth: 0.5, + }, data: seriesData, }, ],