fix: 缓存信息页面图表Echart语言数据设置

This commit is contained in:
TsMask
2024-03-07 10:17:46 +08:00
parent f5544c66bd
commit a69e8c89f8

View File

@@ -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