import React, { useState, useEffect } from 'react'; import { Card, Table, Pagination, Divider, ResponsiveGrid, Button, Box, Form, Input, Select, Icon, Loading } from '@alifd/next'; import styles from './index.module.scss'; const { Cell } = ResponsiveGrid; const { Option } = Select; const FormItem = Form.Item; export interface IDataSource { tableData: Array>; tableColumn: any; } const mockTableData: Array> = []; for (let i = 0; i <= 10; i += 1) { mockTableData.push({ name: `品牌营销服务设计 ${String.fromCharCode(97 + i).toUpperCase()}`, type: Math.random() > 0.5 ? '24小时页面' : 'Banner 广告A', demand: ['曾庆超', '阮小五', '公孙胜'][i % 3], interface: ['阮小二', '谢莉莉', '樊瑞'][i % 3], supplier: '博彦-李强', designer: ['李立', '曹正', '姚越洋'][i % 3], }); } const DEFAULT_DATA: IDataSource = { tableData: mockTableData, tableColumn: { name: '需求名称', type: '类型数量', demand: '需求方', interface: '接口人', supplier: '供应商接口人', designer: '设计师', }, }; interface ITableListProps { dataSource: IDataSource; } const TableList: React.FunctionComponent = (props: ITableListProps): JSX.Element => { const { dataSource = DEFAULT_DATA, } = props; const [loading, setLoading] = useState(true); const [expand, setExpand] = useState(false); useEffect(() => { setTimeout(() => { setLoading(false); }, 2000); }); const onOperation = () => { setLoading(true); }; const onPaginationChange = () => { setLoading(true); }; const toggleSeachList = () => { setExpand(!expand); }; return ( <>
} /> {expand && ( <> } /> )} 重置
({ lock: 'left' }) }} > {Object.keys(dataSource.tableColumn).map((col) => ( ))} (
)} />
200条需求
); }; export default TableList;