| | |
| | | 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 |
| | |
| | | dict: PropTypes.object, // 字典项 |
| | | data: PropTypes.object, |
| | | columns: PropTypes.array |
| | | } |
| | | |
| | | state = { |
| | | interType: this.props.data.interType || 'inner' |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | onChange = (e) => { |
| | | console.log(e.target.value) |
| | | } |
| | | |
| | | render() { |
| | |
| | | )} |
| | | </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> |