You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
593 lines
16 KiB
593 lines
16 KiB
5 years ago
|
---
|
||
|
order: 10
|
||
|
title:
|
||
|
zh-CN: 暗背景
|
||
|
en-US: Dark Bg
|
||
|
debug: true
|
||
|
---
|
||
|
|
||
|
## zh-CN
|
||
|
|
||
|
第一个对话框。
|
||
|
|
||
|
## en-US
|
||
|
|
||
|
Basic modal.
|
||
|
|
||
|
```jsx
|
||
|
import { Modal, DatePicker, Slider, Tree, Badge, Collapse, Timeline, Tabs, Anchor, Table, Card, Button, Calendar, Transfer, Switch, Typography, Dropdown } from 'antd';
|
||
|
import moment from 'moment';
|
||
|
import difference from 'lodash/difference';
|
||
|
import { DownOutlined, ClockCircleOutlined } from '@ant-design/icons';
|
||
|
|
||
|
const { Panel } = Collapse;
|
||
|
const { TreeNode } = Tree;
|
||
|
const { TabPane } = Tabs;
|
||
|
const { Meta } = Card;
|
||
|
const { Link } = Anchor;
|
||
|
const { Text } = Typography;
|
||
|
|
||
|
const text = `
|
||
|
A dog is a type of domesticated animal.
|
||
|
Known for its loyalty and faithfulness,
|
||
|
it can be found as a welcome guest in many households across the world.
|
||
|
`;
|
||
|
|
||
|
const mockData = [];
|
||
|
for (let i = 0; i < 20; i++) {
|
||
|
mockData.push({
|
||
|
key: i.toString(),
|
||
|
title: `content${i + 1}`,
|
||
|
description: `description of content${i + 1}`,
|
||
|
disabled: i % 3 < 1,
|
||
|
});
|
||
|
}
|
||
|
|
||
|
const oriTargetKeys = mockData.filter(item => +item.key % 3 > 1).map(item => item.key);
|
||
|
|
||
|
const data = [
|
||
|
{
|
||
|
key: '1',
|
||
|
name: 'John Brown',
|
||
|
age: 32,
|
||
|
address: 'New York No. 1 Lake Park',
|
||
|
},
|
||
|
{
|
||
|
key: '2',
|
||
|
name: 'Jim Green',
|
||
|
age: 42,
|
||
|
address: 'London No. 1 Lake Park',
|
||
|
},
|
||
|
{
|
||
|
key: '3',
|
||
|
name: 'Joe Black',
|
||
|
age: 32,
|
||
|
address: 'Sidney No. 1 Lake Park',
|
||
|
},
|
||
|
{
|
||
|
key: '4',
|
||
|
name: 'Jim Red',
|
||
|
age: 32,
|
||
|
address: 'London No. 2 Lake Park',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
const columnsTable = [
|
||
|
{
|
||
|
title: 'Name',
|
||
|
dataIndex: 'name',
|
||
|
},
|
||
|
{
|
||
|
title: 'Borrow',
|
||
|
dataIndex: 'borrow',
|
||
|
},
|
||
|
{
|
||
|
title: 'Repayment',
|
||
|
dataIndex: 'repayment',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
const dataTable = [
|
||
|
{
|
||
|
key: '1',
|
||
|
name: 'John Brown',
|
||
|
borrow: 10,
|
||
|
repayment: 33,
|
||
|
},
|
||
|
{
|
||
|
key: '2',
|
||
|
name: 'Jim Green',
|
||
|
borrow: 100,
|
||
|
repayment: 0,
|
||
|
},
|
||
|
{
|
||
|
key: '3',
|
||
|
name: 'Joe Black',
|
||
|
borrow: 10,
|
||
|
repayment: 10,
|
||
|
},
|
||
|
{
|
||
|
key: '4',
|
||
|
name: 'Jim Red',
|
||
|
borrow: 75,
|
||
|
repayment: 45,
|
||
|
},
|
||
|
];
|
||
|
|
||
|
const expandedRowRender = () => {
|
||
|
const columnsExpand = [
|
||
|
{ title: 'Date', dataIndex: 'date', key: 'date' },
|
||
|
{ title: 'Name', dataIndex: 'name', key: 'name' },
|
||
|
{
|
||
|
title: 'Status',
|
||
|
key: 'state',
|
||
|
render: () => (
|
||
|
<span>
|
||
|
<Badge status="success" />
|
||
|
Finished
|
||
|
</span>
|
||
|
),
|
||
|
},
|
||
|
{ title: 'Upgrade Status', dataIndex: 'upgradeNum', key: 'upgradeNum' },
|
||
|
{
|
||
|
title: 'Action',
|
||
|
dataIndex: 'operation',
|
||
|
key: 'operation',
|
||
|
render: () => (
|
||
|
<span className="table-operation">
|
||
|
<a>Pause</a>
|
||
|
<a>Stop</a>
|
||
|
<Dropdown>
|
||
|
<a>
|
||
|
More <DownOutlined />
|
||
|
</a>
|
||
|
</Dropdown>
|
||
|
</span>
|
||
|
),
|
||
|
},
|
||
|
];
|
||
|
|
||
|
const dataExpand = [];
|
||
|
for (let i = 0; i < 3; ++i) {
|
||
|
data.push({
|
||
|
key: i,
|
||
|
date: '2014-12-24 23:12:00',
|
||
|
name: 'This is production name',
|
||
|
upgradeNum: 'Upgraded: 56',
|
||
|
});
|
||
|
}
|
||
|
return <Table columns={columnsExpand} dataSource={dataExpand} pagination={false} />;
|
||
|
};
|
||
|
|
||
|
const columnsNest = [
|
||
|
{ title: 'Name', dataIndex: 'name', key: 'name' },
|
||
|
{ title: 'Platform', dataIndex: 'platform', key: 'platform' },
|
||
|
{ title: 'Version', dataIndex: 'version', key: 'version' },
|
||
|
{ title: 'Upgraded', dataIndex: 'upgradeNum', key: 'upgradeNum' },
|
||
|
{ title: 'Creator', dataIndex: 'creator', key: 'creator' },
|
||
|
{ title: 'Date', dataIndex: 'createdAt', key: 'createdAt' },
|
||
|
{ title: 'Action', key: 'operation', render: () => <a>Publish</a> },
|
||
|
];
|
||
|
|
||
|
const dataNest = [];
|
||
|
for (let i = 0; i < 3; ++i) {
|
||
|
dataNest.push({
|
||
|
key: i,
|
||
|
name: 'Screem',
|
||
|
platform: 'iOS',
|
||
|
version: '10.3.4.5654',
|
||
|
upgradeNum: 500,
|
||
|
creator: 'Jack',
|
||
|
createdAt: '2014-12-24 23:12:00',
|
||
|
});
|
||
|
}
|
||
|
|
||
|
const columnsFixed = [
|
||
|
{
|
||
|
title: 'Full Name',
|
||
|
width: 100,
|
||
|
dataIndex: 'name',
|
||
|
key: 'name',
|
||
|
fixed: 'left',
|
||
|
},
|
||
|
{
|
||
|
title: 'Age',
|
||
|
width: 100,
|
||
|
dataIndex: 'age',
|
||
|
key: 'age',
|