crush394 4 лет назад
Родитель
Сommit
7bd1713acb

+ 10 - 4
src/locales/en-US/pages.ts

@@ -134,14 +134,17 @@ export default {
   'pages.device.alarm.option.data': 'Alarm Data',
   // 设备接入
   'pages.link.certificate': 'Certificate',
-  'pages.link.protocol': 'protocol',
-  'pages.link.type': 'Network components',
+  'pages.link.protocol': 'Protocol',
+  'pages.link.component': 'Network components',
   'pages.link.gateway': 'Gateway',
   'pages.link.opcua': 'OPC UA',
-
+  'pages.link.type': 'Type',
+  'pages.link.provider': 'Provider',
+  'pages.link.option.debug': 'Debug',
+  'pages.link.option.record': 'Record',
   // 通知管理
   'pages.notice.config': 'Config',
-  'pages.notice.config.service': 'Service',
+  'pages.notice.config.provider': 'Provider',
   'pages.notice.config.type': 'Type',
   'pages.notice.template': 'Template',
   'pages.notice.option.download': 'Download Configuration',
@@ -163,6 +166,9 @@ export default {
   'pages.visualization.category': 'Category',
   'pages.visualization.screen': 'Screen',
   'pages.visualization.configuration': 'Configuration',
+  'pages.visualization.option.addClass': 'Add Subclasses',
+  'pages.visualization.option.record': 'Notification Records',
+  'pages.visualization.option.copy': 'Copy',
 
   // 模拟测试
   'pages.simulator.device': 'Device',

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

@@ -134,13 +134,16 @@ export default {
   // 设备接入
   'pages.link.certificate': '证书管理',
   'pages.link.protocol': '协议管理',
-  'pages.link.type': '网络组件',
+  'pages.link.component': '网络组件',
   'pages.link.gateway': '设备网关',
   'pages.link.opcua': 'OPC UA',
-
+  'pages.link.type': 'Type',
+  'pages.link.provider': '服务商',
+  'pages.link.option.debug': '调试',
+  'pages.link.option.record': '通知记录',
   // 通知管理
   'pages.notice.config': '通知配置',
-  'pages.notice.config.service': '服务商',
+  'pages.notice.config.provider': '服务商',
   'pages.notice.config.type': '通知类型',
   'pages.notice.template': '通知模板',
   'pages.notice.option.debug': '调试',
@@ -161,6 +164,9 @@ export default {
   'pages.visualization.category': '分类管理',
   'pages.visualization.screen': '大屏管理',
   'pages.visualization.configuration': '组态管理',
+  'pages.visualization.option.addClass': '添加子分类',
+  'pages.visualization.option.record': '通知记录',
+  'pages.visualization.option.copy': '复制',
 
   // 模拟测试
   'pages.simulator.device': '设备模拟器',

+ 34 - 7
src/pages/link/Certificate/index.tsx

@@ -6,9 +6,11 @@ import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import { Tooltip } from 'antd';
 import { EditOutlined, MinusOutlined } from '@ant-design/icons';
 import BaseCrud from '@/components/BaseCrud';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 export const service = new BaseService<CertificateItem>('network/certificate');
 const Certificate = () => {
+  const intl = useIntl();
   const actionRef = useRef<ActionType>();
 
   const columns: ProColumns<CertificateItem>[] = [
@@ -19,29 +21,51 @@ const Certificate = () => {
     },
     {
       dataIndex: 'name',
-      title: '名称',
+      title: intl.formatMessage({
+        id: 'pages.table.name',
+        defaultMessage: '名称',
+      }),
     },
     {
       dataIndex: 'instance',
-      title: '类型',
+      title: intl.formatMessage({
+        id: 'pages.link.type',
+        defaultMessage: '类型',
+      }),
     },
     {
       dataIndex: 'description',
-      title: '描述',
+      title: intl.formatMessage({
+        id: 'pages.table.describe',
+        defaultMessage: '描述',
+      }),
     },
     {
-      title: '操作',
+      title: intl.formatMessage({
+        id: 'pages.data.option',
+        defaultMessage: '操作',
+      }),
       valueType: 'option',
       align: 'center',
       width: 200,
       render: (text, record) => [
         <a onClick={() => console.log(record)}>
-          <Tooltip title="编辑">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.edit',
+              defaultMessage: '编辑',
+            })}
+          >
             <EditOutlined />
           </Tooltip>
         </a>,
         <a>
-          <Tooltip title="删除">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.remove',
+              defaultMessage: '删除',
+            })}
+          >
             <MinusOutlined />
           </Tooltip>
         </a>,
@@ -56,7 +80,10 @@ const Certificate = () => {
       <BaseCrud
         columns={columns}
         service={service}
-        title="证书管理"
+        title={intl.formatMessage({
+          id: 'pages.link.certificate',
+          defaultMessage: '证书管理',
+        })}
         schema={schema}
         actionRef={actionRef}
       />

+ 52 - 10
src/pages/link/Gateway/index.tsx

@@ -12,9 +12,11 @@ import {
   MinusOutlined,
 } from '@ant-design/icons';
 import BaseCrud from '@/components/BaseCrud';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 export const service = new BaseService<GatewayItem>('network/config');
 const Gateway = () => {
+  const intl = useIntl();
   const actionRef = useRef<ActionType>();
 
   const columns: ProColumns<GatewayItem>[] = [
@@ -25,45 +27,82 @@ const Gateway = () => {
     },
     {
       dataIndex: 'name',
-      title: '名称',
+      title: intl.formatMessage({
+        id: 'pages.table.name',
+        defaultMessage: '名称',
+      }),
     },
     {
       dataIndex: 'type',
-      title: '类型',
+      title: intl.formatMessage({
+        id: 'pages.link.type',
+        defaultMessage: '类型',
+      }),
     },
     {
       dataIndex: 'state',
-      title: '状态',
+      title: intl.formatMessage({
+        id: 'pages.searchTable.titleStatus',
+        defaultMessage: '状态',
+      }),
       render: (text, record) => record.state.value,
     },
     {
-      title: '操作',
+      title: intl.formatMessage({
+        id: 'pages.data.option',
+        defaultMessage: '操作',
+      }),
       valueType: 'option',
       align: 'center',
       width: 200,
       render: (text, record) => [
         <a onClick={() => console.log(record)}>
-          <Tooltip title="编辑">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.edit',
+              defaultMessage: '编辑',
+            })}
+          >
             <EditOutlined />
           </Tooltip>
         </a>,
         <a>
-          <Tooltip title="删除">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.remove',
+              defaultMessage: '删除',
+            })}
+          >
             <MinusOutlined />
           </Tooltip>
         </a>,
         <a>
-          <Tooltip title="下载配置">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.download',
+              defaultMessage: '下载配置',
+            })}
+          >
             <ArrowDownOutlined />
           </Tooltip>
         </a>,
         <a>
-          <Tooltip title="调试">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.notice.option.debug',
+              defaultMessage: '调试',
+            })}
+          >
             <BugOutlined />
           </Tooltip>
         </a>,
         <a>
-          <Tooltip title="通知记录">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.link.option.record',
+              defaultMessage: '通知记录',
+            })}
+          >
             <BarsOutlined />
           </Tooltip>
         </a>,
@@ -78,7 +117,10 @@ const Gateway = () => {
       <BaseCrud
         columns={columns}
         service={service}
-        title="设备网关"
+        title={intl.formatMessage({
+          id: 'pages.link.gateway',
+          defaultMessage: '设备网关',
+        })}
         schema={schema}
         actionRef={actionRef}
       />

+ 44 - 9
src/pages/link/Type/index.tsx

@@ -6,10 +6,12 @@ import { BugOutlined, EditOutlined, MinusOutlined } from '@ant-design/icons';
 import { PageContainer } from '@ant-design/pro-layout';
 import BaseCrud from '@/components/BaseCrud';
 import type { NetworkItem } from '@/pages/link/Type/typings';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 export const service = new BaseService<NetworkItem>('network/config');
 
 const Network = () => {
+  const intl = useIntl();
   const actionRef = useRef<ActionType>();
 
   const columns: ProColumns<NetworkItem>[] = [
@@ -20,39 +22,69 @@ const Network = () => {
     },
     {
       dataIndex: 'name',
-      title: '名称',
+      title: intl.formatMessage({
+        id: 'pages.table.name',
+        defaultMessage: '名称',
+      }),
     },
     {
       dataIndex: 'type',
-      title: '类型',
+      title: intl.formatMessage({
+        id: 'pages.link.type',
+        defaultMessage: '类型',
+      }),
     },
     {
       dataIndex: 'state',
-      title: '状态',
+      title: intl.formatMessage({
+        id: 'pages.searchTable.titleStatus',
+        defaultMessage: '状态',
+      }),
       render: (text, record) => record.state.value,
     },
     {
       dataIndex: 'provider',
-      title: '服务商',
+      title: intl.formatMessage({
+        id: 'pages.link.provider',
+        defaultMessage: '服务商',
+      }),
     },
     {
-      title: '操作',
+      title: intl.formatMessage({
+        id: 'pages.data.option',
+        defaultMessage: '操作',
+      }),
       valueType: 'option',
       align: 'center',
       width: 200,
       render: (text, record) => [
         <a onClick={() => console.log(record)}>
-          <Tooltip title="编辑">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.edit',
+              defaultMessage: '编辑',
+            })}
+          >
             <EditOutlined />
           </Tooltip>
         </a>,
         <a>
-          <Tooltip title="删除">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.remove',
+              defaultMessage: '删除',
+            })}
+          >
             <MinusOutlined />
           </Tooltip>
         </a>,
         <a>
-          <Tooltip title="调试">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.notice.option.debug',
+              defaultMessage: '调试',
+            })}
+          >
             <BugOutlined />
           </Tooltip>
         </a>,
@@ -67,7 +99,10 @@ const Network = () => {
       <BaseCrud
         columns={columns}
         service={service}
-        title="网络组建"
+        title={intl.formatMessage({
+          id: 'pages.link.component',
+          defaultMessage: '网络组建',
+        })}
         schema={schema}
         actionRef={actionRef}
       />