-
Notifications
You must be signed in to change notification settings - Fork 16
/
table-list.js
252 lines (247 loc) · 7.9 KB
/
table-list.js
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
/**
*
* create by Shine Lee
*
*@flow
*/
import React, { Component } from "react";
import { Breadcrumb, consts as Widget, Grid, Button, Input, Table, Pagination } from "@lugia/lugia-web";
import {
Content,
HeaderWrap,
BreadcrumbWrap,
HeaderContentWrap,
ContentWrap,
SecContentWrap,
SearchBarWrap,
ButtonWrap,
AdvanceSearchWrap,
SearchInputWrap,
ListContentWrap,
PaginationWrap,
PaginationPositionWrap
} from './style/tableListStyle'
const {Row, Col} = Grid;
const columns = [{
title: '用户ID', dataIndex: 'nameID', width: 100,
}, {
title: '用户名', dataIndex: 'name', key:'name', width: 100,
}, {
title: '邮箱', dataIndex: 'email', key:'email', width: 200,
}, {
title: '手机号', dataIndex: 'phoneNum', key:'phoneNum', width: 200,
}, {
title: '创建时间', dataIndex: 'createTime', key:'createTime', width: 200,
}, {
title: '状态', dataIndex: 'status', key:'status', width: 200,
}];
const data = [
{ nameID: '00031', name: "李彦斌", email: '13887767283@163.com', phoneNum: '13887767283', createTime: '2013-03-12',status: '运行', key:'1' },
{ nameID: '00032', name: "张翠霞", email: '283749301@qq.com', phoneNum: '15932535355', createTime: '2013-03-14',status: '已禁用', key:'2' },
{ nameID: '00033', name: "王老五", email: '13887767283@163.com', phoneNum: '13887767283', createTime: '2013-03-12',status: '运行', key:'3' },
{ nameID: '00034', name: "李西风", email: '283749301@qq.com', phoneNum: '15932535355', createTime: '2013-03-14',status: '已禁用', key:'4' },
{ nameID: '00035', name: "李彦斌", email: '13887767283@163.com', phoneNum: '13887767283', createTime: '2013-03-12',status: '运行', key:'5' },
];
export default class TableList extends Component {
constructor(props){
super(props);
this.state = {
holdClassName: '',
unholdClassName: 'unfold'
};
this.handleHoldSearchClick = this.handleHoldSearchClick.bind(this);
this.handleUnholdSearchClick = this.handleUnholdSearchClick.bind(this);
}
render() {
const config = {
[Widget.Breadcrumb]: {
BreadcrumbWrap: {
normal: {
width: 220,
height: 22,
padding: {
left: 0,
},
margin: {
left: 14,
right: 0,
top: 20,
bottom: 20,
},
background: {
color: '#F5F5F9',
},
},
},
BreadcrumbItem: {
ItemWrap: {
normal: {
width: 120,
padding: {
left: 0,
},
margin: {},
nth0: {width: 500},
},
},
Text: {
normal: {
fontFamily: 'PingFangSC-Regular',
color: '#999',
fontSize: 16,
last: {
color: '#2A2A2A',
},
},
},
Separator: {
normal: {
color: '#666',
fontSize: 16,
margin: {
top: 6,
left: 4,
right: 3,
},
last: {
color: '#4d63ff',
},
},
},
},
},
[Widget.Input]: {
Container: {
normal: {
width: 230,
height: 32,
margin: {
right: 10
}
}
}
},
[Widget.Button]: {
Container: {
normal: {
width: 80,
margin:{
right: 10
}
}
}
},
};
return (
<Content>
{/*页头*/}
<HeaderWrap>
<BreadcrumbWrap>
<Breadcrumb separator={'>'} lastSeparator={''} theme={config}>
<Breadcrumb.Item href="a">首页</Breadcrumb.Item>
<Breadcrumb.Item href="b">列表页</Breadcrumb.Item>
<Breadcrumb.Item href="c">基础查询表格</Breadcrumb.Item>
</Breadcrumb>
</BreadcrumbWrap>
<HeaderContentWrap>
<p className={'headerTitle'}>基础查询表格</p>
<p>常用于对单项大数据表格的查看和查询</p>
</HeaderContentWrap>
</HeaderWrap>
{/*内容*/}
<ContentWrap>
<SecContentWrap>
<SearchBarWrap className={this.state.holdClassName}>
<label>查询名称: </label>
<Input placeholder="请输入要查询表格的名称" theme={config}/>
<ButtonWrap>
<Button type="primary" theme={config}>搜索</Button>
</ButtonWrap>
<AdvanceSearchWrap onClick = {this.handleHoldSearchClick}>
<a>高级搜索 <span><</span></a>
</AdvanceSearchWrap>
</SearchBarWrap>
<SearchBarWrap className={this.state.unholdClassName}>
<Row
gutter={{ xs: 8, sm: 16, md: 24, lg: 24, xl: 24, xxl: 24 }}
type="flex"
justify="spaceBetween"
align="middle"
>
<Col span={8}>
<SearchInputWrap>
<label>查询名称: </label>
<Input placeholder="请输入要查询表格的名称" theme={config}/>
</SearchInputWrap>
</Col>
<Col span={8}>
<SearchInputWrap>
<label>查询名称: </label>
<Input placeholder="请输入要查询表格的名称" theme={config}/>
</SearchInputWrap>
</Col>
<Col span={8}>
<SearchInputWrap>
<label>查询名称: </label>
<Input placeholder="请输入要查询表格的名称" theme={config}/>
</SearchInputWrap>
</Col>
</Row>
<Row
gutter={{ xs: 8, sm: 16, md: 24, lg: 24, xl: 24, xxl: 24 }}
type="flex"
justify="spaceBetween"
align="middle"
>
<Col span={8}>
<SearchInputWrap>
<label>查询名称: </label>
<Input placeholder="请输入要查询表格的名称" theme={config}/>
</SearchInputWrap>
</Col>
<Col span={8}>
<SearchInputWrap>
<label>查询名称: </label>
<Input placeholder="请输入要查询表格的名称" theme={config}/>
</SearchInputWrap>
</Col>
<Col span={8}>
<SearchInputWrap>
<label>查询名称: </label>
<Input placeholder="请输入要查询表格的名称" theme={config}/>
</SearchInputWrap>
</Col>
</Row>
<ButtonWrap>
<Button type="primary" theme={config}>搜索</Button>
</ButtonWrap>
<AdvanceSearchWrap onClick={this.handleUnholdSearchClick}>
<a>收起 <span>></span></a>
</AdvanceSearchWrap>
</SearchBarWrap>
<ListContentWrap>
<Table columns={columns} data={data} tableStyle="linear"/>
</ListContentWrap>
<PaginationWrap>
<PaginationPositionWrap>
<Pagination showQuickJumper defaultCurrent={1} total={300} theme={config}/>
</PaginationPositionWrap>
</PaginationWrap>
</SecContentWrap>
</ContentWrap>
</Content>
)
}
handleHoldSearchClick(){
this.setState(() => ({
holdClassName: 'fold',
unholdClassName: ''
}))
}
handleUnholdSearchClick(){
this.setState(() => ({
holdClassName: '',
unholdClassName: 'unfold'
}))
}
}