king
2020-05-06 4e1938344ca46c0cbe699756ecaffa630e698aec
src/templates/sharecomponent/chartcomponent/chartcompile/index.jsx
@@ -8,10 +8,9 @@
class LineChartDrawerForm extends Component {
  static propTpyes = {
    type: PropTypes.string,
    dict: PropTypes.object,
    plot: PropTypes.object,
    columns: PropTypes.array,
    config: PropTypes.object,
    plotchange: PropTypes.func
  }
@@ -21,11 +20,11 @@
  }
  showDrawer = () => {
    const { columns, plot, type } = this.props
    const { config, plot } = this.props
    this.setState({
      visible: true,
      formlist: getChartOptionForm(plot, columns, type)
      formlist: getChartOptionForm(plot, config.columns, config.setting)
    })
  }
@@ -47,6 +46,24 @@
    })
  }
  radioChange = (e, key) => {
    const { formlist } = this.state
    let val = e.target.value
    if (key === 'datatype') {
      this.setState({
        formlist: formlist.map(item => {
          if (['Yaxis'].includes(item.key)) {
            item.hidden = val === 'statistics'
          } else if (['InfoType', 'InfoValue', 'InfoDefNumber'].includes(item.key)) {
            item.hidden = val !== 'statistics'
          }
          return item
        })
      })
    }
  }
  getFields() {
    const { formlist } = this.state
    const { getFieldDecorator } = this.props.form
@@ -57,9 +74,9 @@
    }
    formlist.forEach((item, index) => {
      if (item.hidden) return
      if (item.hidden || item.forbid) return
      
      if (item.type === 'text') { // 文本搜索
      if (item.type === 'text') {
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.tooltip ?
@@ -101,7 +118,7 @@
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'select') { // 下拉搜索
      } else if (item.type === 'select') { // 下拉
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.tooltip ?
@@ -133,7 +150,12 @@
      } else if (item.type === 'radio') {
        fields.push(
          <Col span={12} key={index}>
            <Form.Item label={item.label}>
            <Form.Item label={item.tooltip ?
              <Tooltip placement="topLeft" title={item.tooltip}>
                <Icon type="question-circle" />
                {item.label}
              </Tooltip> : item.label
            }>
              {getFieldDecorator(item.key, {
                initialValue: item.initVal,
                rules: [
@@ -143,7 +165,7 @@
                  }
                ]
              })(
                <Radio.Group>
                <Radio.Group disabled={item.readonly} onChange={(e) => this.radioChange(e, item.key)}>
                  {item.options.map(option => {
                    return (
                      <Radio key={option.value} value={option.value}>{option.text}</Radio>