diff --git a/src/menu.js b/src/menu.js index e340591..1985d35 100644 --- a/src/menu.js +++ b/src/menu.js @@ -14,6 +14,10 @@ module.exports = [ name: '菜单一', icon: 'user', child: [ + { + key: 'list', + name: '数据列表', + }, { key: 'option1', name: '模拟CRUD', diff --git a/src/view/data/list.jsx b/src/view/data/list.jsx index c5cbb4b..8699184 100644 --- a/src/view/data/list.jsx +++ b/src/view/data/list.jsx @@ -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 ( -
- ); - } +