diff --git a/src/routes/List/TableList.js b/src/routes/List/TableList.js index 0ca42b2400f65759c8293fed3d5e416a1181748e..0f5ceda7d59568700f5b79c29b76ab8d7d85b61b 100644 --- a/src/routes/List/TableList.js +++ b/src/routes/List/TableList.js @@ -1,6 +1,6 @@ import React, { PureComponent } from 'react'; import { connect } from 'dva'; -import { Card, Form, Input, Select, Icon, Button, Dropdown, Menu, InputNumber, DatePicker, Modal, message } from 'antd'; +import { Row, Col, Card, Form, Input, Select, Icon, Button, Dropdown, Menu, InputNumber, DatePicker, Modal, message } from 'antd'; import StandardTable from '../../components/StandardTable'; import PageHeaderLayout from '../../layouts/PageHeaderLayout'; @@ -152,8 +152,120 @@ export default class TableList extends PureComponent { }); } + renderSimpleForm() { + const { getFieldDecorator } = this.props.form; + return ( +
+ + + + {getFieldDecorator('no')( + + )} + + + + + {getFieldDecorator('status')( + + )} + + + + + + + + 展开 + + + + +
+ ); + } + + renderAdvancedForm() { + const { getFieldDecorator } = this.props.form; + return ( +
+ + + + {getFieldDecorator('no')( + + )} + + + + + {getFieldDecorator('status')( + + )} + + + + + {getFieldDecorator('number')( + + )} + + + + + + + {getFieldDecorator('date')( + + )} + + + + + {getFieldDecorator('status3')( + + )} + + + + + {getFieldDecorator('status4')( + + )} + + + +
+ + + + + 收起 + + +
+
+ ); + } + + renderForm() { + return this.state.expandForm ? this.renderAdvancedForm() : this.renderSimpleForm(); + } + render() { - const { rule: { loading: ruleLoading, data }, form: { getFieldDecorator } } = this.props; + const { rule: { loading: ruleLoading, data } } = this.props; const { selectedRows, modalVisible, addInputValue } = this.state; const menu = ( @@ -168,50 +280,7 @@ export default class TableList extends PureComponent {
-
-
- - {getFieldDecorator('no')( - - )} - - - {getFieldDecorator('status')( - - )} - - - - - - {this.state.expandForm ? '收起' : '展开'} - - -
- { - this.state.expandForm && ( -
- - {getFieldDecorator('updatedAt')( - - )} - - - {getFieldDecorator('callNo')( - } - placeholder="请输入" - style={{ width: 272 }} - /> - )} - -
- ) - } -
+ {this.renderForm()}
diff --git a/src/routes/List/TableList.less b/src/routes/List/TableList.less index cbdd43db09b6e408aa19638c99e11fb317d04a95..aaa64315dacced8fbec9bf73b5ed853b8e70ed12 100644 --- a/src/routes/List/TableList.less +++ b/src/routes/List/TableList.less @@ -10,13 +10,16 @@ } } -.tableListForm :global(.ant-form-item) { - margin-right: 48px; - margin-bottom: 8px; -} - -.formButton { - white-space: nowrap; +.tableListForm { + :global { + .ant-form-item { + margin-bottom: 24px; + display: flex; + } + .ant-form-item-control-wrapper { + flex: 1; + } + } } @media screen and (max-width: @screen-lg) {