|
|
@@ -56,14 +56,18 @@ const Widget = () => {
|
|
|
<ProTable<IItem>
|
|
|
columns={[
|
|
|
{
|
|
|
- title: intl.formatMessage({ id: "dict.fields.sn.label" }),
|
|
|
+ title: intl.formatMessage({
|
|
|
+ id: "dict.fields.sn.label",
|
|
|
+ }),
|
|
|
dataIndex: "id",
|
|
|
key: "id",
|
|
|
width: 50,
|
|
|
search: false,
|
|
|
},
|
|
|
{
|
|
|
- title: intl.formatMessage({ id: "forms.fields.title.label" }),
|
|
|
+ title: intl.formatMessage({
|
|
|
+ id: "forms.fields.title.label",
|
|
|
+ }),
|
|
|
dataIndex: "title",
|
|
|
key: "title",
|
|
|
tip: "过长会自动收缩",
|
|
|
@@ -80,7 +84,9 @@ const Widget = () => {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: intl.formatMessage({ id: "forms.fields.power.label" }),
|
|
|
+ title: intl.formatMessage({
|
|
|
+ id: "forms.fields.power.label",
|
|
|
+ }),
|
|
|
dataIndex: "tag",
|
|
|
key: "tag",
|
|
|
width: 100,
|
|
|
@@ -95,7 +101,9 @@ const Widget = () => {
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- title: intl.formatMessage({ id: "article.fields.article.count.label" }),
|
|
|
+ title: intl.formatMessage({
|
|
|
+ id: "article.fields.article.count.label",
|
|
|
+ }),
|
|
|
dataIndex: "articles",
|
|
|
key: "articles",
|
|
|
width: 100,
|
|
|
@@ -103,7 +111,9 @@ const Widget = () => {
|
|
|
sorter: (a, b) => a.articles - b.articles,
|
|
|
},
|
|
|
{
|
|
|
- title: intl.formatMessage({ id: "forms.fields.created-at.label" }),
|
|
|
+ title: intl.formatMessage({
|
|
|
+ id: "forms.fields.created-at.label",
|
|
|
+ }),
|
|
|
key: "created-at",
|
|
|
width: 100,
|
|
|
search: false,
|
|
|
@@ -117,8 +127,14 @@ const Widget = () => {
|
|
|
width: 120,
|
|
|
valueType: "option",
|
|
|
render: (text, row, index, action) => [
|
|
|
- <Dropdown.Button type="link" key={index} overlay={menu}>
|
|
|
- 编辑
|
|
|
+ <Dropdown.Button
|
|
|
+ type="link"
|
|
|
+ key={index}
|
|
|
+ overlay={menu}
|
|
|
+ >
|
|
|
+ {intl.formatMessage({
|
|
|
+ id: "buttons.edit",
|
|
|
+ })}
|
|
|
</Dropdown.Button>,
|
|
|
],
|
|
|
},
|
|
|
@@ -128,11 +144,19 @@ const Widget = () => {
|
|
|
// 注释该行则默认不显示下拉选项
|
|
|
selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
|
|
|
}}
|
|
|
- tableAlertRender={({ selectedRowKeys, selectedRows, onCleanSelected }) => (
|
|
|
+ tableAlertRender={({
|
|
|
+ selectedRowKeys,
|
|
|
+ selectedRows,
|
|
|
+ onCleanSelected,
|
|
|
+ }) => (
|
|
|
<Space size={24}>
|
|
|
<span>
|
|
|
已选 {selectedRowKeys.length} 项
|
|
|
- <Button type="link" style={{ marginInlineStart: 8 }} onClick={onCleanSelected}>
|
|
|
+ <Button
|
|
|
+ type="link"
|
|
|
+ style={{ marginInlineStart: 8 }}
|
|
|
+ onClick={onCleanSelected}
|
|
|
+ >
|
|
|
取消选择
|
|
|
</Button>
|
|
|
</span>
|
|
|
@@ -154,15 +178,21 @@ const Widget = () => {
|
|
|
total: 1 << 12,
|
|
|
success: true,
|
|
|
data: Array.from(Array(size).keys()).map((x) => {
|
|
|
- const id = ((params.current || 1) - 1) * size + x + 1;
|
|
|
+ const id =
|
|
|
+ ((params.current || 1) - 1) * size + x + 1;
|
|
|
|
|
|
var it: IItem = {
|
|
|
id,
|
|
|
title: `title ${id}`,
|
|
|
subtitle: `subtitle ${id}`,
|
|
|
- tag: ((Math.floor(Math.random() * 3) + 1) * 10).toString(),
|
|
|
+ tag: (
|
|
|
+ (Math.floor(Math.random() * 3) + 1) *
|
|
|
+ 10
|
|
|
+ ).toString(),
|
|
|
articles: Math.floor(Math.random() * 40),
|
|
|
- createdAt: Date.now() - Math.floor(Math.random() * 2000000000),
|
|
|
+ createdAt:
|
|
|
+ Date.now() -
|
|
|
+ Math.floor(Math.random() * 2000000000),
|
|
|
};
|
|
|
return it;
|
|
|
}),
|
|
|
@@ -179,8 +209,16 @@ const Widget = () => {
|
|
|
search: true,
|
|
|
}}
|
|
|
toolBarRender={() => [
|
|
|
- <Popover content={anthologyCreate} title="new article" placement="bottomRight">
|
|
|
- <Button key="button" icon={<PlusOutlined />} type="primary">
|
|
|
+ <Popover
|
|
|
+ content={anthologyCreate}
|
|
|
+ title="new article"
|
|
|
+ placement="bottomRight"
|
|
|
+ >
|
|
|
+ <Button
|
|
|
+ key="button"
|
|
|
+ icon={<PlusOutlined />}
|
|
|
+ type="primary"
|
|
|
+ >
|
|
|
{intl.formatMessage({ id: "buttons.create" })}
|
|
|
</Button>
|
|
|
</Popover>,
|