From 7397d4d4555f4942ea19a8af49401a88b655f918 Mon Sep 17 00:00:00 2001 From: TC Date: Mon, 15 May 2023 19:31:30 +0800 Subject: [PATCH] Fix the issue of not displaying all selected and reverse selected in zh-CN Signed-off-by: TC --- sysom_web/src/pages/host/List/index.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sysom_web/src/pages/host/List/index.jsx b/sysom_web/src/pages/host/List/index.jsx index 6dac2b75..4fe6da0b 100644 --- a/sysom_web/src/pages/host/List/index.jsx +++ b/sysom_web/src/pages/host/List/index.jsx @@ -1,7 +1,7 @@ import { PlusOutlined } from '@ant-design/icons'; import { Button, message, Popconfirm, Table, Space, notification, Select } from 'antd'; import { useState, useRef, useEffect } from 'react'; -import { useIntl, FormattedMessage } from 'umi'; +import { useIntl, FormattedMessage, getLocale } from 'umi'; import { PageContainer } from '@ant-design/pro-layout'; import ProTable from '@ant-design/pro-table'; import ExportJsonExcel from 'js-export-excel'; @@ -15,6 +15,13 @@ import HostModalForm from '../components/HostModalForm'; const { Option } = Select; +// 全选、反选在中文模式显示不出来问题修复 +let tableLocale = {} +const locale = getLocale(); +if (!locale || locale === 'zh-CN') { + tableLocale = {selectionAll:'全选所有',selectInvert:'反选当页'} +} + const HostField = { cluster: '所属集群', created_at: '创建时间', @@ -419,6 +426,7 @@ const HostList = () => { id: 'pages.hostTable.title', defaultMessage: 'Host admin', })} + locale={tableLocale} actionRef={actionRef} rowKey="id" search={{ -- Gitee