list page

This commit is contained in:
zuiidea
2016-09-13 23:57:20 +08:00
parent 9889415034
commit eaa1f283ac
2 changed files with 45 additions and 7 deletions
+4
View File
@@ -14,6 +14,10 @@ module.exports = [
name: '菜单一',
icon: 'user',
child: [
{
key: 'list',
name: '数据列表',
},
{
key: 'option1',
name: '模拟CRUD',
+41 -7
View File
@@ -1,21 +1,55 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { ajax, config, Logger } from '../../utils/lib'
import { Icon, message, Button, Row, Col, Form, Input, Select } from 'antd'
import { Icon, message, Table, Button, Row, Col } from 'antd'
import './list.less'
const logger = Logger.getLogger('List')
let List = React.createClass({
getInitialState: function() {
getInitialState() {
return {
pager:{}
pager:{
showSizeChanger: true,
showQuickJumper: true,
showTotal: total => `共 ${total} 条`
},
data:{},
loading: false,
};
},render: function() {
},
componentDidMount() {
this.fetch()
},
fetch() {
const _this = this
this.setState({loading: true})
// Ajax({
// url: contextPath + '/talent/index',
// data: {
// ..._this.state.params
// },
// success: function (result) {
// const pager = _this.state.pager
// const params = _this.state.params
// pager.total = result.total
// _this.setState({loading: false, data: result.talentList, pager, params})
// }
// })
},
render() {
return (
<div />
);
}
<Table
bordered
columns={columns}
rowKey={record => record.id}
dataSource={this.state.data}
pagination={this.state.pager}
loading={this.state.loading}
onChange={this.handleTableChange}
size="small" />
)
},
})
module.exports = List