Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update index.tsx #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions blocks/table/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,53 @@ const TableList: React.FC<FormComponentProps> = () => {
const actionRef = useRef<ActionType>();
const columns: ProColumns<TableListItem>[] = [
{
title: '规则名称',
title: 'Rule name',
dataIndex: 'name',
},
{
title: '描述',
title: 'Description',
dataIndex: 'desc',
},
{
title: '服务调用次数',
title: 'Number of service calls',
dataIndex: 'callNo',
sorter: true,
align: 'right',
renderText: (val: string) => `${val} 万`,
},
{
title: '状态',
title: 'Status',
dataIndex: 'status',
valueEnum: {
0: { text: '关闭', status: 'Default' },
1: { text: '运行中', status: 'Processing' },
2: { text: '已上线', status: 'Success' },
3: { text: '异常', status: 'Error' },
0: { text: 'Shut down', status: 'Default' },
1: { text: 'Running', status: 'Processing' },
2: { text: 'Online', status: 'Success' },
3: { text: 'Abnormal', status: 'Error' },
},
},
{
title: '上次调度时间',
title: 'Last scheduled time',
dataIndex: 'updatedAt',
sorter: true,
valueType: 'dateTime',
},
{
title: '操作',
title: 'Operating',
dataIndex: 'option',
valueType: 'option',
render: () => (
<>
<a>配置</a>
<a>Configuration</a>
<Divider type="vertical" />
<a href="">订阅警报</a>
<a href="">Subscribe to alerts</a>
</>
),
},
];

return (
<ProTable<TableListItem>
headerTitle="查询表格"
headerTitle="Enquiry form"
actionRef={actionRef}
rowKey="key"
onChange={(_, _filter, _sorter) => {
Expand All @@ -75,7 +75,7 @@ const TableList: React.FC<FormComponentProps> = () => {
<UmiUIFlag />
</>,
<Button icon="plus" type="primary">
新建
New
</Button>,
selectedRows && selectedRows.length > 0 && (
<Dropdown
Expand All @@ -89,22 +89,22 @@ const TableList: React.FC<FormComponentProps> = () => {
}}
selectedKeys={[]}
>
<Menu.Item key="remove">批量删除</Menu.Item>
<Menu.Item key="approval">批量审批</Menu.Item>
<Menu.Item key="remove">Batch deletion</Menu.Item>
<Menu.Item key="approval">Batch approval</Menu.Item>
</Menu>
}
>
<Button>
批量操作 <Icon type="down" />
Bulk operation <Icon type="down" />
</Button>
</Dropdown>
),
]}
tableAlertRender={(selectedRowKeys, selectedRows) => (
<div>
已选择 <a style={{ fontWeight: 600 }}>{selectedRowKeys.length}</a> &nbsp;&nbsp;
Selected <a style={{ fontWeight: 600 }}>{selectedRowKeys.length}</a> item&nbsp;&nbsp;
<span>
服务调用次数总计 {selectedRows.reduce((pre, item) => pre + item.callNo, 0)} 万
Total number of service calls{selectedRows.reduce((pre, item) => pre + item.callNo, 0)} 万
</span>
</div>
)}
Expand Down