mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-30 22:13:45 +00:00
list page
This commit is contained in:
@@ -14,6 +14,10 @@ module.exports = [
|
||||
name: '菜单一',
|
||||
icon: 'user',
|
||||
child: [
|
||||
{
|
||||
key: 'list',
|
||||
name: '数据列表',
|
||||
},
|
||||
{
|
||||
key: 'option1',
|
||||
name: '模拟CRUD',
|
||||
|
||||
+41
-7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user