king
2019-12-12 f22bb55c4ff50a8a63c795487b057c0cebdae649
src/templates/comtableconfig/settingform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Radio, Select } from 'antd'
import { Form, Row, Col, Input, Radio, Select, Tooltip, Icon } from 'antd'
import './index.scss'
const { TextArea } = Input
@@ -10,6 +10,10 @@
    dict: PropTypes.object, // 字典项
    data: PropTypes.object,
    columns: PropTypes.array
  }
  state = {
    interType: this.props.data.interType || 'inner'
  }
  handleConfirm = () => {
@@ -23,6 +27,10 @@
        }
      })
    })
  }
  onChange = (e) => {
    console.log(e.target.value)
  }
  render() {
@@ -79,16 +87,34 @@
              )}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="接口类型">
              {getFieldDecorator('interType', {
                initialValue: data.interType || 'inner'
              })(
                <Radio.Group onChange={this.onChange}>
                  <Radio value="inner">内部</Radio>
                  <Radio value="outer">外部</Radio>
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          <Col span={12}>
            <Form.Item label="内部函数">
              {getFieldDecorator('innerFunc', {
                initialValue: data.innerFunc || ''
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col>
          <Col span={24}>
            <Form.Item label="数据源" className="textarea">
            <Form.Item label={
              <Tooltip placement="topLeft" title="">
                <Icon type="question-circle" />
                {'数据源'}
              </Tooltip>
            } className="textarea">
              {getFieldDecorator('dataresource', {
                initialValue: data.dataresource,
                rules: [
                  {
                    required: true,
                    message: dict['form.required.input'] + '数据源!'
                  }
                ]
                initialValue: data.dataresource
              })(<TextArea rows={4} />)}
            </Form.Item>
          </Col>