File size: 1,108 Bytes
c9d0005
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
60
import React from 'react';
import { Button } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { ProColumnsType } from 'table-render';

export const columns: ProColumnsType = [
  {
    title: '酒店名称',
    dataIndex: 'title',
    valueType: 'text',
    width: '20%'
  },
  {
    title: '酒店地址',
    dataIndex: 'address',
    ellipsis: true,
    copyable: true,
    valueType: 'text',
    width: '25%',
  },
  {
    title: '酒店状态',
    enum: {
      open: '营业中',
      closed: '已打烊',
    },
    dataIndex: 'state',
  },
  {
    title: '酒店星级',
    dataIndex: 'labels',
    width: 90,
    valueType: 'tags'
  },
  {
    title: '酒店GMV',
    sorter: true,
    dataIndex: 'money',
    valueType: 'money',
  },
  {
    title: '成立时间',
    dataIndex: 'created_at',
    valueType: 'date',
  },
];

export const toolbarRender = (
  <>
    <Button>查看日志</Button>
    <Button>导出数据</Button>
    <Button
      type='primary'
      onClick={() => alert('table-render!')}
    >
      <PlusOutlined />
      创建
    </Button>
  </>
);