Просмотр исходного кода

locale(notice): translate notice

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

+ 13 - 13
src/pages/device/Category/index.tsx

@@ -16,8 +16,8 @@ const Category = () => {
   const intl = useIntl();
   const columns: ProColumns<CategoryItem>[] = [
     {
-      title:intl.formatMessage({
-        id:  'pages.device.category.id',
+      title: intl.formatMessage({
+        id: 'pages.device.category.id',
         defaultMessage: '分类ID',
       }),
       align: 'left',
@@ -26,7 +26,7 @@ const Category = () => {
     },
     {
       title: intl.formatMessage({
-        id:  'pages.device.category.logotype',
+        id: 'pages.device.category.logotype',
         defaultMessage: '标识',
       }),
       align: 'left',
@@ -34,7 +34,7 @@ const Category = () => {
     },
     {
       title: intl.formatMessage({
-        id:  'pages.device.category.name',
+        id: 'pages.device.category.name',
         defaultMessage: '分类名称',
       }),
       dataIndex: 'name',
@@ -42,7 +42,7 @@ const Category = () => {
     },
     {
       title: intl.formatMessage({
-        id:  'pages.table.description',
+        id: 'pages.table.description',
         defaultMessage: '说明',
       }),
       dataIndex: 'description',
@@ -52,9 +52,9 @@ const Category = () => {
     },
     {
       title: intl.formatMessage({
-          id: 'pages.data.option',
-          defaultMessage: '操作',
-        }),
+        id: 'pages.data.option',
+        defaultMessage: '操作',
+      }),
       valueType: 'option',
       align: 'center',
       render: (text, record) => [
@@ -102,8 +102,8 @@ const Category = () => {
         name: 'id',
       },
       name: {
-        title:intl.formatMessage({
-          id:  'pages.table.name',
+        title: intl.formatMessage({
+          id: 'pages.table.name',
           defaultMessage: '名称',
         }),
         'x-decorator': 'FormItem',
@@ -113,7 +113,7 @@ const Category = () => {
       },
       key: {
         title: intl.formatMessage({
-          id:  'pages.device.category.logotype',
+          id: 'pages.device.category.logotype',
           defaultMessage: '标识',
         }),
         'x-decorator': 'FormItem',
@@ -124,7 +124,7 @@ const Category = () => {
       description: {
         type: 'string',
         title: intl.formatMessage({
-          id:  'pages.table.describe',
+          id: 'pages.table.describe',
           defaultMessage: '描述信息',
         }),
         'x-decorator': 'FormItem',
@@ -157,7 +157,7 @@ const Category = () => {
         pagination={false}
         columns={columns}
         service={service}
-        title= {intl.formatMessage({
+        title={intl.formatMessage({
           id: 'pages.device.category',
           defaultMessage: '产品分类',
         })}

+ 22 - 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>[] = [
@@ -25,18 +27,30 @@ const Config = () => {
     },
     {
       dataIndex: 'name',
-      title: '名称',
+      title: intl.formatMessage({
+        id: 'pages.table.name',
+        defaultMessage: '名称',
+      }),
     },
     {
       dataIndex: 'type',
-      title: '通知类型',
+      title: intl.formatMessage({
+        id: 'pages.notice.config.type',
+        defaultMessage: '通知类型',
+      }),
     },
     {
       dataIndex: 'provider',
-      title: '服务商',
+      title: intl.formatMessage({
+        id: 'pages.notice.config.service',
+        defaultMessage: '服务商',
+      }),
     },
     {
-      title: '操作',
+      title: intl.formatMessage({
+        id: 'pages.data.option',
+        defaultMessage: '操作',
+      }),
       valueType: 'option',
       align: 'center',
       width: 200,
@@ -77,7 +91,10 @@ const Config = () => {
       <BaseCrud
         columns={columns}
         service={service}
-        title="通知配置"
+        title={intl.formatMessage({
+          id: 'pages.notice.config',
+          defaultMessage: '通知配置',
+        })}
         schema={schema}
         actionRef={actionRef}
       />

+ 22 - 5
src/pages/notice/Template/index.tsx

@@ -5,9 +5,11 @@ import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import BaseCrud from '@/components/BaseCrud';
 import { ArrowDownOutlined, BugOutlined, EditOutlined, MinusOutlined } from '@ant-design/icons';
 import { Tooltip } from 'antd';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 export const service = new BaseService<TemplateItem>('notifier/template');
 const Template = () => {
+  const intl = useIntl();
   const actionRef = useRef<ActionType>();
 
   const columns: ProColumns<TemplateItem>[] = [
@@ -18,18 +20,30 @@ const Template = () => {
     },
     {
       dataIndex: 'name',
-      title: '名称',
+      title: intl.formatMessage({
+        id: 'pages.table.name',
+        defaultMessage: '名称',
+      }),
     },
     {
       dataIndex: 'type',
-      title: '通知类型',
+      title: intl.formatMessage({
+        id: 'pages.notice.config.type',
+        defaultMessage: '通知类型',
+      }),
     },
     {
       dataIndex: 'provider',
-      title: '服务商',
+      title: intl.formatMessage({
+        id: 'pages.notice.config.service',
+        defaultMessage: '服务商',
+      }),
     },
     {
-      title: '操作',
+      title: intl.formatMessage({
+        id: 'pages.data.option',
+        defaultMessage: '操作',
+      }),
       valueType: 'option',
       align: 'center',
       width: 200,
@@ -64,7 +78,10 @@ const Template = () => {
       <BaseCrud
         columns={columns}
         service={service}
-        title="通知模版"
+        title={intl.formatMessage({
+          id: 'pages.notice.template',
+          defaultMessage: '通知模板',
+        })}
         schema={schema}
         actionRef={actionRef}
       />