linkmanadm.js
1.35 KB
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
import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { List,Avatar } from 'antd';
import StandardTable from '../../components/StandardTable';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import styles from './linkmanadm.less';
const getValue = obj => Object.keys(obj).map(key => obj[key]).join(',');
@connect(({ schools, loading }) => ({
schools,
loading: loading.models.schools,
selectedRows: [],
}))
export default class SchList extends PureComponent {
componentDidMount(){
console.log('componentDidMount');
this.props.dispatch({
type: 'schools/fetch',
payload: {
page: 1,
pageSize : 5,
},
});
}
render(){
console.log('render()');
const { schools : {list},paginationProps,loading} = this.props;
return <div>
<List
size="large"
rowKey="id"
loading={loading}
pagination={paginationProps}
dataSource={list}
renderItem={item => (
<List.Item
actions={[<a>查看</a>]}
>
<div>{item.name}</div>
<div>{item.corp}</div>
<div>{item.createdAt}</div>
</List.Item>
)}
/>
</div>
}
}