|
@@ -0,0 +1,105 @@
|
|
1
|
+import React from 'react';
|
|
2
|
+import { Button, Row, Col, Card, List, Popconfirm, Tree, Space, Modal } from 'antd';
|
|
3
|
+
|
|
4
|
+export default (props) => {
|
|
5
|
+ const data = [
|
|
6
|
+ 'Racing car sprays burning fuel into crowd.',
|
|
7
|
+ 'Japanese princess to wed commoner.',
|
|
8
|
+ 'Australian walks 100km after outback crash.',
|
|
9
|
+ 'Man charged over missing wedding girl.',
|
|
10
|
+ 'Los Angeles battles huge wildfires.',
|
|
11
|
+ ];
|
|
12
|
+
|
|
13
|
+ const treeData = [
|
|
14
|
+ {
|
|
15
|
+ title: 'parent 1',
|
|
16
|
+ key: '0-0',
|
|
17
|
+ children: [
|
|
18
|
+ {
|
|
19
|
+ title: 'parent 1-0',
|
|
20
|
+ key: '0-0-0',
|
|
21
|
+ disabled: true,
|
|
22
|
+ children: [
|
|
23
|
+ {
|
|
24
|
+ title: 'leaf',
|
|
25
|
+ key: '0-0-0-0',
|
|
26
|
+ disableCheckbox: true,
|
|
27
|
+ },
|
|
28
|
+ {
|
|
29
|
+ title: 'leaf',
|
|
30
|
+ key: '0-0-0-1',
|
|
31
|
+ },
|
|
32
|
+ ],
|
|
33
|
+ },
|
|
34
|
+ {
|
|
35
|
+ title: 'parent 1-1',
|
|
36
|
+ key: '0-0-1',
|
|
37
|
+ children: [
|
|
38
|
+ {
|
|
39
|
+ title: (
|
|
40
|
+ <span
|
|
41
|
+ style={{
|
|
42
|
+ color: '#1890ff',
|
|
43
|
+ }}
|
|
44
|
+ >
|
|
45
|
+ sss
|
|
46
|
+ </span>
|
|
47
|
+ ),
|
|
48
|
+ key: '0-0-1-0',
|
|
49
|
+ },
|
|
50
|
+ ],
|
|
51
|
+ },
|
|
52
|
+ ],
|
|
53
|
+ },
|
|
54
|
+ ];
|
|
55
|
+
|
|
56
|
+ const onSelect = (selectedKeys, info) => {
|
|
57
|
+ console.log('selected', selectedKeys, info);
|
|
58
|
+ };
|
|
59
|
+ const onCheck = (checkedKeys, info) => {
|
|
60
|
+ console.log('onCheck', checkedKeys, info);
|
|
61
|
+ };
|
|
62
|
+
|
|
63
|
+ return (
|
|
64
|
+ <div>
|
|
65
|
+ <Row gutter={24}>
|
|
66
|
+ <Col span={8}>
|
|
67
|
+ <List
|
|
68
|
+ header='角色列表'
|
|
69
|
+ style={{ background: '#fff' }}
|
|
70
|
+ bordered
|
|
71
|
+ dataSource={data}
|
|
72
|
+ renderItem={item => (
|
|
73
|
+ <List.Item
|
|
74
|
+ style={{ width: '100%' }}
|
|
75
|
+ actions={[
|
|
76
|
+ <Button key='edit' type='link' onClick={() => onEdit(item)}>编辑</Button>,
|
|
77
|
+ <Popconfirm key='delete' title="确认删除?" onConfirm={() => onDelete(item)}>
|
|
78
|
+ <Button type='link' danger>删除</Button>
|
|
79
|
+ </Popconfirm>
|
|
80
|
+ ]}
|
|
81
|
+ >
|
|
82
|
+ <div onClick={() => setCurrent(item)}>
|
|
83
|
+ {item}
|
|
84
|
+ </div>
|
|
85
|
+ </List.Item>
|
|
86
|
+ )}
|
|
87
|
+ />
|
|
88
|
+ </Col>
|
|
89
|
+ <Col span={16}>
|
|
90
|
+ <Card title='授权菜单' extra={<Button type='primary' ghost>保存</Button>}>
|
|
91
|
+ <Tree
|
|
92
|
+ checkable
|
|
93
|
+ defaultExpandedKeys={['0-0-0', '0-0-1']}
|
|
94
|
+ defaultSelectedKeys={['0-0-0', '0-0-1']}
|
|
95
|
+ defaultCheckedKeys={['0-0-0', '0-0-1']}
|
|
96
|
+ onSelect={onSelect}
|
|
97
|
+ onCheck={onCheck}
|
|
98
|
+ treeData={treeData}
|
|
99
|
+ />
|
|
100
|
+ </Card>
|
|
101
|
+ </Col>
|
|
102
|
+ </Row>
|
|
103
|
+ </div>
|
|
104
|
+ )
|
|
105
|
+}
|