import PropTypes from 'prop-types' import { connect } from 'react-redux' import React, { Component } from 'react' import { Select, Input } from 'antd' import { autobind } from 'core-decorators' import { pushInputValue, pushInterfaceName, pushInterfaceMethod } from '../../../actions/addInterface.js' @connect( state => { return { method: state.addInterface.method, url: state.addInterface.url, interfaceName: state.addInterface.interfaceName } }, { pushInputValue, pushInterfaceName, pushInterfaceMethod } ) class ReqMethod extends Component { static propTypes = { pushInputValue: PropTypes.func, pushInterfaceName: PropTypes.func, pushInterfaceMethod: PropTypes.func, url: PropTypes.string, method: PropTypes.string, interfaceName: PropTypes.string } constructor(props) { super(props) } @autobind handleChange (value) { this.props.pushInterfaceMethod(value) } @autobind getInputVal (e) { const url = e.target.value this.props.pushInputValue(url) } @autobind getInterfaceValue (e) { const name = e.target.value this.props.pushInterfaceName(name) } render () { const { Option } = Select const { url, interfaceName, method } = this.props return (
请求方式 :
URL :
名称 :
) } } export default ReqMethod