import React, {Component} from 'react'
|
import PropTypes from 'prop-types'
|
import { Form, Row, Col, Input } from 'antd'
|
// import { QuestionCircleOutlined } from '@ant-design/icons'
|
|
// import './index.scss'
|
const { TextArea } = Input
|
|
class BaseForm extends Component {
|
static propTpyes = {
|
verify: PropTypes.object,
|
onChange: PropTypes.func
|
}
|
|
state = {}
|
|
handleConfirm = () => {
|
const { verify } = this.props
|
|
if (verify.type === 'billout') {
|
return new Promise((resolve, reject) => {
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
if (!err) {
|
resolve(values)
|
}
|
})
|
})
|
} else {
|
return Promise.resolve()
|
}
|
}
|
|
// onOptionChange = (value, key) => {
|
// const { verify } = this.props
|
|
// let _verify = {...verify, [key]: value}
|
|
// this.props.onChange(_verify)
|
// }
|
|
render() {
|
const { getFieldDecorator } = this.props.form
|
const { verify } = this.props
|
|
return (
|
<Form className="base-form">
|
<Row gutter={24}>
|
<Col span={8}>
|
<Form.Item label="按钮名称">
|
<Input value={verify.label} disabled={true}/>
|
</Form.Item>
|
</Col>
|
{/* <Col span={8}>
|
<Form.Item label={
|
<Tooltip placement="bottomLeft" title="">
|
<QuestionCircleOutlined className="mk-form-tip" />
|
接口类型
|
</Tooltip>
|
}>
|
<Radio.Group value={verify.intertype} disabled={true}>
|
<Radio value="system">系统</Radio>
|
<Radio value="custom">自定义</Radio>
|
</Radio.Group>
|
</Form.Item>
|
</Col> */}
|
{/* {verify.type === 'billout' ? <Col span={8}>
|
<Form.Item label={
|
<Tooltip placement="bottomLeft" title="">
|
<QuestionCircleOutlined className="mk-form-tip" />
|
参数处理
|
</Tooltip>
|
}>
|
{getFieldDecorator('procMode', {
|
initialValue: verify.procMode || 'system',
|
})(
|
<Radio.Group onChange={(e) => {this.onOptionChange(e.target.value, 'procMode')}}>
|
<Radio value="system">系统函数</Radio>
|
<Radio value="none">无</Radio>
|
</Radio.Group>
|
)}
|
</Form.Item>
|
</Col> : null} */}
|
{verify.type === 'billout' ? <Col span={24}>
|
<Form.Item label="测试地址">
|
{getFieldDecorator('interface', {
|
initialValue: verify.interface || '',
|
rules: [
|
{ required: true, message: '请输入测试地址!' }
|
]
|
})(
|
<TextArea rows={2}/>
|
)}
|
</Form.Item>
|
</Col> : null}
|
{verify.type === 'billout' ? <Col span={24}>
|
<Form.Item label="正式地址">
|
{getFieldDecorator('proInterface', {
|
initialValue: verify.proInterface || '',
|
})(
|
<TextArea rows={2}/>
|
)}
|
</Form.Item>
|
</Col> : null}
|
</Row>
|
</Form>
|
)
|
}
|
}
|
|
export default Form.create()(BaseForm)
|