import React from 'react' import { connect } from 'dva' import { Form, Input, Divider, Icon, Tooltip, Button } from 'antd' import ChooseChartBox from './chooseChartBox' import CusFilterBox from './cusFilterBox' import './configSider.less' const FormItem = Form.Item class ConfigSider extends React.Component { constructor(props) { super(props); this.state = { visibleChooseChartBox: false, visibleCusFilterBox: false }; } showChooseChartBox = (o) => { this.setState({ visibleChooseChartBox: true }); } hideChooseChartBox = (o) => { this.setState({ visibleChooseChartBox: false }); } showCusFilterBox = (o) => { this.setState({ visibleCusFilterBox: true }); } hideCusFilterBox = (o) => { this.setState({ visibleCusFilterBox: false }); } generateViewTypes = () => { const { dispatch } = this.props; const { visibleChooseChartBox } = this.state; return (
{ this.showChooseChartBox("create"); }}/>
{ dispatch({ type: 'dashboardDesigner/addRichText' }); }}/>
{visibleChooseChartBox && }
) } render() { const { dashboardDesigner, dispatch } = this.props; const { visibleCusFilterBox } = this.state; return
报表制作 {this.generateViewTypes()} 字段过滤 {visibleCusFilterBox && } 其他设置 { dispatch({ type: 'dashboardDesigner/setField', name: 'shareCode', value: e.target.value }); }} /> } } export default connect(({ present: { dashboardDesigner } }) => ({ dashboardDesigner }))(ConfigSider);