1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
| import { BasicColumn } from '@/components/Table';
|
| export const columns: BasicColumn[] = [
| {
| title: 'ID',
| dataIndex: 'id',
| width: 80,
| },
| {
| title: '姓名',
| dataIndex: 'name',
| width: 120,
| },
| {
| title: '年龄',
| dataIndex: 'age',
| width: 80,
| },
| {
| title: '编号',
| dataIndex: 'no',
| width: 80,
| },
| {
| title: '地址',
| dataIndex: 'address',
| },
| {
| title: '开始时间',
| dataIndex: 'beginTime',
| },
| {
| title: '结束时间',
| dataIndex: 'endTime',
| },
| ];
|
| export const data: any[] = (() => {
| const arr: any[] = [];
| for (let index = 0; index < 40; index++) {
| arr.push({
| id: `${index}`,
| name: `${index} John Brown`,
| age: `${index + 10}`,
| no: `${index}98678`,
| address: 'New York No. 1 Lake ParkNew York No. 1 Lake Park',
| beginTime: new Date().toLocaleString(),
| endTime: new Date().toLocaleString(),
| });
| }
| return arr;
| })();
|
| // ["ID", "姓名", "年龄", "编号", "地址", "开始时间", "结束时间"]
| export const arrHeader = columns.map((column) => column.title);
| // [["ID", "姓名", "年龄", "编号", "地址", "开始时间", "结束时间"],["0", "0 John Brown", "10", "098678"]]
| export const arrData = data.map((item) => {
| return Object.keys(item).map((key) => item[key]);
| });
|
|