From a69e8c89f88b4044cb922ce6f345ffb109c0e428 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 7 Mar 2024 10:17:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BC=93=E5=AD=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=9B=BE=E8=A1=A8Echart=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/monitor/cache/info.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/monitor/cache/info.vue b/src/views/monitor/cache/info.vue index d51bd284..53dd779a 100644 --- a/src/views/monitor/cache/info.vue +++ b/src/views/monitor/cache/info.vue @@ -16,7 +16,7 @@ import { getCache } from '@/api/monitor/cache'; import { reactive, ref, onMounted } from 'vue'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import useI18n from '@/hooks/useI18n'; -const { t } = useI18n(); +const { t, currentLocale } = useI18n(); echarts.use([ ToolboxComponent, @@ -77,7 +77,11 @@ let cache: CacheType = reactive({ function commandStatsChart() { const commandStatsDom = document.getElementById('commandstats'); if (!commandStatsDom) return; - const commandStatsEchart = echarts.init(commandStatsDom); + const locale = currentLocale.value.split("_")[0] + const commandStatsEchart = echarts.init(commandStatsDom, 'light', { + // https://github.com/apache/echarts/tree/release/src/i18n 取值langEN.ts ==> EN + locale: locale.toUpperCase(), + }); const option: echarts.ComposeOption< | ToolboxComponentOption | TooltipComponentOption