2017-07-14 19:47:12 +08:00
|
|
|
import React, { Component } from 'react'
|
2017-07-17 11:01:05 +08:00
|
|
|
//import PropTypes from 'prop-types'
|
|
|
|
import {
|
|
|
|
Table,
|
|
|
|
Button
|
|
|
|
} from 'antd'
|
|
|
|
|
2017-07-14 19:47:12 +08:00
|
|
|
|
2017-07-17 11:01:05 +08:00
|
|
|
|
|
|
|
class List extends Component {
|
2017-07-14 19:47:12 +08:00
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
super(props)
|
2017-07-17 11:01:05 +08:00
|
|
|
|
2017-07-14 19:47:12 +08:00
|
|
|
}
|
|
|
|
|
2017-07-17 11:01:05 +08:00
|
|
|
render() {
|
|
|
|
|
2017-07-14 19:47:12 +08:00
|
|
|
const columns = [{
|
2017-07-17 11:01:05 +08:00
|
|
|
title: 'UID',
|
2017-07-14 19:47:12 +08:00
|
|
|
dataIndex: 'uid',
|
|
|
|
key: 'uid'
|
|
|
|
}, {
|
|
|
|
title: '用户名',
|
|
|
|
dataIndex: 'username',
|
|
|
|
key: 'username'
|
|
|
|
}, {
|
|
|
|
title: 'email',
|
|
|
|
dataIndex: 'email',
|
|
|
|
key: 'email'
|
|
|
|
}, {
|
|
|
|
title: '更新日期',
|
|
|
|
dataIndex: 'up_time',
|
|
|
|
key: 'up_time'
|
|
|
|
}, {
|
|
|
|
title: '功能',
|
2017-07-17 11:01:05 +08:00
|
|
|
key: 'action',
|
2017-07-14 19:47:12 +08:00
|
|
|
render: () => {
|
|
|
|
return (
|
|
|
|
<span>
|
|
|
|
<Button type="primary">编辑</Button>
|
|
|
|
<Button type="danger">删除</Button>
|
|
|
|
</span>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
|
2017-07-17 11:01:05 +08:00
|
|
|
|
2017-07-14 19:47:12 +08:00
|
|
|
const data = [
|
2017-07-17 11:01:05 +08:00
|
|
|
{ uid: 1, username: 'admin', email: 'admin@admin.com', up_time: '2017.07.01', key: 1 },
|
|
|
|
{ uid: 2, username: 'admin2', email: 'admin21113qq3ß@admin311.com', up_time: '2017.07.21', key: 2 }
|
2017-07-14 19:47:12 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
return (
|
2017-07-17 11:01:05 +08:00
|
|
|
<section className="user-table">
|
|
|
|
|
2017-07-14 19:47:12 +08:00
|
|
|
<Table columns={columns} dataSource={data} />
|
2017-07-17 11:01:05 +08:00
|
|
|
|
2017-07-14 19:47:12 +08:00
|
|
|
</section>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-17 11:01:05 +08:00
|
|
|
export default List
|