Преглед изворни кода

locale: device\notice\rule-engine

Lind пре 4 година
родитељ
комит
c3025071a6

+ 30 - 14
src/locales/en-US/pages.ts

@@ -11,10 +11,10 @@ export default {
   'pages.notification.error': 'Your network is abnormal and you cannot connect to the server',
 
   // 通用的数据操作
-  'pages.data.option': 'option',
-  'pages.data.option.remove': 'delete',
+  'pages.data.option': 'Option',
+  'pages.data.option.remove': 'Delete',
   'pages.data.option.remove.tips': 'Confirm to delete?',
-  'pages.data.option.disabled': 'disable',
+  'pages.data.option.disabled': 'Disable',
   'pages.data.option.disabled.tips': 'Confirm to disable?',
   'pages.data.option.enabled': 'enable',
   'pages.data.option.enabled.tips': 'Confirm to enable?',
@@ -37,6 +37,7 @@ export default {
   'pages.table.equipmentName': 'Equipment Name',
   'pages.table.describe': 'Describe',
   'pages.table.description': 'Explain',
+  'pages.table.type': 'Type',
 
   // 统计分析
   'pages.analysis.cpu': 'CPU Usage',
@@ -81,7 +82,6 @@ export default {
   'pages.system.tenant.members': 'Members',
   // 系统设置-数据源管理
   'pages.system.datasource.': 'Data Source',
-  'pages.system.datasource.type': 'Type',
 
   // 设备管理-产品
   'pages.device.product': 'Product',
@@ -106,11 +106,12 @@ export default {
   'pages.device.instance.describe': 'Explain',
   // 设备管理-指令下发
   'pages.device.command': 'Command',
-  'pages.device.command.deviceID': 'Device ID',
-  '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.id': 'Device ID',
+  'pages.device.command.type': 'Instruction Type',
+  'pages.device.command.type.readAttributes': 'Read Attributes',
+  'pages.device.command.type.setProperties': 'Set Properties',
+  'pages.device.command.type.callAttribute': 'Call Attribute',
+  'pages.device.command.option.send': 'Resend',
   'pages.device.command.status.waiting': 'Waiting',
   'pages.device.command.status.failed ': 'Failed to send',
   'pages.device.command.status.succeed': 'Sent successfully',
@@ -125,26 +126,38 @@ export default {
   'pages.device.firmware.creationTime': 'Creation Time',
   // 设备管理-告警记录
   'pages.device.alarm': 'Alarm',
-  'pages.device.alarm.deviceID': 'Device ID',
+  'pages.device.alarm.id': 'Device ID',
   'pages.device.alarm.name': 'Alarm Name',
   'pages.device.alarm.time': 'Alarm Time',
   'pages.device.alarm.status': 'Processing State',
-
+  'pages.device.alarm.option.dispose': 'Dispose',
+  'pages.device.alarm.option.data': 'Alarm Data',
   // 设备接入
   'pages.link.certificate': 'Certificate',
   'pages.link.protocol': 'protocol',
-  'pages.link.type': 'Type',
+  'pages.link.type': 'Network components',
   'pages.link.gateway': 'Gateway',
   'pages.link.opcua': 'OPC UA',
 
   // 通知管理
   'pages.notice.config': 'Config',
+  'pages.notice.config.service': 'Service',
+  'pages.notice.config.type': 'Type',
   'pages.notice.template': 'Template',
+  'pages.notice.option.download': 'Download Configuration',
+  'pages.notice.option.debug': 'Debug',
+  'pages.notice.option.record': 'Notification Records',
 
   // 规则引擎
   'pages.ruleEngine.instance': 'Instance',
   'pages.ruleEngine.sqlRule': 'SQL Rule',
+  'pages.ruleEngine.sqlRule.time': 'Create Time',
   'pages.ruleEngine.scene': 'Scene',
+  'pages.ruleEngine.scene.trigger': 'Trigger',
+  'pages.ruleEngine.option.detail': 'Detail',
+  'pages.ruleEngine.option.start': 'Start',
+  'pages.ruleEngine.option.restart': 'Restart',
+  'pages.ruleEngine.option.stop': 'Stop',
 
   // 可视化
   'pages.visualization.category': 'Category',
@@ -171,9 +184,12 @@ export default {
 
   // 云云对接
   'pages.cloud.duerOS': 'Duer OS',
+  'pages.cloud.duerOS.applianceType': 'Appliance Type',
+  'pages.cloud.duerOS.manufacturerName': 'Manufacture Name',
+  'pages.cloud.duerOS.version': 'Version',
   'pages.cloud.aliyun': 'Aliyun',
-  'pages.cloud.onenet': '移动OneNet',
-  'pages.cloud.ctwing': '电信CTWing',
+  'pages.cloud.onenet': 'Mobile OneNet',
+  'pages.cloud.ctwing': 'Telecom CTWing',
 
   // 视频网关
   'pages.media.config': 'Config',

+ 23 - 8
src/locales/zh-CN/pages.ts

@@ -81,7 +81,6 @@ export default {
   'pages.system.tenant.members': '成员数',
   // 系统设置-数据源管理
   'pages.system.datasource.': '数据源管理',
-  'pages.system.datasource.type': '类型',
 
   // 设备管理-产品
   'pages.device.product': '产品',
@@ -95,6 +94,7 @@ export default {
   'pages.device.category.id': '分类ID',
   'pages.device.category.logotype': '标识',
   'pages.device.category.name': '分类名称',
+  'pages.device.category.addClass': '添加子分类',
   // 设备管理-设备
   'pages.device.instance': '设备',
   'pages.device.instance.management': '设备管理',
@@ -105,11 +105,12 @@ export default {
   'pages.device.instance.status.onLine': '在线',
   // 设备管理-指令下发
   'pages.device.command': '指令下发',
-  'pages.device.command.deviceID': '设备ID',
-  'pages.device.command.instructionType': '指令类型',
-  'pages.device.command.instructionType.readAttributes': '读取属性',
-  'pages.device.command.instructionType.setProperties': '设置属性',
-  'pages.device.command.instructionType.callAttribute': '调用属性',
+  'pages.device.command.id': '设备ID',
+  'pages.device.command.type': '指令类型',
+  'pages.device.command.type.readAttributes': '读取属性',
+  'pages.device.command.type.setProperties': '设置属性',
+  'pages.device.command.type.callAttribute': '调用属性',
+  'pages.device.command.option.send': '重新发送',
   'pages.device.command.status.waiting': '等待中',
   'pages.device.command.status.failed ': '发送失败',
   'pages.device.command.status.succeed': '发送成功',
@@ -124,11 +125,12 @@ export default {
   'pages.device.firmware.creationTime': '创建时间',
   // 设备管理-告警记录
   'pages.device.alarm': '告警记录',
-  'pages.device.alarm.deviceID': '设备ID',
+  'pages.device.alarm.id': '设备ID',
   'pages.device.alarm.name': '告警名称',
   'pages.device.alarm.time': '告警时间',
   'pages.device.alarm.status': '处理状态',
-
+  'pages.device.alarm.option.dispose': '处理',
+  'pages.device.alarm.option.data': '告警数据',
   // 设备接入
   'pages.link.certificate': '证书管理',
   'pages.link.protocol': '协议管理',
@@ -138,12 +140,22 @@ export default {
 
   // 通知管理
   'pages.notice.config': '通知配置',
+  'pages.notice.config.service': '服务商',
+  'pages.notice.config.type': '通知类型',
   'pages.notice.template': '通知模板',
+  'pages.notice.option.debug': '调试',
+  'pages.notice.option.record': '通知记录',
 
   // 规则引擎
   'pages.ruleEngine.instance': '规则实例',
   'pages.ruleEngine.sqlRule': '数据转发',
+  'pages.ruleEngine.sqlRule.time': '创建时间',
   'pages.ruleEngine.scene': '场景联动',
+  'pages.ruleEngine.scene.trigger': '触发方式',
+  'pages.ruleEngine.option.detail': '查看',
+  'pages.ruleEngine.option.start': '启动',
+  'pages.ruleEngine.option.restart': '重启',
+  'pages.ruleEngine.option.stop': '停止',
 
   // 可视化
   'pages.visualization.category': '分类管理',
@@ -169,6 +181,9 @@ export default {
 
   // 云云对接
   'pages.cloud.duerOS': 'Duer OS',
+  'pages.cloud.duerOS.applianceType': '设备类型',
+  'pages.cloud.duerOS.manufacturerName': '厂家名称',
+  'pages.cloud.duerOS.version': '动作数量',
   'pages.cloud.aliyun': '阿里云',
   'pages.cloud.onenet': '移动OneNet',
   'pages.cloud.ctwing': '电信CTWing',

+ 6 - 1
src/pages/device/Category/index.tsx

@@ -73,7 +73,12 @@ const Category = () => {
           </Tooltip>
         </a>,
         <a onClick={() => {}}>
-          <Tooltip title="添加子分类">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.device.category.addClass',
+              defaultMessage: '添加子分类',
+            })}
+          >
             <PlusOutlined />
           </Tooltip>
         </a>,

+ 15 - 7
src/pages/device/Command/index.tsx

@@ -22,7 +22,7 @@ const Command = () => {
     },
     {
       title: intl.formatMessage({
-        id: 'pages.device.command.deviceID',
+        id: 'pages.device.command.id',
         defaultMessage: '设备ID',
       }),
       dataIndex: 'deviceId',
@@ -36,28 +36,28 @@ const Command = () => {
     },
     {
       title: intl.formatMessage({
-        id: 'pages.device.command.instructionType',
+        id: 'pages.device.command.type',
         defaultMessage: '指令类型',
       }),
       dataIndex: 'messageType',
       filters: [
         {
           text: intl.formatMessage({
-            id: 'pages.device.command.instructionType.readAttributes',
+            id: 'pages.device.command.type.readAttributes',
             defaultMessage: '读取属性',
           }),
           value: 'READ_PROPERTY',
         },
         {
           text: intl.formatMessage({
-            id: 'pages.device.command.instructionType.setProperties',
+            id: 'pages.device.command.type.setProperties',
             defaultMessage: '设置属性',
           }),
           value: 'WRITE_PROPERTY',
         },
         {
           text: intl.formatMessage({
-            id: 'pages.device.command.instructionType.callAttribute',
+            id: 'pages.device.command.type.callAttribute',
             defaultMessage: '调用属性',
           }),
           value: 'INVOKE_FUNCTION',
@@ -150,7 +150,12 @@ const Command = () => {
                 // );
               }}
             >
-              <Tooltip title="重新发送">
+              <Tooltip
+                title={intl.formatMessage({
+                  id: 'pages.device.command.option.send',
+                  defaultMessage: '重新发送',
+                })}
+              >
                 <SyncOutlined />
               </Tooltip>
             </a>
@@ -166,7 +171,10 @@ const Command = () => {
       <BaseCrud<CommandItem>
         columns={columns}
         service={service}
-        title={'指令下发'}
+        title={intl.formatMessage({
+          id: 'pages.device.command',
+          defaultMessage: '指令下发',
+        })}
         schema={schema}
         actionRef={actionRef}
       />

+ 32 - 5
src/pages/notice/Config/index.tsx

@@ -11,10 +11,12 @@ import {
 import { Tooltip } from 'antd';
 import { useRef } from 'react';
 import BaseCrud from '@/components/BaseCrud';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 export const service = new BaseService<ConfigItem>('notifier/config');
 
 const Config = () => {
+  const intl = useIntl();
   const actionRef = useRef<ActionType>();
 
   const columns: ProColumns<ConfigItem>[] = [
@@ -42,27 +44,52 @@ const Config = () => {
       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.notice.option.record',
+              defaultMessage: '通知记录',
+            })}
+          >
             <BarsOutlined />
           </Tooltip>
         </a>,

+ 24 - 4
src/pages/notice/Template/index.tsx

@@ -35,22 +35,42 @@ const Template = () => {
       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>,

+ 30 - 5
src/pages/rule-engine/Instance/index.tsx

@@ -43,28 +43,53 @@ const Instance = () => {
       width: 200,
       render: (text, record) => [
         <a>
-          <Tooltip title="查看">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.ruleEngine.option.detail',
+              defaultMessage: '查看',
+            })}
+          >
             <EyeOutlined />
           </Tooltip>
         </a>,
         <a onClick={() => console.log(record)}>
-          <Tooltip title="编辑">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.edit',
+              defaultMessage: '编辑',
+            })}
+          >
             <EditOutlined />
           </Tooltip>
         </a>,
         <a onClick={() => console.log(record)}>
-          <Tooltip title="启动">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.ruleEngine.option.start',
+              defaultMessage: '启动',
+            })}
+          >
             <CaretRightOutlined />
           </Tooltip>
         </a>,
         <a onClick={() => console.log(record)}>
-          <Tooltip title="重启">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.ruleEngine.option.restart',
+              defaultMessage: '重启',
+            })}
+          >
             <ReloadOutlined />
           </Tooltip>
         </a>,
 
         <a>
-          <Tooltip title="删除">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.remove',
+              defaultMessage: '删除',
+            })}
+          >
             <MinusOutlined />
           </Tooltip>
         </a>,

+ 36 - 6
src/pages/rule-engine/SQLRule/index.tsx

@@ -43,32 +43,62 @@ const SQLRule = () => {
       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 onClick={() => console.log(record)}>
-          <Tooltip title="启动">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.ruleEngine.option.start',
+              defaultMessage: '启动',
+            })}
+          >
             <CaretRightOutlined />
           </Tooltip>
         </a>,
         <a onClick={() => console.log(record)}>
-          <Tooltip title="重启">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.ruleEngine.option.restart',
+              defaultMessage: '重启',
+            })}
+          >
             <ReloadOutlined />
           </Tooltip>
         </a>,
         <a onClick={() => console.log(record)}>
-          <Tooltip title="停止">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.ruleEngine.option.stop',
+              defaultMessage: '停止',
+            })}
+          >
             <StopOutlined />
           </Tooltip>
         </a>,
         <a>
-          <Tooltip title="删除">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.remove',
+              defaultMessage: '删除',
+            })}
+          >
             <MinusOutlined />
           </Tooltip>
         </a>,
         <a key="download">
-          <Tooltip title="下载配置">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.download',
+              defaultMessage: '下载配置',
+            })}
+          >
             <DownloadOutlined
               onClick={() => {
                 message.success('下载');

+ 36 - 6
src/pages/rule-engine/Scene/index.tsx

@@ -45,33 +45,63 @@ const Scene = () => {
       width: 200,
       render: (text, record) => [
         <a>
-          <Tooltip title="查看">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.ruleEngine.option.detail',
+              defaultMessage: '查看',
+            })}
+          >
             <EyeOutlined />
           </Tooltip>
         </a>,
         <a onClick={() => console.log(record)}>
-          <Tooltip title="编辑">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.edit',
+              defaultMessage: '编辑',
+            })}
+          >
             <EditOutlined />
           </Tooltip>
         </a>,
         <a onClick={() => console.log(record)}>
-          <Tooltip title="启动">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.ruleEngine.option.start',
+              defaultMessage: '启动',
+            })}
+          >
             <CaretRightOutlined />
           </Tooltip>
         </a>,
         <a onClick={() => console.log(record)}>
-          <Tooltip title="启动">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.ruleEngine.option.stop',
+              defaultMessage: '停止',
+            })}
+          >
             <StopOutlined />
           </Tooltip>
         </a>,
         <a onClick={() => console.log(record)}>
-          <Tooltip title="执行">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.ruleEngine.option.restart',
+              defaultMessage: '重启',
+            })}
+          >
             <ReloadOutlined />
           </Tooltip>
         </a>,
 
         <a>
-          <Tooltip title="删除">
+          <Tooltip
+            title={intl.formatMessage({
+              id: 'pages.data.option.remove',
+              defaultMessage: '删除',
+            })}
+          >
             <MinusOutlined />
           </Tooltip>
         </a>,