/** * 总体统计数据表 */ import React from 'react'; import { Form, Select, Checkbox, Row, Col } from 'antd'; import { connect } from 'dva'; import STATISTICS_OPTION from './statisticsOption.json' const FormItem = Form.Item; const { Option } = Select; const CheckboxGroup = Checkbox.Group; class AggregateTableConfigForm extends React.Component { constructor(props) { super(props); this.state = { formItemLayout: { labelCol: { span: 8 }, wrapperCol: { span: 16 }, }, searchKey: '', }; } handleSearch = (value) => { this.setState({ searchKey: value }); } render() { const props = this.props; const { autoRefresh, chartDesigner, dispatch } = props; const{ searchKey, formItemLayout } = this.state; const { columns, aggregateTableConfig } = chartDesigner; let options = columns.filter(c => c.label.toLowerCase().indexOf(searchKey.toLowerCase()) !== -1); return (
{ dispatch({ type: 'chartDesigner/changeField', name: 'aggregateTableConfig', value: { ...props.chartDesigner.aggregateTableConfig, statistics: value }, autoRefresh }); }} > {STATISTICS_OPTION.map((s)=>{return {s.label}})}
); } } function mapStateToProps({ present: { chartDesigner } }) { return { chartDesigner: chartDesigner } } export default connect(mapStateToProps)(AggregateTableConfigForm);