userGroupManagement.jsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import React from 'react';
  2. import { Table, Button } from 'antd'
  3. const columns = [{
  4. title: '用户组名',
  5. dataIndex: 'userGroupName',
  6. }, {
  7. title: '创建时间',
  8. dataIndex: 'createTime'
  9. }, {
  10. title: '创建人',
  11. dataIndex: 'createBy'
  12. }, {
  13. title: '描述',
  14. dataIndex: 'description'
  15. }, {
  16. title: '操作',
  17. dataIndex: 'operation',
  18. render: () => { return <span>查看组成员 删除用户组</span>}
  19. }];
  20. const data = [{
  21. key: 1,
  22. userGroupName: 'UAS开发组',
  23. createTime: '2018-08-21',
  24. createBy: 'xiaoct',
  25. description: '就是UAS开发组啦!'
  26. }]
  27. class UserGroupManagement extends React.Component {
  28. constructor(props) {
  29. super(props);
  30. this.state = {
  31. selectedRowKeys: []
  32. }
  33. }
  34. onSelectChange = (selectedRowKeys) => {
  35. console.log('selectedRowKeys changed: ', selectedRowKeys);
  36. this.setState({ selectedRowKeys });
  37. }
  38. render() {
  39. const { selectedRowKeys } = this.state;
  40. const rowSelection = {
  41. selectedRowKeys,
  42. onChange: this.onSelectChange,
  43. };
  44. const hasSelected = selectedRowKeys.length > 0;
  45. return (
  46. <div>
  47. <Table rowSelection={rowSelection} columns={columns} dataSource={data}/>
  48. </div>
  49. );
  50. }
  51. }
  52. export default UserGroupManagement