Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
知鸟1号
ant-design-pro
提交
cadae90a
A
ant-design-pro
项目概览
知鸟1号
/
ant-design-pro
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design-pro
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
cadae90a
编写于
11月 24, 2020
作者:
K
kevinadhiguna
提交者:
GitHub
11月 24, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add English translation for Search Table screen (#7600)
上级
5047f7ed
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
121 addition
and
21 deletion
+121
-21
src/locales/en-US/pages.ts
src/locales/en-US/pages.ts
+21
-0
src/locales/zh-CN/pages.ts
src/locales/zh-CN/pages.ts
+21
-0
src/pages/ListTableList/index.tsx
src/pages/ListTableList/index.tsx
+79
-21
未找到文件。
src/locales/en-US/pages.ts
浏览文件 @
cadae90a
...
...
@@ -44,4 +44,25 @@ export default {
'
pages.searchTable.updateForm.schedulingPeriod.title
'
:
'
Set Scheduling Period
'
,
'
pages.searchTable.updateForm.schedulingPeriod.timeLabel
'
:
'
Starting Time
'
,
'
pages.searchTable.updateForm.schedulingPeriod.timeRules
'
:
'
Please choose a start time!
'
,
'
pages.searchTable.titleDesc
'
:
'
Description
'
,
'
pages.searchTable.ruleName
'
:
'
Rule name is required
'
,
'
pages.searchTable.titleCallNo
'
:
'
Number of Service Calls
'
,
'
pages.searchTable.titleStatus
'
:
'
Status
'
,
'
pages.searchTable.nameStatus.default
'
:
'
default
'
,
'
pages.searchTable.nameStatus.running
'
:
'
running
'
,
'
pages.searchTable.nameStatus.online
'
:
'
online
'
,
'
pages.searchTable.nameStatus.abnormal
'
:
'
abnormal
'
,
'
pages.searchTable.titleUpdatedAt
'
:
'
Last Scheduled at
'
,
'
pages.searchTable.exception
'
:
'
Please enter the reason for the exception!
'
,
'
pages.searchTable.titleOption
'
:
'
Option
'
,
'
pages.searchTable.config
'
:
'
Configuration
'
,
'
pages.searchTable.subscribeAlert
'
:
'
Subscribe to alerts
'
,
'
pages.searchTable.title
'
:
'
Enquiry Form
'
,
'
pages.searchTable.new
'
:
'
New
'
,
'
pages.searchTable.chosen
'
:
'
chosen
'
,
'
pages.searchTable.item
'
:
'
item
'
,
'
pages.searchTable.totalServiceCalls
'
:
'
Total Number of Service Calls
'
,
'
pages.searchTable.tenThousand
'
:
'
0000
'
,
'
pages.searchTable.batchDeletion
'
:
'
bacth deletion
'
,
'
pages.searchTable.batchApproval
'
:
'
batch approval
'
,
};
src/locales/zh-CN/pages.ts
浏览文件 @
cadae90a
...
...
@@ -41,4 +41,25 @@ export default {
'
pages.searchTable.updateForm.schedulingPeriod.title
'
:
'
设定调度周期
'
,
'
pages.searchTable.updateForm.schedulingPeriod.timeLabel
'
:
'
开始时间
'
,
'
pages.searchTable.updateForm.schedulingPeriod.timeRules
'
:
'
请选择开始时间!
'
,
'
pages.searchTable.titleDesc
'
:
'
描述
'
,
'
pages.searchTable.ruleName
'
:
'
规则名称为必填项
'
,
'
pages.searchTable.titleCallNo
'
:
'
服务调用次数
'
,
'
pages.searchTable.titleStatus
'
:
'
状态
'
,
'
pages.searchTable.nameStatus.default
'
:
'
关闭
'
,
'
pages.searchTable.nameStatus.running
'
:
'
运行中
'
,
'
pages.searchTable.nameStatus.online
'
:
'
已上线
'
,
'
pages.searchTable.nameStatus.abnormal
'
:
'
异常
'
,
'
pages.searchTable.titleUpdatedAt
'
:
'
上次调度时间
'
,
'
pages.searchTable.exception
'
:
'
请输入异常原因!
'
,
'
pages.searchTable.titleOption
'
:
'
操作
'
,
'
pages.searchTable.config
'
:
'
配置
'
,
'
pages.searchTable.subscribeAlert
'
:
'
订阅警报
'
,
'
pages.searchTable.title
'
:
'
查询表格
'
,
'
pages.searchTable.new
'
:
'
新建
'
,
'
pages.searchTable.chosen
'
:
'
已选择
'
,
'
pages.searchTable.item
'
:
'
项
'
,
'
pages.searchTable.totalServiceCalls
'
:
'
服务调用次数总计
'
,
'
pages.searchTable.tenThousand
'
:
'
万
'
,
'
pages.searchTable.batchDeletion
'
:
'
批量删除
'
,
'
pages.searchTable.batchApproval
'
:
'
批量审批
'
,
};
src/pages/ListTableList/index.tsx
浏览文件 @
cadae90a
import
{
PlusOutlined
}
from
'
@ant-design/icons
'
;
import
{
Button
,
Divider
,
message
,
Input
,
Drawer
}
from
'
antd
'
;
import
React
,
{
useState
,
useRef
}
from
'
react
'
;
import
{
useIntl
,
FormattedMessage
}
from
'
umi
'
;
import
{
PageContainer
,
FooterToolbar
}
from
'
@ant-design/pro-layout
'
;
import
ProTable
,
{
ProColumns
,
ActionType
}
from
'
@ant-design/pro-table
'
;
import
ProDescriptions
from
'
@ant-design/pro-descriptions
'
;
...
...
@@ -78,16 +79,24 @@ const TableList: React.FC<{}> = () => {
const
actionRef
=
useRef
<
ActionType
>
();
const
[
row
,
setRow
]
=
useState
<
TableListItem
>
();
const
[
selectedRowsState
,
setSelectedRows
]
=
useState
<
TableListItem
[]
>
([]);
const
intl
=
useIntl
();
const
columns
:
ProColumns
<
TableListItem
>
[]
=
[
{
title
:
'
规则名称
'
,
title
:
(
<
FormattedMessage
id
=
"pages.searchTable.updateForm.ruleName.nameLabel"
defaultMessage
=
"规则名称"
/>
),
dataIndex
:
'
name
'
,
tip
:
'
规则名称是唯一的 key
'
,
formItemProps
:
{
rules
:
[
{
required
:
true
,
message
:
'
规则名称为必填项
'
,
message
:
(
<
FormattedMessage
id
=
"pages.searchTable.ruleName"
defaultMessage
=
"规则名称为必填项"
/>
),
},
],
},
...
...
@@ -96,30 +105,56 @@ const TableList: React.FC<{}> = () => {
},
},
{
title
:
'
描述
'
,
title
:
<
FormattedMessage
id
=
"pages.searchTable.titleDesc"
defaultMessage
=
"描述"
/>
,
dataIndex
:
'
desc
'
,
valueType
:
'
textarea
'
,
},
{
title
:
'
服务调用次数
'
,
title
:
<
FormattedMessage
id
=
"pages.searchTable.titleCallNo"
defaultMessage
=
"服务调用次数"
/>
,
dataIndex
:
'
callNo
'
,
sorter
:
true
,
hideInForm
:
true
,
renderText
:
(
val
:
string
)
=>
`
${
val
}
万`
,
renderText
:
(
val
:
string
)
=>
`
${
val
}${
intl
.
formatMessage
({
id
:
'
pages.searchTable.tenThousand
'
,
defaultMessage
:
'
万
'
,
})}
`
,
},
{
title
:
'
状态
'
,
title
:
<
FormattedMessage
id
=
"pages.searchTable.titleStatus"
defaultMessage
=
"状态"
/>
,
dataIndex
:
'
status
'
,
hideInForm
:
true
,
valueEnum
:
{
0
:
{
text
:
'
关闭
'
,
status
:
'
Default
'
},
1
:
{
text
:
'
运行中
'
,
status
:
'
Processing
'
},
2
:
{
text
:
'
已上线
'
,
status
:
'
Success
'
},
3
:
{
text
:
'
异常
'
,
status
:
'
Error
'
},
0
:
{
text
:
(
<
FormattedMessage
id
=
"pages.searchTable.nameStatus.default"
defaultMessage
=
"关闭"
/>
),
status
:
'
Default
'
,
},
1
:
{
text
:
(
<
FormattedMessage
id
=
"pages.searchTable.nameStatus.running"
defaultMessage
=
"运行中"
/>
),
status
:
'
Processing
'
,
},
2
:
{
text
:
(
<
FormattedMessage
id
=
"pages.searchTable.nameStatus.online"
defaultMessage
=
"已上线"
/>
),
status
:
'
Success
'
,
},
3
:
{
text
:
(
<
FormattedMessage
id
=
"pages.searchTable.nameStatus.abnormal"
defaultMessage
=
"异常"
/>
),
status
:
'
Error
'
,
},
},
},
{
title
:
'
上次调度时间
'
,
title
:
(
<
FormattedMessage
id
=
"pages.searchTable.titleUpdatedAt"
defaultMessage
=
"上次调度时间"
/>
),
dataIndex
:
'
updatedAt
'
,
sorter
:
true
,
valueType
:
'
dateTime
'
,
...
...
@@ -130,13 +165,21 @@ const TableList: React.FC<{}> = () => {
return
false
;
}
if
(
`
${
status
}
`
===
'
3
'
)
{
return
<
Input
{
...
rest
}
placeholder
=
"请输入异常原因!"
/>;
return
(
<
Input
{
...
rest
}
placeholder
=
{
intl
.
formatMessage
({
id
:
'
pages.searchTable.exception
'
,
defaultMessage
:
'
请输入异常原因!
'
,
})
}
/>
);
}
return
defaultRender
(
item
);
},
},
{
title
:
'
操作
'
,
title
:
<
FormattedMessage
id
=
"pages.searchTable.titleOption"
defaultMessage
=
"操作"
/>
,
dataIndex
:
'
option
'
,
valueType
:
'
option
'
,
render
:
(
_
,
record
)
=>
(
...
...
@@ -147,10 +190,12 @@ const TableList: React.FC<{}> = () => {
setStepFormValues
(
record
);
}
}
>
配置
<
FormattedMessage
id
=
"pages.searchTable.config"
defaultMessage
=
"配置"
/>
</
a
>
<
Divider
type
=
"vertical"
/>
<
a
href
=
""
>
订阅警报
</
a
>
<
a
href
=
""
>
<
FormattedMessage
id
=
"pages.searchTable.subscribeAlert"
defaultMessage
=
"订阅警报"
/>
</
a
>
</>
),
},
...
...
@@ -159,7 +204,10 @@ const TableList: React.FC<{}> = () => {
return
(
<
PageContainer
>
<
ProTable
<
TableListItem
>
headerTitle="查询表格"
headerTitle=
{
intl
.
formatMessage
({
id
:
'
pages.searchTable.title
'
,
defaultMessage
:
'
查询表格
'
,
})
}
actionRef=
{
actionRef
}
rowKey="key"
search=
{
{
...
...
@@ -167,7 +215,7 @@ const TableList: React.FC<{}> = () => {
}
}
toolBarRender=
{
()
=>
[
<
Button
type
=
"primary"
onClick
=
{
()
=>
handleModalVisible
(
true
)
}
>
<
PlusOutlined
/>
新建
<
PlusOutlined
/>
<
FormattedMessage
id
=
"pages.searchTable.new"
defaultMessage
=
"新建"
/>
</
Button
>,
]
}
request=
{
(
params
,
sorter
,
filter
)
=>
queryRule
({
...
params
,
sorter
,
filter
})
}
...
...
@@ -180,9 +228,17 @@ const TableList: React.FC<{}> = () => {
<
FooterToolbar
extra
=
{
<
div
>
已选择
<
a
style
=
{
{
fontWeight
:
600
}
}
>
{
selectedRowsState
.
length
}
</
a
>
项
<
FormattedMessage
id
=
"pages.searchTable.chosen"
defaultMessage
=
"已选择"
/>
{
'
'
}
<
a
style
=
{
{
fontWeight
:
600
}
}
>
{
selectedRowsState
.
length
}
</
a
>
{
'
'
}
<
FormattedMessage
id
=
"pages.searchTable.item"
defaultMessage
=
"项"
/>
<
span
>
服务调用次数总计
{
selectedRowsState
.
reduce
((
pre
,
item
)
=>
pre
+
item
.
callNo
,
0
)
}
万
<
FormattedMessage
id
=
"pages.searchTable.totalServiceCalls"
defaultMessage
=
"服务调用次数总计"
/>
{
'
'
}
{
selectedRowsState
.
reduce
((
pre
,
item
)
=>
pre
+
item
.
callNo
,
0
)
}{
'
'
}
<
FormattedMessage
id
=
"pages.searchTable.tenThousand"
defaultMessage
=
"万"
/>
</
span
>
</
div
>
}
...
...
@@ -194,9 +250,11 @@ const TableList: React.FC<{}> = () => {
actionRef
.
current
?.
reloadAndRest
?.();
}
}
>
批量删除
<
FormattedMessage
id
=
"pages.searchTable.batchDeletion"
defaultMessage
=
"批量删除"
/>
</
Button
>
<
Button
type
=
"primary"
>
<
FormattedMessage
id
=
"pages.searchTable.batchApproval"
defaultMessage
=
"批量审批"
/>
</
Button
>
<
Button
type
=
"primary"
>
批量审批
</
Button
>
</
FooterToolbar
>
)
}
<
CreateForm
onCancel
=
{
()
=>
handleModalVisible
(
false
)
}
modalVisible
=
{
createModalVisible
}
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录