Sfoglia il codice sorgente

完成页面的翻译

crush 4 anni fa
parent
commit
b119f8f136

+ 8 - 0
src/app.tsx

@@ -9,10 +9,12 @@ import { BookOutlined, LinkOutlined } from '@ant-design/icons';
 import Service from '@/pages/user/Login/service';
 import Token from '@/utils/token';
 import type { RequestOptionsInit } from 'umi-request';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const isDev = process.env.NODE_ENV === 'development';
 const loginPath = '/user/login';
 
+
 /** 获取用户信息比较慢的时候会展示一个 loading */
 export const initialStateConfig = {
   loading: <PageLoading />,
@@ -148,6 +150,12 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
           <Link to="/umi/plugin/openapi" target="_blank">
             <LinkOutlined />
             <span>OpenAPI 文档</span>
+          {/* <span>
+          { intl.formatMessage({
+                  id: 'pages.searchTable.new',
+                  defaultMessage: '新建',
+                 })}
+          </span> */}
           </Link>,
           <Link to="/~docs">
             <BookOutlined />

+ 1 - 1
src/locales/en-US/menu.ts

@@ -22,7 +22,7 @@ export default {
 
   'menu.log': 'Log',
   'menu.log.access': 'AccessLog',
-  'menu.log.System': 'SystemLog',
+  'menu.log.System': 'System Log',
   'menu.admin.sub-page': 'Sub-Page',
   'menu.login': 'Login',
   'menu.register': 'Register',

+ 100 - 11
src/locales/en-US/pages.ts

@@ -1,3 +1,5 @@
+import Firmware from '@/pages/device/Firmware';
+
 export default {
   'pages.layouts.userLayout.title': 'Jetlinks is an open source Internet of Things basic platform',
   'pages.login.accountLogin.tab': 'Account Login',
@@ -49,6 +51,9 @@ export default {
   'pages.searchTable.ruleName': 'Rule name is required',
   'pages.searchTable.titleCallNo': 'Number of Service Calls',
   'pages.searchTable.titleStatus': 'Status',
+  'pages.searchTable.titleStatus.all': 'All',
+  'pages.searchTable.titleStatus.normal': 'Normal',
+  'pages.searchTable.titleStatus.disable': 'Disable',
   'pages.searchTable.nameStatus.default': 'default',
   'pages.searchTable.nameStatus.running': 'running',
   'pages.searchTable.nameStatus.online': 'online',
@@ -64,7 +69,7 @@ export default {
   'pages.searchTable.item': 'item',
   'pages.searchTable.totalServiceCalls': 'Total Number of Service Calls',
   'pages.searchTable.tenThousand': '0000',
-  'pages.searchTable.batchDeletion': 'bacth deletion',
+  'pages.searchTable.batchDeletion': 'batch deletion',
   'pages.searchTable.batchApproval': 'batch approval',
 
   // 通用的数据操作
@@ -84,6 +89,11 @@ export default {
   'pages.data.option.detail': 'Detail',
   'pages.data.option.download': 'Download',
 
+  // 统计分析
+  'pages.analysis.cpu': 'CPU Usage',
+  'pages.analysis.jvm': 'JVM Memory',
+  'pages.analysis.information': 'Information Completeness',
+
   // 系统设置-用户管理
   'pages.system.user': 'User',
   'pages.system.user.name': 'name',
@@ -99,32 +109,111 @@ export default {
   'pages.system.role.describe': 'Describe',
   'pages.system.role.option.bindUser': 'Bind User',
 
-  // 权限管理
+  // 系统设置-权限管理
   'pages.system.permission': 'Permission',
   'pages.system.permission.id': 'ID',
   'pages.system.permission.name': 'Name',
+  'pages.system.permission.name.tip': 'If the name is too long, it will automatically shrink',
   'pages.system.permission.status': 'Status',
+  'pages.system.permission.add': 'Add Entry',
+  'pages.system.permission.basicInformation': 'Basic Information',
+  'pages.system.permission.operationConfiguration': 'Operation Configuration',
+  'pages.system.permission.operationConfiguration.type': 'Operation Type',
+  'pages.system.permission.operationConfiguration.name': 'Name',
+  'pages.system.permission.operationConfiguration.describe': 'Describe',
+  'pages.system.permission.associatedPermissions': 'Associated Permissions',
+  'pages.system.permission.associatedPermissions.preOperation': 'Pre Operation',
+  'pages.system.permission.associatedPermissions.associatedPermissions': 'Associated Permissions',
+  'pages.system.permission.associatedPermissions.associatedOperation': 'Associated Operation',
+  'pages.system.permission.dataView': 'Data View',
 
-  // 机构管理
+  // 系统设置-机构管理
   'pages.system.org': 'Organization',
   'pages.system.org.code': 'Code',
   'pages.system.org.count': 'Count',
 
-  // 第三方平台
+  // 系统设置-第三方平台
   'pages.system.open-api': 'OpenAPI',
+  'pages.system.open-api.Name': 'Name',
+  'pages.system.open-api.userName': 'UserName',
+  'pages.system.open-api.passWord': 'passWord',
+  'pages.system.open-api.ipWhileList': 'ipWhileList',
+  'pages.system.open-api.describe': 'Describe',
 
-  // 租户管理
+  // 系统设置-租户管理
   'pages.system.tenant': 'Tenant',
+  'pages.system.tenant.list': 'Tenant List',
+  'pages.system.tenant.avatar': 'Avatar',
+  'pages.system.tenant.name': 'Name',
+  'pages.system.tenant.members': 'Members',
 
-  // 日志管理
-  'pages.log.access': 'AccessLog',
-  'pages.log.System': 'SystemLog',
-
-  // 设备管理
+  // 设备管理-产品
   'pages.device.product': 'Product',
+  'pages.device.product.list': 'Product List',
+  'pages.device.product.name': 'Name',
+  'pages.device.product.status': 'Status',
+  'pages.device.product.status.published': 'Published',
+  'pages.device.product.status.unpublished': 'Unpublished',
+  'pages.device.product.status.all': 'All',
   'pages.device.product-detail': 'ProductDetail',
-  'pages.device.instance': 'Instance',
+
+  // 设备管理-设备
+  'pages.device.instance': 'Equipment',
+  'pages.device.instance.management': 'Equipment Management',
+  'pages.device.instance.equipmentName': 'Equipment Name',
+  'pages.device.instance.productName': 'Product Name',
+  'pages.device.instance.registrationTime': 'Registration Time',
+  'pages.device.instance.status': 'Status',
+  'pages.device.instance.status.notEnabled': 'Not Enabled',
+  'pages.device.instance.status.offLine': 'Off-Line',
+  'pages.device.instance.status.onLine': 'On-Line',
+  'pages.device.instance.explain': 'Explain',
+
+  // 设备管理-指令下发
   'pages.device.command': 'Command',
+  'pages.device.command.deviceID': 'Device ID',
+  'pages.device.command.equipmentName': 'Equipment Name',
+  'pages.device.command.instructionType': 'Instruction Type',
+  'pages.device.command.instructionType.readAttributes': 'Read Attributes',
+  'pages.device.command.instructionType.setProperties': 'Set Properties',
+  'pages.device.command.instructionType.callAttribute': 'Call Attribute',
+  'pages.device.command.status': 'Status',
+  'pages.device.command.status.waiting': 'Waiting',
+  'pages.device.command.status.failed ': 'Failed to send',
+  'pages.device.command.status.succeed': 'Sent successfully',
+  'pages.device.command.errorMessage': 'Error Message',
+  'pages.device.command.sendTime': 'Send Time',
+
+  // 设备管理-固件升级
   'pages.device.firmware': 'Firmware',
+  'pages.device.firmware.name': 'Firmware Name',
+  'pages.device.firmware.version': 'Firmware version',
+  'pages.device.firmware.products': 'Products',
+  'pages.device.firmware.signature': 'Signature Method',
+  'pages.device.firmware.creationTime': 'Creation Time',
+
+  // 设备管理-告警记录
   'pages.device.alarm': 'Alarm',
+  'pages.device.alarm.deviceID': 'Device ID',
+  'pages.device.alarm.equipmentName': 'Equipment Name',
+  'pages.device.alarm.alarmName': 'Alarm Name',
+  'pages.device.alarm.alarmTime': 'Alarm Time',
+  'pages.device.alarm.status': 'Processing Status',
+
+  // 日志管理-访问日志
+  'pages.log.access': 'Access Log',
+  'pages.log.access.requestPath': 'Request Path',
+  'pages.log.access.explain': 'Explain',
+  'pages.log.access.requestTime': 'Request Time',
+  'pages.log.access.requestTimeConsuming': 'Request Time Consuming',
+  'pages.log.access.requestUser': 'Request User',
+
+  // 日志管理-系统日志
+  'pages.log.system': 'System Log',
+  'pages.log.system.thread': 'Thread',
+  'pages.log.system.name': 'Name',
+  'pages.log.system.level': 'Level',
+  'pages.log.system.logContent': 'Log Content',
+  'pages.log.system.serviceName': 'Service Name',
+  'pages.log.system.creationTime': 'Creation Time',
 };

+ 96 - 9
src/locales/zh-CN/pages.ts

@@ -47,6 +47,9 @@ export default {
   'pages.searchTable.ruleName': '规则名称为必填项',
   'pages.searchTable.titleCallNo': '服务调用次数',
   'pages.searchTable.titleStatus': '状态',
+  'pages.searchTable.titleStatus.all': '全部',
+  'pages.searchTable.titleStatus.normal': '正常',
+  'pages.searchTable.titleStatus.disable': '禁用',
   'pages.searchTable.nameStatus.default': '关闭',
   'pages.searchTable.nameStatus.running': '运行中',
   'pages.searchTable.nameStatus.online': '已上线',
@@ -82,6 +85,11 @@ export default {
   'pages.data.option.detail': '详情',
   'pages.data.option.download': '下载',
 
+  // 统计分析
+  'pages.analysis.cpu': 'CPU使用率',
+  'pages.analysis.jvm': 'JVM内存',
+  'pages.analysis.information': '信息完成度',
+
   // 系统设置-用户管理
   'pages.system.user': '用户管理',
   'pages.system.user.name': '姓名',
@@ -97,32 +105,111 @@ export default {
   'pages.system.role.describe': '描述',
   'pages.system.role.option.bindUser': '绑定用户',
 
-  // 权限管理
+  // 系统设置-权限管理
   'pages.system.permission': '权限管理',
   'pages.system.permission.id': '标识',
   'pages.system.permission.name': '名称',
+  'pages.system.permission.name.tip': '名称过长会自动收缩',
   'pages.system.permission.status': '状态',
+  'pages.system.permission.add': '添加条目',
+  'pages.system.permission.basicInformation': '基础信息',
+  'pages.system.permission.operationConfiguration': '操作配置',
+  'pages.system.permission.operationConfiguration.type': '操作类型',
+  'pages.system.permission.operationConfiguration.name': '名称',
+  'pages.system.permission.operationConfiguration.describe': '描述',
+  'pages.system.permission.associatedPermissions': '关联权限',
+  'pages.system.permission.associatedPermissions.preOperation': '前置操作',
+  'pages.system.permission.associatedPermissions.associatedPermissions': '关联权限',
+  'pages.system.permission.associatedPermissions.associatedOperation': '关联操作',
+  'pages.system.permission.dataView': '数据视图',
 
-  // 机构管理
+  // 系统设置-机构管理
   'pages.system.org': '机构管理',
   'pages.system.org.code': '编码',
   'pages.system.org.count': '下级数量',
 
-  // 第三方平台
+  // 系统设置-第三方平台
   'pages.system.open-api': '第三方平台',
+  'pages.system.open-api.clientName': '名称',
+  'pages.system.open-api.userName': '用户名',
+  'pages.system.open-api.passWord': '密码',
+  'pages.system.open-api.ipWhileList': 'IP白名单',
+  'pages.system.open-api.describe': '描述',
 
-  // 租户管理
+  // 系统设置-租户管理
   'pages.system.tenant': '租户管理',
+  'pages.system.tenant.list': '租户列表',
+  'pages.system.tenant.avatar': '头像',
+  'pages.system.tenant.name': '名称',
+  'pages.system.tenant.members': '成员数',
 
-  // 系统日志
-  'pages.log.access': '访问日志',
-  'pages.log.system': '系统日志',
-
-  // 设备管理
+  // 设备管理-产品
   'pages.device.product': '产品',
+  'pages.device.product.list': '产品列表',
+  'pages.device.product.name': '名称',
+  'pages.device.product.status': '状态',
+  'pages.device.product.status.published': '已发布',
+  'pages.device.product.status.unpublished': '未发布',
+  'pages.device.product.status.all': '全部',
   'pages.device.product-detail': '产品详情',
+
+  // 设备管理-设备
   'pages.device.instance': '设备',
+  'pages.device.instance.management': '设备管理',
+  'pages.device.instance.equipmentName': '设备名称',
+  'pages.device.instance.productName': '产品名称',
+  'pages.device.instance.registrationTime': '注册时间',
+  'pages.device.instance.status': '状态',
+  'pages.device.instance.status.notEnabled': '未启用',
+  'pages.device.instance.status.offLine': '离线',
+  'pages.device.instance.status.onLine': '在线',
+  'pages.device.instance.explain': '说明',
+
+  // 设备管理-指令下发
   'pages.device.command': '指令下发',
+  'pages.device.command.deviceID': '设备ID',
+  'pages.device.command.equipmentName': '设备名称',
+  'pages.device.command.instructionType': '指令类型',
+  'pages.device.command.instructionType.readAttributes': '读取属性',
+  'pages.device.command.instructionType.setProperties': '设置属性',
+  'pages.device.command.instructionType.callAttribute': '调用属性',
+  'pages.device.command.status': '状态',
+  'pages.device.command.status.waiting': '等待中',
+  'pages.device.command.status.failed ': '发送失败',
+  'pages.device.command.status.succeed': '发送成功',
+  'pages.device.command.errorMessage': '错误信息',
+  'pages.device.command.sendTime': '发送时间',
+
+  // 设备管理-固件升级
   'pages.device.firmware': '固件升级',
+  'pages.device.firmware.name': '固件名称',
+  'pages.device.firmware.versions': '固件版本',
+  'pages.device.firmware.products': '所属产品',
+  'pages.device.firmware.signature': '签名方式',
+  'pages.device.firmware.creationTime': '创建时间',
+
+  // 设备管理-告警记录
   'pages.device.alarm': '告警记录',
+  'pages.device.alarm.deviceID': '设备ID',
+  'pages.device.alarm.equipmentName': '设备名称',
+  'pages.device.alarm.alarmName': '告警名称',
+  'pages.device.alarm.alarmTime': '告警时间',
+  'pages.device.alarm.status': '处理状态',
+
+  // 日志管理-访问日志
+  'pages.log.access': '访问日志',
+  'pages.log.access.requestPath': '请求路径',
+  'pages.log.access.explain': '说明',
+  'pages.log.access.requestTime': '请求时间',
+  'pages.log.access.requestTimeConsuming': '请求耗时',
+  'pages.log.access.requestUser': '请求用户',
+
+  // 日志管理-系统日志
+  'pages.log.system': '系统日志',
+  'pages.log.system.thread': '线程',
+  'pages.log.system.name': '名称',
+  'pages.log.system.level': '级别',
+  'pages.log.system.logContent': '日志内容',
+  'pages.log.system.serviceName': '服务名',
+  'pages.log.system.creationTime': '创建时间',
 };

+ 14 - 3
src/pages/Analysis/index.tsx

@@ -2,6 +2,7 @@ import { PageContainer } from '@ant-design/pro-layout';
 import { StatisticCard } from '@ant-design/pro-card';
 import RcResizeObserver from 'rc-resize-observer';
 import { useState } from 'react';
+import { useIntl } from '@@/plugin-locale/localeExports';
 import CPU from '@/pages/Analysis/CPU';
 import Jvm from '@/pages/Analysis/Jvm';
 
@@ -9,6 +10,7 @@ const { Divider } = StatisticCard;
 
 const Analysis = () => {
   const [responsive, setResponsive] = useState(false);
+  const intl = useIntl();
 
   return (
     <PageContainer>
@@ -21,21 +23,30 @@ const Analysis = () => {
         <StatisticCard.Group direction={responsive ? 'column' : 'row'}>
           <StatisticCard
             statistic={{
-              title: 'CPU使用率',
+              title:intl.formatMessage({
+                id:'pages.analysis.cpu',
+                defaultMessage:'CPU使用率',
+              }),
             }}
             chart={<CPU />}
           />
           <Divider type={responsive ? 'horizontal' : 'vertical'} />
           <StatisticCard
             statistic={{
-              title: 'JVM内存',
+              title:intl.formatMessage({
+                id:'pages.analysis.jvm',
+                defaultMessage:'JVM内存',
+              }),
             }}
             chart={<Jvm />}
           />
           <Divider type={responsive ? 'horizontal' : 'vertical'} />
           <StatisticCard
             statistic={{
-              title: '信息完成度',
+              title:intl.formatMessage({
+                id:'pages.analysis.information',
+                defaultMessage:'信息完成度',
+              }),
               value: 5,
               suffix: '/ 100',
             }}

+ 24 - 6
src/pages/device/Alarm/index.tsx

@@ -15,19 +15,31 @@ const Alarm = () => {
 
   const columns: ProColumns<AlarmItem>[] = [
     {
-      title: '设备ID',
+      title: intl.formatMessage({
+        id: 'pages.device.alarm.deviceID',
+        defaultMessage: '设备ID',
+      }),
       dataIndex: 'deviceId',
     },
     {
-      title: '设备名称',
+      title: intl.formatMessage({
+        id: 'pages.device.alarm.equipmentName',
+        defaultMessage: '设备名称',
+      }),
       dataIndex: 'deviceName',
     },
     {
-      title: '告警名称',
+      title: intl.formatMessage({
+        id: 'pages.device.alarm.alarmName',
+        defaultMessage: '告警名称',
+      }),
       dataIndex: 'alarmName',
     },
     {
-      title: '告警时间',
+      title: intl.formatMessage({
+        id: 'pages.device.alarm.alarmTime',
+        defaultMessage: '告警时间',
+      }),
       dataIndex: 'alarmTime',
       width: '300px',
       render: (text: any) => (text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '/'),
@@ -35,7 +47,10 @@ const Alarm = () => {
       defaultSortOrder: 'descend',
     },
     {
-      title: '处理状态',
+      title: intl.formatMessage({
+        id: 'pages.device.alarm.status',
+        defaultMessage: '处理状态',
+      }),
       dataIndex: 'state',
       align: 'center',
       width: '100px',
@@ -43,7 +58,10 @@ const Alarm = () => {
         text === 'solve' ? <Tag color="#87d068">已处理</Tag> : <Tag color="#f50">未处理</Tag>,
     },
     {
-      title: '操作',
+      title: intl.formatMessage({
+        id: 'pages.data.option',
+        defaultMessage: '操作',
+      }),
       width: '120px',
       align: 'center',
       valueType: 'option',

+ 67 - 13
src/pages/device/Command/index.tsx

@@ -16,38 +16,92 @@ const Command = () => {
 
   const columns: ProColumns<CommandItem>[] = [
     {
-      title: '设备ID',
+      title:  intl.formatMessage({
+        id: 'pages.device.command.deviceID',
+        defaultMessage: '设备ID',
+      }),
       dataIndex: 'deviceId',
     },
     {
-      title: '设备名称',
+      title: intl.formatMessage({
+        id: 'pages.device.command.equipmentName',
+        defaultMessage: '设备名称',
+      }),
       dataIndex: 'deviceName',
     },
     {
-      title: '指令类型',
+      title: intl.formatMessage({
+        id: 'pages.device.command.instructionType',
+        defaultMessage: '指令类型',
+      }),
       dataIndex: 'messageType',
       filters: [
-        { text: '读取属性', value: 'READ_PROPERTY' },
-        { text: '设置属性', value: 'WRITE_PROPERTY' },
-        { text: '调用功能', value: 'INVOKE_FUNCTION' },
+        { 
+          text: intl.formatMessage({
+            id: 'pages.device.command.instructionType.readAttributes',
+            defaultMessage: '读取属性',
+          }),
+          value: 'READ_PROPERTY' 
+        },
+        { 
+          text: intl.formatMessage({
+            id: 'pages.device.command.instructionType.setProperties',
+            defaultMessage: '设置属性',
+          }),
+          value: 'WRITE_PROPERTY' 
+        },
+        { 
+          text: intl.formatMessage({
+            id: 'pages.device.command.instructionType.callAttribute',
+            defaultMessage: '调用属性',
+          }),
+          value: 'INVOKE_FUNCTION' 
+        },
       ],
     },
     {
-      title: '状态',
+      title: intl.formatMessage({
+        id: 'pages.device.command.status',
+        defaultMessage: '状态',
+      }),
       dataIndex: 'state',
       filters: [
-        { text: '等待中', value: 'wait' },
-        { text: '发送失败', value: 'sendError' },
-        { text: '发送成功', value: 'success' },
+        { 
+          text: intl.formatMessage({
+            id: 'pages.device.command.status.waiting',
+            defaultMessage: '等待中',
+          }),
+          value: 'wait' 
+        },
+        { 
+          text: intl.formatMessage({
+            id: 'pages.device.command.status.failed ',
+            defaultMessage: '发送失败',
+          }),
+          value: 'sendError' 
+        },
+        { 
+          text: intl.formatMessage({
+            id: 'pages.device.command.status.succeed',
+            defaultMessage: '发送成功',
+          }),
+          value: 'success' 
+        },
       ],
       render: (value: any) => value.text,
     },
     {
-      title: '错误信息',
+      title: intl.formatMessage({
+        id: 'pages.device.command.errorMessage',
+        defaultMessage: '错误信息',
+      }),
       dataIndex: 'lastError',
     },
     {
-      title: '发送时间',
+      title: intl.formatMessage({
+        id: 'pages.device.command.sendTime',
+        defaultMessage: '发送时间',
+      }),
       dataIndex: 'sendTimestamp',
       render: (text: any) => moment(text).format('YYYY-MM-DD HH:mm:ss'),
       sorter: true,
@@ -56,7 +110,7 @@ const Command = () => {
     {
       title: intl.formatMessage({
         id: 'pages.data.option',
-        defaultMessage: '操作',
+          defaultMessage: '操作',
       }),
       valueType: 'option',
       align: 'center',

+ 24 - 6
src/pages/device/Firmware/index.tsx

@@ -17,23 +17,38 @@ const Firmware = () => {
 
   const columns: ProColumns<FirmwareItem>[] = [
     {
-      title: '固件名称',
+      title:  intl.formatMessage({
+        id: 'pages.device.firmware.name',
+        defaultMessage: '固件名称',
+      }),
       dataIndex: 'name',
     },
     {
-      title: '固件版本',
+      title: intl.formatMessage({
+        id: 'pages.device.firmware.version',
+        defaultMessage: '固件版本',
+      }),
       dataIndex: 'version',
     },
     {
-      title: '所属产品',
+      title: intl.formatMessage({
+        id: 'pages.device.firmware.products',
+        defaultMessage: '所属产品',
+      }),
       dataIndex: 'productName',
     },
     {
-      title: '签名方式',
+      title: intl.formatMessage({
+        id: 'pages.device.firmware.signature',
+        defaultMessage: '签名方式',
+      }),
       dataIndex: 'signMethod',
     },
     {
-      title: '创建时间',
+      title: intl.formatMessage({
+        id: 'pages.device.firmware.creationTime',
+        defaultMessage: '创建时间',
+      }),
       dataIndex: 'createTime',
       width: '200px',
       align: 'center',
@@ -114,7 +129,10 @@ const Firmware = () => {
       <BaseCrud<FirmwareItem>
         columns={columns}
         service={service}
-        title={'固件升级'}
+        title={intl.formatMessage({
+          id: 'pages.device.firmware',
+          defaultMessage: '固件升级',
+        })}
         schema={schema}
         actionRef={actionRef}
       />

+ 36 - 9
src/pages/device/Instance/index.tsx

@@ -50,46 +50,70 @@ const Instance = () => {
       dataIndex: 'id',
     },
     {
-      title: '设备名称',
+      title: intl.formatMessage({
+        id:'pages.device.instance.equipmentName',
+        defaultMessage:'设备名称',
+      }),
       dataIndex: 'name',
       ellipsis: true,
     },
     {
-      title: '产品名称',
+      title: intl.formatMessage({
+        id:'pages.device.instance.productName',
+        defaultMessage:'产品名称',
+      }),
       dataIndex: 'productName',
       ellipsis: true,
     },
     {
-      title: '注册时间',
+      title: intl.formatMessage({
+        id:'pages.device.instance.registrationTime',
+        defaultMessage:'注册时间',
+      }),
       dataIndex: 'registryTime',
       width: '200px',
       render: (text: any) => (text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '/'),
       sorter: true,
     },
     {
-      title: '状态',
+      title: intl.formatMessage({
+        id:'pages.device.instance.status',
+        defaultMessage:'状态',
+      }),
       dataIndex: 'state',
       width: '90px',
       renderText: (record) =>
         record ? <Badge status={statusMap.get(record.value)} text={record.text} /> : '',
       filters: [
         {
-          text: '未启用',
+          text: intl.formatMessage({
+            id:'pages.device.instance.status.notEnabled',
+            defaultMessage:'未启用',
+          }),
           value: 'notActive',
         },
         {
-          text: '离线',
+          text: intl.formatMessage({
+            id:'pages.device.instance.status.offLine',
+            defaultMessage:'离线',
+          }),
           value: 'offline',
         },
         {
-          text: '在线',
+          text: intl.formatMessage({
+            id:'pages.device.instance.status.onLine',
+            defaultMessage:'在线',
+          }),
           value: 'online',
         },
       ],
       filterMultiple: false,
     },
     {
-      title: '说明',
+      title:intl.formatMessage({
+        id:'pages.device.instance.explain',
+        defaultMessage:'说明',
+      }),
       dataIndex: 'describe',
       width: '15%',
       ellipsis: true,
@@ -172,7 +196,10 @@ const Instance = () => {
       <BaseCrud
         columns={columns}
         service={service}
-        title={'设备管理'}
+        title={intl.formatMessage({
+          id: 'pages.device.instance.management',
+          defaultMessage: '设备管理',
+        })}
         schema={schema}
         actionRef={actionRef}
       />

+ 31 - 7
src/pages/device/Product/index.tsx

@@ -38,7 +38,10 @@ const Product = observer(() => {
           toolBarRender={() => {
             return [
               <Button key="3" type="primary">
-                新建
+                { intl.formatMessage({
+                  id: 'pages.searchTable.new',
+                  defaultMessage: '新建',
+                 })}
               </Button>,
             ];
           }}
@@ -46,7 +49,10 @@ const Product = observer(() => {
             filterType: 'light',
           }}
           rowKey={'id'}
-          headerTitle="产品列表"
+          headerTitle={intl.formatMessage({
+            id: 'pages.device.product.list',
+            defaultMessage: '产品列表',
+          })}
           request={async (params = {}) => {
             return await lastValueFrom(
               service.list(encodeQuery({ ...params, sorts: { id: 'ascend' } })),
@@ -63,7 +69,10 @@ const Product = observer(() => {
             },
             title: {
               dataIndex: 'name',
-              title: '名称',
+              title: intl.formatMessage({
+                id:'pages.device.product.name',
+                defaultMessage:'名称',
+              }),
             },
             avatar: {
               dataIndex: 'id',
@@ -198,16 +207,31 @@ const Product = observer(() => {
             },
             state: {
               // 自己扩展的字段,主要用于筛选,不在列表中显示
-              title: '状态',
+             title: intl.formatMessage({
+                id:'pages.device.product.status',
+                defaultMessage:'状态',
+              }),
               valueType: 'select',
               valueEnum: {
-                all: { text: '全部', status: 'Default' },
+                all: {
+                   text: intl.formatMessage({
+                    id:'pages.device.product.status.all',
+                    defaultMessage:'状态',
+                  }),
+                    status: 'Default' 
+                  },
                 1: {
-                  text: '已发布',
+                  text: intl.formatMessage({
+                    id:'pages.device.product.status.published',
+                    defaultMessage:'已发布',
+                  }),
                   status: 'Error',
                 },
                 0: {
-                  text: '未发布',
+                  text: intl.formatMessage({
+                    id:'pages.device.product.status.unpublished',
+                    defaultMessage:'未发布',
+                  }),
                   status: 'Success',
                 },
               },

+ 25 - 7
src/pages/log/Access/index.tsx

@@ -26,12 +26,18 @@ const Access: React.FC = () => {
       // ellipsis: true
     },
     {
-      title: '请求路径',
+      title:intl.formatMessage({
+        id:'pages.log.access.requestPath',
+        defaultMessage:'请求路径',
+      }),
       dataIndex: 'url',
-      // ellipsis: true,
+       // ellipsis: true,
     },
     {
-      title: '说明',
+       title:intl.formatMessage({
+        id:'pages.log.access.explain',
+        defaultMessage:'说明',
+      }),
       dataIndex: 'describe',
       // ellipsis: true,
       render: (text, record) => {
@@ -39,7 +45,10 @@ const Access: React.FC = () => {
       },
     },
     {
-      title: '请求时间',
+      title:intl.formatMessage({
+        id:'pages.log.access.requestTime',
+        defaultMessage:'请求时间',
+      }),
       dataIndex: 'requestTime',
       sorter: true,
       defaultSortOrder: 'descend',
@@ -47,14 +56,20 @@ const Access: React.FC = () => {
       renderText: (text: string) => moment(text).format('YYYY-MM-DD HH:mm:ss'),
     },
     {
-      title: '请求耗时',
+      title:intl.formatMessage({
+        id:'pages.log.access.requestTimeConsuming',
+        defaultMessage:'请求耗时',
+      }),
       // width: 100,
       renderText: (record: AccessLogItem) => (
         <Tag color="purple">{record.responseTime - record.requestTime}ms</Tag>
       ),
     },
     {
-      title: '请求用户',
+      title:intl.formatMessage({
+        id:'pages.log.access.requestUser',
+        defaultMessage:'请求用户',
+      }),
       dataIndex: 'context.username',
       render: (text) => <Tag color="geekblue">{text}</Tag>,
     },
@@ -85,7 +100,10 @@ const Access: React.FC = () => {
       <BaseCrud<AccessLogItem>
         columns={columns}
         service={service}
-        title="访问日志"
+        title={intl.formatMessage({
+          id: 'pages.log.access',
+          defaultMessage: '访问日志',
+        })}
         schema={{}}
         toolBar={[]}
         actionRef={actionRef}

+ 28 - 7
src/pages/log/System/index.tsx

@@ -22,34 +22,52 @@ const System = () => {
       width: 48,
     },
     {
-      title: '线程',
+      title:intl.formatMessage({
+        id:'pages.log.system.thread',
+        defaultMessage:'线程',
+      }),
       dataIndex: 'threadName',
       ellipsis: true,
     },
     {
-      title: '名称',
+      title:intl.formatMessage({
+        id:'pages.log.system.name',
+        defaultMessage:'名称',
+      }),
       dataIndex: 'name',
       ellipsis: true,
     },
     {
-      title: '级别',
+      title:intl.formatMessage({
+        id:'pages.log.system.level',
+        defaultMessage:'级别',
+      }),
       dataIndex: 'level',
       width: 80,
       render: (text) => <Tag color={text === 'ERROR' ? 'red' : 'orange'}>{text}</Tag>,
     },
     {
-      title: '日志内容',
+      title:intl.formatMessage({
+        id:'pages.log.system.logContent',
+        defaultMessage:'日志内容',
+      }),
       dataIndex: 'exceptionStack',
       ellipsis: true,
     },
     {
-      title: '服务名',
+      title:intl.formatMessage({
+        id:'pages.log.system.serviceName',
+        defaultMessage:'服务名',
+      }),
       dataIndex: 'context.server',
       width: 150,
       ellipsis: true,
     },
     {
-      title: '创建时间',
+      title:intl.formatMessage({
+        id:'pages.log.system.creationTime',
+        defaultMessage:'创建时间',
+      }),
       dataIndex: 'createTime',
       width: 200,
       sorter: true,
@@ -84,7 +102,10 @@ const System = () => {
       <BaseCrud<SystemLogItem>
         columns={columns}
         service={service}
-        title="系统日志"
+        title={intl.formatMessage({
+          id: 'pages.log.system',
+          defaultMessage: '系统日志',
+        })}
         schema={{}}
         actionRef={actionRef}
       />

+ 46 - 12
src/pages/system/OpenAPI/index.tsx

@@ -30,11 +30,18 @@ const OpenAPI: React.FC = () => {
       dataIndex: 'id',
     },
     {
-      title: '名称',
-      dataIndex: 'clientName',
+      title:intl.formatMessage({
+        id:'pages.system.open-api.Name',
+        defaultMessage:'名称',
+      }),
+      dataIndex: 'Name',
+
     },
     {
-      title: '用户名',
+      title:intl.formatMessage({
+        id:'pages.system.open-api.userName',
+        defaultMessage:'用户名',
+      }),
       dataIndex: 'username',
     },
     {
@@ -51,15 +58,24 @@ const OpenAPI: React.FC = () => {
       onFilter: true,
       valueEnum: [
         {
-          text: '全部',
+          text: intl.formatMessage({
+            id:'pages.searchTable.titleStatus.all',
+            defaultMessage: '全部',
+          }), 
           status: 'Default',
         },
         {
-          text: '正常',
+          text:intl.formatMessage({
+            id:'pages.searchTable.titleStatus.normal',
+            defaultMessage: '正常',
+          }), 
           status: '1',
         },
         {
-          text: '禁用',
+          text:intl.formatMessage({
+            id:'pages.searchTable.titleStatus.disable',
+            defaultMessage: '禁用',
+          }), 
           status: '0',
         },
       ],
@@ -142,7 +158,10 @@ const OpenAPI: React.FC = () => {
         name: 'oy139sts87c',
         properties: {
           clientName: {
-            title: '名称',
+            title:intl.formatMessage({
+              id:'pages.system.open-api.Name',
+              defaultMessage:'名称',
+            }),
             type: 'string',
             'x-decorator': 'FormItem',
             'x-component': 'Input',
@@ -198,7 +217,10 @@ const OpenAPI: React.FC = () => {
             name: 'secureKey',
           },
           username: {
-            title: '用户名',
+            title:intl.formatMessage({
+              id:'pages.system.open-api.userName',
+              defaultMessage:'用户名',
+            }),
             type: 'string',
             'x-decorator': 'FormItem',
             'x-component': 'Input',
@@ -214,7 +236,10 @@ const OpenAPI: React.FC = () => {
             name: 'username',
           },
           password: {
-            title: '密码',
+            title:intl.formatMessage({
+              id:'pages.system.open-api.passWord',
+              defaultMessage:'密码',
+            }),
             type: 'string',
             'x-decorator': 'FormItem',
             'x-component': 'Input',
@@ -263,7 +288,10 @@ const OpenAPI: React.FC = () => {
         },
       },
       ipWhiteList: {
-        title: 'IP白名单',
+        title:intl.formatMessage({
+          id:'pages.system.open-api.ipWhileList',
+          defaultMessage:'IP白名单',
+        }),
         type: 'string',
         'x-decorator': 'FormItem',
         'x-component': 'Input.TextArea',
@@ -277,7 +305,10 @@ const OpenAPI: React.FC = () => {
         'x-index': 1,
       },
       description: {
-        title: '描述',
+        title:intl.formatMessage({
+          id:'pages.system.open-api.describe',
+          defaultMessage:'描述',
+        }),
         type: 'string',
         'x-decorator': 'FormItem',
         'x-component': 'Input.TextArea',
@@ -299,7 +330,10 @@ const OpenAPI: React.FC = () => {
       <BaseCrud<OpenApiItem>
         columns={columns}
         service={service}
-        title="第三方平台"
+        title={intl.formatMessage({
+          id: 'pages.system.open-api',
+          defaultMessage: '第三方平台',
+        })}
         schema={schema}
         modelConfig={{ width: 900 }}
         actionRef={actionRef}

+ 7 - 2
src/pages/system/Org/index.tsx

@@ -10,6 +10,7 @@ import Service from '@/pages/system/Org/service';
 import encodeQuery from '@/utils/encodeQuery';
 import type { ObsModel, OrgItem } from '@/pages/system/Org/typings';
 import Save from '@/pages/system/Org/Save';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const obs = model<ObsModel>({
   edit: false,
@@ -42,6 +43,7 @@ const obs = model<ObsModel>({
 
 const service = new Service('organization');
 const Org = observer(() => {
+  const intl = useIntl();
   const hitCenter = () => {
     const orgChart = document.getElementsByClassName('orgchart-container')[0];
     const { width } = orgChart.getBoundingClientRect();
@@ -57,7 +59,10 @@ const Org = observer(() => {
     );
     obs.data = {
       id: null,
-      name: '机构管理',
+      name: intl.formatMessage({
+        id:'pages.system.org',
+        defaultMessage:'机构管理',
+      }),
       title: '组织架构',
       children: response.result,
     };
@@ -150,4 +155,4 @@ const Org = observer(() => {
   );
 });
 
-export default Org;
+export default Org;

+ 93 - 18
src/pages/system/Permission/index.tsx

@@ -66,7 +66,10 @@ const Permission: React.FC = () => {
       copyable: true,
       ellipsis: true,
       align: 'center',
-      tip: '名称过长会自动收缩',
+      tip:intl.formatMessage({
+        id: 'pages.system.permission.name.tip',
+        defaultMessage: '名称过长会自动收缩',
+      }),
       formItemProps: {
         rules: [
           {
@@ -90,13 +93,25 @@ const Permission: React.FC = () => {
       onFilter: true,
       valueType: 'select',
       valueEnum: {
-        all: { text: '全部', status: 'Default' },
+        all: {
+          text: intl.formatMessage({
+            id:'pages.searchTable.titleStatus.all',
+            defaultMessage: '全部',
+          }), 
+           status: 'Default' 
+          },
         1: {
-          text: '正常',
+          text:intl.formatMessage({
+            id:'pages.searchTable.titleStatus.normal',
+            defaultMessage: '正常',
+          }), 
           status: 1,
         },
         0: {
-          text: '禁用',
+          text:intl.formatMessage({
+            id:'pages.searchTable.titleStatus.disable',
+            defaultMessage: '禁用',
+          }), 
           status: 0,
         },
       },
@@ -180,7 +195,10 @@ const Permission: React.FC = () => {
             type: 'void',
             'x-component': 'FormTab.TabPane',
             'x-component-props': {
-              tab: '基础信息',
+              tab: intl.formatMessage({
+                id: 'pages.system.permission.basicInformation',
+                defaultMessage: '基础信息',
+              }),
             },
             properties: {
               id: {
@@ -225,7 +243,10 @@ const Permission: React.FC = () => {
             type: 'void',
             'x-component': 'FormTab.TabPane',
             'x-component-props': {
-              tab: '操作配置',
+              tab: intl.formatMessage({
+                id: 'pages.system.permission.operationConfiguration',
+                defaultMessage: '操作配置',
+              }),
             },
             properties: {
               array: {
@@ -250,7 +271,13 @@ const Permission: React.FC = () => {
                     column3: {
                       type: 'void',
                       'x-component': 'ArrayTable.Column',
-                      'x-component-props': { width: 200, title: '操作类型' },
+                      'x-component-props': { 
+                        width: 200, 
+                        title: intl.formatMessage({
+                          id: 'pages.system.permission.operationConfiguration.type',
+                          defaultMessage: '操作类型',
+                        }),
+                      },
                       properties: {
                         a1: {
                           type: 'string',
@@ -262,7 +289,13 @@ const Permission: React.FC = () => {
                     column4: {
                       type: 'void',
                       'x-component': 'ArrayTable.Column',
-                      'x-component-props': { width: 200, title: '名称' },
+                      'x-component-props': { 
+                        width: 200, 
+                        title:  intl.formatMessage({
+                          id: 'pages.system.permission.operationConfiguration.name',
+                          defaultMessage: '名称',
+                        }),
+                      },
                       properties: {
                         a2: {
                           type: 'string',
@@ -274,7 +307,13 @@ const Permission: React.FC = () => {
                     column5: {
                       type: 'void',
                       'x-component': 'ArrayTable.Column',
-                      'x-component-props': { width: 200, title: '描述' },
+                      'x-component-props': { 
+                        width: 200, 
+                        title:  intl.formatMessage({
+                          id: 'pages.system.permission.operationConfiguration.describe',
+                          defaultMessage: '描述',
+                        }), 
+                      },
                       properties: {
                         a3: {
                           type: 'string',
@@ -287,7 +326,10 @@ const Permission: React.FC = () => {
                       type: 'void',
                       'x-component': 'ArrayTable.Column',
                       'x-component-props': {
-                        title: '操作',
+                        title:  intl.formatMessage({
+                          id: 'pages.data.option',
+                          defaultMessage: '操作',
+                        }),
                         dataIndex: 'operations',
                         width: 200,
                         fixed: 'right',
@@ -319,7 +361,10 @@ const Permission: React.FC = () => {
                   add: {
                     type: 'void',
                     'x-component': 'ArrayTable.Addition',
-                    title: '添加条目',
+                    title: intl.formatMessage({
+                      id:'pages.system.permission.add',
+                      defaultMessage:'添加条目'
+                    })
                   },
                 },
               },
@@ -329,7 +374,10 @@ const Permission: React.FC = () => {
             type: 'void',
             'x-component': 'FormTab.TabPane',
             'x-component-props': {
-              tab: '关联权限',
+              tab:intl.formatMessage({
+                id: 'pages.system.permission.associatedPermissions',
+                defaultMessage: '关联权限',
+              }),
             },
             properties: {
               array1: {
@@ -354,7 +402,13 @@ const Permission: React.FC = () => {
                     column3: {
                       type: 'void',
                       'x-component': 'ArrayTable.Column',
-                      'x-component-props': { width: 200, title: '前置操作' },
+                      'x-component-props': { 
+                        width: 200, 
+                        title: intl.formatMessage({
+                          id: 'pages.system.permission.associatedPermissions.preOperation',
+                          defaultMessage: '前置操作',
+                        }),
+                      },
                       properties: {
                         a1: {
                           type: 'string',
@@ -366,7 +420,13 @@ const Permission: React.FC = () => {
                     column4: {
                       type: 'void',
                       'x-component': 'ArrayTable.Column',
-                      'x-component-props': { width: 200, title: '关联权限' },
+                      'x-component-props': { 
+                        width: 200, 
+                        title: intl.formatMessage({
+                          id: 'pages.system.permission.associatedPermissions.associatedPermissions',
+                          defaultMessage: '关联权限',
+                        }),
+                      },
                       properties: {
                         a2: {
                           type: 'string',
@@ -378,7 +438,13 @@ const Permission: React.FC = () => {
                     column5: {
                       type: 'void',
                       'x-component': 'ArrayTable.Column',
-                      'x-component-props': { width: 200, title: '关联操作' },
+                      'x-component-props': { 
+                        width: 200, 
+                        title: intl.formatMessage({
+                          id: 'pages.system.permission.associatedPermissions.associatedOperation',
+                          defaultMessage: '关联操作',
+                        }),
+                      },
                       properties: {
                         a3: {
                           type: 'string',
@@ -391,7 +457,10 @@ const Permission: React.FC = () => {
                       type: 'void',
                       'x-component': 'ArrayTable.Column',
                       'x-component-props': {
-                        title: '操作',
+                        title: intl.formatMessage({
+                          id: 'pages.data.option',
+                          defaultMessage: '操作',
+                        }),
                         dataIndex: 'operations',
                         width: 200,
                         fixed: 'right',
@@ -423,7 +492,10 @@ const Permission: React.FC = () => {
                   add: {
                     type: 'void',
                     'x-component': 'ArrayTable.Addition',
-                    title: '添加条目',
+                    title: intl.formatMessage({
+                      id:'pages.system.permission.add',
+                      defaultMessage:'添加条目'
+                    }),
                   },
                 },
               },
@@ -433,7 +505,10 @@ const Permission: React.FC = () => {
             type: 'void',
             'x-component': 'FormTab.TabPane',
             'x-component-props': {
-              tab: '数据视图',
+              tab: intl.formatMessage({
+                id: 'pages.system.permission.dataView',
+                defaultMessage: '数据视图',
+              }),
             },
           },
         },

+ 32 - 8
src/pages/system/Tenant/index.tsx

@@ -34,25 +34,37 @@ const Tenant = () => {
     },
     {
       dataIndex: 'tenant',
-      title: '头像',
+      title:intl.formatMessage({
+        id:'pages.system.tenant.avatar',
+        defaultMessage:'头像',
+      }),
       align: 'center',
       search: false,
       renderText: (text: TenantDetail) => <Avatar src={text.photo} />,
     },
     {
       dataIndex: 'tenant',
-      title: '名称',
+      title:intl.formatMessage({
+        id:'pages.system.tenant.name',
+        defaultMessage:'名称',
+      }),
       align: 'center',
       renderText: (text: TenantDetail) => text.name,
     },
     {
       dataIndex: 'members',
-      title: '成员数',
+      title:intl.formatMessage({
+        id:'pages.system.tenant.members',
+        defaultMessage:'成员数',
+      }),
       align: 'center',
     },
     {
       dataIndex: 'tenant',
-      title: '状态',
+      title:intl.formatMessage({
+        id:'pages.searchTable.titleStatus',
+        defaultMessage:'状态',
+      }),
       align: 'center',
       renderText: (text: TenantDetail) => text.state.text,
       valueType: 'select',
@@ -60,15 +72,24 @@ const Tenant = () => {
       onFilter: true,
       valueEnum: [
         {
-          text: '全部',
+          text: intl.formatMessage({
+            id:'pages.searchTable.titleStatus.all',
+            defaultMessage: '全部',
+          }), 
           status: 'Default',
         },
         {
-          text: '正常',
+          text:intl.formatMessage({
+            id:'pages.searchTable.titleStatus.normal',
+            defaultMessage: '正常',
+          }), 
           status: '1',
         },
         {
-          text: '禁用',
+          text:intl.formatMessage({
+            id:'pages.searchTable.titleStatus.disable',
+            defaultMessage: '禁用',
+          }), 
           status: '0',
         },
       ],
@@ -144,7 +165,10 @@ const Tenant = () => {
         request={(params = {}) => service.queryDetail(params)}
         columns={columns}
         service={service}
-        title="租户列表"
+        title={intl.formatMessage({
+          id: 'pages.system.tenant.list',
+          defaultMessage: '租户列表',
+        })}
         schema={{}}
         menu={menu}
         actionRef={actionRef}

+ 15 - 3
src/pages/system/User/index.tsx

@@ -99,13 +99,25 @@ const User = observer(() => {
       onFilter: true,
       valueType: 'select',
       valueEnum: {
-        all: { text: '全部', status: 'Default' },
+        all: { 
+          text: intl.formatMessage({
+            id:'pages.searchTable.titleStatus.all',
+            defaultMessage: '全部',
+          }), 
+          status: 'Default' 
+        },
         1: {
-          text: '正常',
+          text:intl.formatMessage({
+            id:'pages.searchTable.titleStatus.normal',
+            defaultMessage: '正常',
+          }), 
           status: 1,
         },
         0: {
-          text: '禁用',
+          text:intl.formatMessage({
+            id:'pages.searchTable.titleStatus.disable',
+            defaultMessage: '禁用',
+          }), 
           status: 0,
         },
       },