2022-11-09 12:28:04 +08:00
|
|
|
import React, { useState } from 'react';
|
2024-04-08 14:04:08 +08:00
|
|
|
import { ClockCircleOutlined, DownOutlined } from '@ant-design/icons';
|
2022-11-09 12:28:04 +08:00
|
|
|
import {
|
|
|
|
Anchor,
|
2024-04-08 14:04:08 +08:00
|
|
|
Badge,
|
2022-11-09 12:28:04 +08:00
|
|
|
Button,
|
|
|
|
Calendar,
|
2024-04-08 14:04:08 +08:00
|
|
|
Card,
|
|
|
|
Collapse,
|
|
|
|
DatePicker,
|
|
|
|
Dropdown,
|
|
|
|
Modal,
|
|
|
|
Slider,
|
2022-11-09 12:28:04 +08:00
|
|
|
Switch,
|
2024-04-08 14:04:08 +08:00
|
|
|
Table,
|
|
|
|
Tabs,
|
|
|
|
Timeline,
|
|
|
|
Transfer,
|
|
|
|
Tree,
|
2022-11-09 12:28:04 +08:00
|
|
|
Typography,
|
|
|
|
} from 'antd';
|
2024-09-15 18:54:20 +08:00
|
|
|
import type { TableProps, TransferProps } from 'antd';
|
|
|
|
import type { TransferKey } from 'antd/es/transfer/interface';
|
2024-04-08 14:04:08 +08:00
|
|
|
import dayjs from 'dayjs';
|
|
|
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
|
|
import difference from 'lodash/difference';
|
2022-11-09 12:28:04 +08:00
|
|
|
|
|
|
|
dayjs.extend(customParseFormat);
|
|
|
|
|
|
|
|
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.
|
|
|
|
`;
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
interface DataType {
|
|
|
|
key: string;
|
|
|
|
title: string;
|
|
|
|
description: string;
|
|
|
|
disabled: boolean;
|
2022-11-09 12:28:04 +08:00
|
|
|
}
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
interface RecordType {
|
|
|
|
key: string;
|
|
|
|
name: string;
|
|
|
|
age: number;
|
|
|
|
address: string;
|
|
|
|
}
|
2022-11-09 12:28:04 +08:00
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
interface DataTableType {
|
|
|
|
key: string;
|
|
|
|
name: string;
|
|
|
|
borrow: number;
|
|
|
|
repayment: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ExpandDataType {
|
|
|
|
key: React.Key;
|
|
|
|
date: string;
|
|
|
|
name: string;
|
|
|
|
upgradeNum: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface NestDataType {
|
|
|
|
key: React.Key;
|
|
|
|
name: string;
|
|
|
|
platform: string;
|
|
|
|
version: string;
|
|
|
|
upgradeNum: number;
|
|
|
|
creator: string;
|
|
|
|
createdAt: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface FixedDataType {
|
|
|
|
key: string;
|
|
|
|
name: string;
|
|
|
|
age: number;
|
|
|
|
address: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const mockData = Array.from({ length: 20 }).map<DataType>((_, i) => ({
|
|
|
|
key: i.toString(),
|
|
|
|
title: `content${i + 1}`,
|
|
|
|
description: `description of content${i + 1}`,
|
|
|
|
disabled: i % 3 < 1,
|
|
|
|
}));
|
|
|
|
|
|
|
|
const oriTargetKeys = mockData
|
|
|
|
.filter((item) => Number(item.key) % 3 > 1)
|
|
|
|
.map<TransferKey>((item) => item.key);
|
|
|
|
|
|
|
|
const dataSource: RecordType[] = [
|
|
|
|
{ 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: 'Sydney No. 1 Lake Park' },
|
|
|
|
{ key: '4', name: 'Jim Red', age: 32, address: 'London No. 2 Lake Park' },
|
2022-11-09 12:28:04 +08:00
|
|
|
];
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const columnsTable: TableProps<DataTableType>['columns'] = [
|
|
|
|
{ title: 'Name', dataIndex: 'name' },
|
|
|
|
{ title: 'Borrow', dataIndex: 'borrow' },
|
|
|
|
{ title: 'Repayment', dataIndex: 'repayment' },
|
2022-11-09 12:28:04 +08:00
|
|
|
];
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const summaryDataSource: DataTableType[] = [
|
|
|
|
{ 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 expandDataSource = Array.from({ length: 3 }).map<ExpandDataType>((_, i) => ({
|
|
|
|
key: i,
|
|
|
|
date: '2014-12-24 23:12:00',
|
|
|
|
name: 'This is production name',
|
|
|
|
upgradeNum: 'Upgraded: 56',
|
|
|
|
}));
|
|
|
|
|
|
|
|
const expandColumns: TableProps<ExpandDataType>['columns'] = [
|
|
|
|
{ title: 'Date', dataIndex: 'date', key: 'date' },
|
|
|
|
{ title: 'Name', dataIndex: 'name', key: 'name' },
|
2022-11-09 12:28:04 +08:00
|
|
|
{
|
2024-09-15 18:54:20 +08:00
|
|
|
title: 'Status',
|
|
|
|
key: 'state',
|
|
|
|
render: () => (
|
|
|
|
<span>
|
|
|
|
<Badge status="success" />
|
|
|
|
Finished
|
|
|
|
</span>
|
|
|
|
),
|
2022-11-09 12:28:04 +08:00
|
|
|
},
|
2024-09-15 18:54:20 +08:00
|
|
|
{ title: 'Upgrade Status', dataIndex: 'upgradeNum', key: 'upgradeNum' },
|
2022-11-09 12:28:04 +08:00
|
|
|
{
|
2024-09-15 18:54:20 +08:00
|
|
|
title: 'Action',
|
|
|
|
dataIndex: 'operation',
|
|
|
|
key: 'operation',
|
|
|
|
render: () => (
|
|
|
|
<span className="table-operation">
|
|
|
|
<a>Pause</a>
|
|
|
|
<a>Stop</a>
|
|
|
|
<Dropdown>
|
|
|
|
<a>
|
|
|
|
More <DownOutlined />
|
|
|
|
</a>
|
|
|
|
</Dropdown>
|
|
|
|
</span>
|
|
|
|
),
|
2022-11-09 12:28:04 +08:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const expandedRowRender = () => (
|
|
|
|
<Table<ExpandDataType> columns={expandColumns} dataSource={expandDataSource} pagination={false} />
|
|
|
|
);
|
2022-11-09 12:28:04 +08:00
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const columnsNest: TableProps<NestDataType>['columns'] = [
|
2022-11-09 12:28:04 +08:00
|
|
|
{ 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> },
|
|
|
|
];
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const nestDataSource = Array.from({ length: 3 }).map<NestDataType>((_, i) => ({
|
|
|
|
key: i,
|
|
|
|
name: 'Screem',
|
|
|
|
platform: 'iOS',
|
|
|
|
version: '10.3.4.5654',
|
|
|
|
upgradeNum: 500,
|
|
|
|
creator: 'Jack',
|
|
|
|
createdAt: '2014-12-24 23:12:00',
|
|
|
|
}));
|
2022-11-09 12:28:04 +08:00
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const columnsFixed: TableProps<FixedDataType>['columns'] = [
|
|
|
|
{ title: 'Full Name', width: 100, dataIndex: 'name', key: 'name', fixed: 'left' },
|
|
|
|
{ title: 'Age', width: 100, dataIndex: 'age', key: 'age', fixed: 'left' },
|
2022-11-09 12:28:04 +08:00
|
|
|
{ title: 'Column 1', dataIndex: 'address', key: '1' },
|
|
|
|
{ title: 'Column 2', dataIndex: 'address', key: '2' },
|
|
|
|
{ title: 'Column 3', dataIndex: 'address', key: '3' },
|
|
|
|
{ title: 'Column 4', dataIndex: 'address', key: '4' },
|
|
|
|
{ title: 'Column 5', dataIndex: 'address', key: '5' },
|
|
|
|
{ title: 'Column 6', dataIndex: 'address', key: '6' },
|
|
|
|
{ title: 'Column 7', dataIndex: 'address', key: '7' },
|
|
|
|
{ title: 'Column 8', dataIndex: 'address', key: '8' },
|
2024-09-15 18:54:20 +08:00
|
|
|
{ title: 'Action', key: 'operation', fixed: 'right', width: 100, render: () => <a>action</a> },
|
|
|
|
];
|
|
|
|
|
|
|
|
const fixedDataSource: FixedDataType[] = [
|
|
|
|
{ key: '1', name: 'John Brown', age: 32, address: 'New York Park' },
|
|
|
|
{ key: '2', name: 'Jim Green', age: 40, address: 'London Park' },
|
2022-11-09 12:28:04 +08:00
|
|
|
];
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const TableTransfer: React.FC<
|
|
|
|
Readonly<Partial<Record<'leftColumns' | 'rightColumns', TableProps<DataType>['columns']>>> &
|
|
|
|
TransferProps<DataType>
|
|
|
|
> = (props) => {
|
|
|
|
const { leftColumns, rightColumns, ...restProps } = props;
|
|
|
|
return (
|
|
|
|
<Transfer<DataType> {...restProps} showSelectAll={false}>
|
|
|
|
{(transferProps) => {
|
|
|
|
const {
|
|
|
|
direction,
|
|
|
|
filteredItems,
|
|
|
|
onItemSelectAll,
|
|
|
|
onItemSelect,
|
|
|
|
selectedKeys: listSelectedKeys,
|
|
|
|
disabled: listDisabled,
|
|
|
|
} = transferProps;
|
|
|
|
|
|
|
|
const columns = (direction === 'left' ? leftColumns : rightColumns) ?? [];
|
|
|
|
|
|
|
|
const rowSelection: TableProps<DataType>['rowSelection'] = {
|
|
|
|
getCheckboxProps: (item) => ({ disabled: listDisabled || item.disabled }),
|
|
|
|
onSelectAll(selected, selectedRows) {
|
|
|
|
const treeSelectedKeys = selectedRows
|
|
|
|
.filter((item) => !item.disabled)
|
|
|
|
.map(({ key }) => key);
|
|
|
|
const diffKeys = selected
|
|
|
|
? difference(treeSelectedKeys, listSelectedKeys)
|
|
|
|
: difference(listSelectedKeys, treeSelectedKeys);
|
|
|
|
onItemSelectAll(diffKeys, selected);
|
|
|
|
},
|
|
|
|
onSelect({ key }, selected) {
|
|
|
|
onItemSelect(key, selected);
|
|
|
|
},
|
|
|
|
selectedRowKeys: listSelectedKeys,
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Table<DataType>
|
|
|
|
id="components-transfer-table"
|
|
|
|
rowSelection={rowSelection}
|
|
|
|
columns={columns}
|
|
|
|
dataSource={filteredItems}
|
|
|
|
size="small"
|
|
|
|
style={{ pointerEvents: listDisabled ? 'none' : 'auto' }}
|
|
|
|
onRow={({ key, disabled: itemDisabled }) => ({
|
|
|
|
onClick: () => {
|
|
|
|
if (itemDisabled || listDisabled) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
onItemSelect(key, !listSelectedKeys.includes(key));
|
|
|
|
},
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}}
|
|
|
|
</Transfer>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
const columns: TableProps<RecordType>['columns'] = [
|
|
|
|
{
|
|
|
|
title: 'Name',
|
|
|
|
dataIndex: 'name',
|
|
|
|
key: 'name',
|
|
|
|
filters: [
|
|
|
|
{ text: 'Joe', value: 'Joe' },
|
|
|
|
{ text: 'Jim', value: 'Jim' },
|
|
|
|
],
|
|
|
|
filteredValue: null,
|
|
|
|
onFilter: (value, record) => record.name.includes(value as string),
|
|
|
|
sorter: (a, b) => a.name.length - b.name.length,
|
|
|
|
sortOrder: 'ascend',
|
|
|
|
ellipsis: true,
|
|
|
|
},
|
2022-11-09 12:28:04 +08:00
|
|
|
{
|
2024-09-15 18:54:20 +08:00
|
|
|
title: 'Age',
|
|
|
|
dataIndex: 'age',
|
|
|
|
key: 'age',
|
|
|
|
sorter: false,
|
|
|
|
sortOrder: 'ascend',
|
|
|
|
ellipsis: true,
|
2022-11-09 12:28:04 +08:00
|
|
|
},
|
|
|
|
{
|
2024-09-15 18:54:20 +08:00
|
|
|
title: 'Address',
|
|
|
|
dataIndex: 'address',
|
|
|
|
key: 'address',
|
|
|
|
filters: [
|
|
|
|
{ text: 'London', value: 'London' },
|
|
|
|
{ text: 'New York', value: 'New York' },
|
|
|
|
],
|
|
|
|
filteredValue: null,
|
|
|
|
onFilter: (value, record) => record.address.includes(value as string),
|
|
|
|
sorter: false,
|
|
|
|
sortOrder: 'ascend',
|
|
|
|
ellipsis: true,
|
2022-11-09 12:28:04 +08:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const tableTransferColumns: TableProps<DataType>['columns'] = [
|
|
|
|
{ dataIndex: 'title', title: 'Name' },
|
|
|
|
{ dataIndex: 'description', title: 'Description' },
|
|
|
|
];
|
2022-11-09 12:28:04 +08:00
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const Demo: React.FC = () => {
|
2022-11-09 12:28:04 +08:00
|
|
|
const [open, setOpen] = useState(false);
|
2024-09-15 18:54:20 +08:00
|
|
|
const [targetKeys, setTargetKeys] = useState<TransferKey[]>(oriTargetKeys);
|
|
|
|
const [selectedKeys, setSelectedKeys] = useState<TransferKey[]>([]);
|
2022-11-09 12:28:04 +08:00
|
|
|
const [disabled, setDisabled] = useState(false);
|
|
|
|
const [showSearch, setShowSearch] = useState(false);
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const handleDisable = (isDisabled: boolean) => {
|
2022-11-09 12:28:04 +08:00
|
|
|
setDisabled(isDisabled);
|
|
|
|
};
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const handleTableTransferChange = (nextTargetKeys: TransferKey[]) => {
|
2022-11-09 12:28:04 +08:00
|
|
|
setTargetKeys(nextTargetKeys);
|
|
|
|
};
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const triggerDisable = (isDisabled: boolean) => {
|
2022-11-09 12:28:04 +08:00
|
|
|
setDisabled(isDisabled);
|
|
|
|
};
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const triggerShowSearch = (isShowSearch: boolean) => {
|
2022-11-09 12:28:04 +08:00
|
|
|
setShowSearch(isShowSearch);
|
|
|
|
};
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const handleTransferChange = (keys: TransferKey[]) => {
|
|
|
|
setTargetKeys(keys);
|
2022-11-09 12:28:04 +08:00
|
|
|
};
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const handleTransferSelectChange = (
|
|
|
|
sourceSelectedKeys: TransferKey[],
|
|
|
|
targetSelectedKeys: TransferKey[],
|
|
|
|
) => {
|
2022-11-09 12:28:04 +08:00
|
|
|
setSelectedKeys([...sourceSelectedKeys, ...targetSelectedKeys]);
|
|
|
|
};
|
|
|
|
|
|
|
|
const showModal = () => {
|
|
|
|
setOpen(true);
|
|
|
|
};
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const handleOk = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
|
2022-11-09 12:28:04 +08:00
|
|
|
console.log(e);
|
|
|
|
setOpen(false);
|
|
|
|
};
|
|
|
|
|
2024-09-15 18:54:20 +08:00
|
|
|
const handleCancel = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
|
2022-11-09 12:28:04 +08:00
|
|
|
console.log(e);
|
|
|
|
setOpen(false);
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Button type="primary" onClick={showModal}>
|
|
|
|
Open Modal
|
|
|
|
</Button>
|
|
|
|
<Modal title="Basic Modal" open={open} onOk={handleOk} onCancel={handleCancel}>
|
|
|
|
<Switch
|
|
|
|
unCheckedChildren="disabled"
|
|
|
|
checkedChildren="disabled"
|
|
|
|
checked={disabled}
|
|
|
|
onChange={handleDisable}
|
|
|
|
style={{ marginBottom: 16 }}
|
|
|
|
/>
|
|
|
|
<Card title="Card Title">
|
|
|
|
<Card.Grid>Content</Card.Grid>
|
|
|
|
<Card.Grid hoverable={false}>Content</Card.Grid>
|
|
|
|
<Card.Grid>Content</Card.Grid>
|
|
|
|
<Card.Grid>Content</Card.Grid>
|
|
|
|
<Card.Grid>Content</Card.Grid>
|
|
|
|
<Card.Grid>Content</Card.Grid>
|
|
|
|
<Card.Grid>Content</Card.Grid>
|
|
|
|
</Card>
|
|
|
|
<Collapse>
|
|
|
|
<Panel header="This is panel header 1" key="1">
|
|
|
|
<Collapse defaultActiveKey="1">
|
|
|
|
<Panel header="This is panel nest panel" key="1">
|
|
|
|
<p>{text}</p>
|
|
|
|
</Panel>
|
|
|
|
</Collapse>
|
|
|
|
</Panel>
|
|
|
|
<Panel header="This is panel header 2" key="2">
|
|
|
|
<p>{text}</p>
|
|
|
|
</Panel>
|
|
|
|
<Panel header="This is panel header 3" key="3">
|
|
|
|
<p>{text}</p>
|
|
|
|
</Panel>
|
|
|
|
</Collapse>
|
2024-09-15 18:54:20 +08:00
|
|
|
<Transfer<DataType>
|
2022-11-09 12:28:04 +08:00
|
|
|
dataSource={mockData}
|
|
|
|
titles={['Source', 'Target']}
|
|
|
|
targetKeys={targetKeys}
|
|
|
|
selectedKeys={selectedKeys}
|
|
|
|
onChange={handleTransferChange}
|
|
|
|
onSelectChange={handleTransferSelectChange}
|
2022-11-19 13:47:33 +08:00
|
|
|
render={(item) => item.title}
|
2022-11-09 12:28:04 +08:00
|
|
|
disabled={disabled}
|
|
|
|
/>
|
|
|
|
<TableTransfer
|
|
|
|
dataSource={mockData}
|
|
|
|
targetKeys={targetKeys}
|
|
|
|
disabled={disabled}
|
|
|
|
showSearch={showSearch}
|
2024-09-15 18:54:20 +08:00
|
|
|
leftColumns={tableTransferColumns}
|
|
|
|
rightColumns={tableTransferColumns}
|
2022-11-09 12:28:04 +08:00
|
|
|
onChange={handleTableTransferChange}
|
2024-09-15 18:54:20 +08:00
|
|
|
filterOption={(inputValue: string, item: any) =>
|
|
|
|
item.title?.includes(inputValue) || item.tag?.includes(inputValue)
|
2022-11-09 12:28:04 +08:00
|
|
|
}
|
|
|
|
/>
|
|
|
|
<Switch
|
|
|
|
unCheckedChildren="disabled"
|
|
|
|
checkedChildren="disabled"
|
|
|
|
checked={disabled}
|
|
|
|
onChange={triggerDisable}
|
|
|
|
style={{ marginTop: 16 }}
|
|
|
|
/>
|
|
|
|
<Switch
|
|
|
|
unCheckedChildren="showSearch"
|
|
|
|
checkedChildren="showSearch"
|
|
|
|
checked={showSearch}
|
|
|
|
onChange={triggerShowSearch}
|
|
|
|
style={{ marginTop: 16 }}
|
|
|
|
/>
|
|
|
|
<Anchor>
|
2024-07-23 22:22:24 +08:00
|
|
|
<Link href="#anchor-demo-basic" title="Basic demo" />
|
|
|
|
<Link href="#anchor-demo-static" title="Static demo" />
|
2024-07-29 16:38:50 +08:00
|
|
|
<Link href="#anchor-demo-basic" title="Basic demo with Target" target="_blank" />
|
2022-11-09 12:28:04 +08:00
|
|
|
<Link href="#API" title="API">
|
|
|
|
<Link href="#Anchor-Props" title="Anchor Props" />
|
|
|
|
<Link href="#Link-Props" title="Link Props" />
|
|
|
|
</Link>
|
|
|
|
</Anchor>
|
|
|
|
<Tabs type="card">
|
|
|
|
<TabPane tab="Tab 1" key="1">
|
|
|
|
Content of Tab Pane 1
|
|
|
|
</TabPane>
|
|
|
|
<TabPane tab="Tab 2" key="2">
|
|
|
|
Content of Tab Pane 2
|
|
|
|
</TabPane>
|
|
|
|
<TabPane tab="Tab 3" key="3">
|
|
|
|
Content of Tab Pane 3
|
|
|
|
</TabPane>
|
|
|
|
</Tabs>
|
|
|
|
<Timeline>
|
|
|
|
<Timeline.Item>Create a services site 2015-09-01</Timeline.Item>
|
|
|
|
<Timeline.Item>Solve initial network problems 2015-09-01</Timeline.Item>
|
|
|
|
<Timeline.Item dot={<ClockCircleOutlined style={{ fontSize: '16px' }} />} color="red">
|
|
|
|
Technical testing 2015-09-01
|
|
|
|
</Timeline.Item>
|
|
|
|
<Timeline.Item>Network problems being solved 2015-09-01</Timeline.Item>
|
|
|
|
</Timeline>
|
|
|
|
<Calendar />
|
|
|
|
<Tree showLine switcherIcon={<DownOutlined />} defaultExpandedKeys={['0-0-0']}>
|
|
|
|
<TreeNode title="parent 1" key="0-0">
|
|
|
|
<TreeNode title="parent 1-0" key="0-0-0">
|
|
|
|
<TreeNode title="leaf" key="0-0-0-0" />
|
|
|
|
<TreeNode title="leaf" key="0-0-0-1" />
|
|
|
|
<TreeNode title="leaf" key="0-0-0-2" />
|
|
|
|
</TreeNode>
|
|
|
|
<TreeNode title="parent 1-1" key="0-0-1">
|
|
|
|
<TreeNode title="leaf" key="0-0-1-0" />
|
|
|
|
</TreeNode>
|
|
|
|
<TreeNode title="parent 1-2" key="0-0-2">
|
|
|
|
<TreeNode title="leaf" key="0-0-2-0" />
|
|
|
|
<TreeNode title="leaf" key="0-0-2-1" />
|
|
|
|
</TreeNode>
|
|
|
|
</TreeNode>
|
|
|
|
</Tree>
|
2024-09-15 18:54:20 +08:00
|
|
|
<Table<RecordType> columns={columns} dataSource={dataSource} footer={() => 'Footer'} />
|
|
|
|
<Table<DataTableType>
|
2022-11-09 12:28:04 +08:00
|
|
|
columns={columnsTable}
|
2024-09-15 18:54:20 +08:00
|
|
|
dataSource={summaryDataSource}
|
2022-11-09 12:28:04 +08:00
|
|
|
pagination={false}
|
|
|
|
id="table-demo-summary"
|
|
|
|
bordered
|
2022-11-19 13:47:33 +08:00
|
|
|
summary={(pageData) => {
|
2022-11-09 12:28:04 +08:00
|
|
|
let totalBorrow = 0;
|
|
|
|
let totalRepayment = 0;
|
|
|
|
pageData.forEach(({ borrow, repayment }) => {
|
|
|
|
totalBorrow += borrow;
|
|
|
|
totalRepayment += repayment;
|
|
|
|
});
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<tr>
|
|
|
|
<th>Total</th>
|
|
|
|
<td>
|
|
|
|
<Text type="danger">{totalBorrow}</Text>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<Text>{totalRepayment}</Text>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Balance</th>
|
|
|
|
<td colSpan={2}>
|
|
|
|
<Text type="danger">{totalBorrow - totalRepayment}</Text>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<br />
|
2024-09-15 18:54:20 +08:00
|
|
|
<Table<NestDataType>
|
|
|
|
columns={columnsNest}
|
|
|
|
expandable={{ expandedRowRender }}
|
|
|
|
dataSource={nestDataSource}
|
|
|
|
/>
|
|
|
|
<Table<FixedDataType>
|
|
|
|
columns={columnsFixed}
|
|
|
|
dataSource={fixedDataSource}
|
|
|
|
scroll={{ x: 1300, y: 100 }}
|
|
|
|
/>
|
2022-11-09 12:28:04 +08:00
|
|
|
<Card
|
|
|
|
hoverable
|
|
|
|
style={{ width: 240 }}
|
|
|
|
cover={
|
2024-09-15 18:54:20 +08:00
|
|
|
<img
|
|
|
|
draggable={false}
|
|
|
|
alt="example"
|
|
|
|
src="https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png"
|
|
|
|
/>
|
2022-11-09 12:28:04 +08:00
|
|
|
}
|
|
|
|
>
|
|
|
|
<Meta title="Europe Street beat" description="www.instagram.com" />
|
|
|
|
</Card>
|
|
|
|
<Slider defaultValue={30} />
|
|
|
|
<DatePicker defaultValue={dayjs('2015/01/01', 'YYYY/MM/DD')} format="YYYY/MM/DD" />
|
|
|
|
<Badge count={5}>
|
|
|
|
<a href="#" className="head-example" />
|
|
|
|
</Badge>
|
|
|
|
</Modal>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
2024-09-15 18:54:20 +08:00
|
|
|
|
|
|
|
export default Demo;
|