2017-07-26 12:40:58 +08:00
|
|
|
|
// import React, { Component } from 'react'
|
|
|
|
|
// import { Select, Input } from 'antd'
|
|
|
|
|
// import PropTypes from 'prop-types'
|
|
|
|
|
// import { autobind } from 'core-decorators'
|
|
|
|
|
// import { connect } from 'react-redux'
|
2017-08-08 10:07:55 +08:00
|
|
|
|
// import { deleteReqParams } from '../../../reducer/modules/addInterface.js'
|
2017-07-26 12:40:58 +08:00
|
|
|
|
// import json2html from 'json2html'
|
2017-07-19 19:29:18 +08:00
|
|
|
|
|
2017-07-26 12:40:58 +08:00
|
|
|
|
// @connect(
|
|
|
|
|
// state => {
|
|
|
|
|
// return {
|
|
|
|
|
// reqParams: state.addInterface.reqParams
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// deleteReqParams
|
|
|
|
|
// }
|
|
|
|
|
// )
|
2017-07-18 12:53:53 +08:00
|
|
|
|
|
2017-07-26 12:40:58 +08:00
|
|
|
|
// class ParamsList extends Component {
|
|
|
|
|
// static propTypes = {
|
|
|
|
|
// reqParams: PropTypes.array,
|
|
|
|
|
// dataNum: PropTypes.number,
|
|
|
|
|
// deleteReqParams: PropTypes.func
|
|
|
|
|
// }
|
2017-07-19 19:29:18 +08:00
|
|
|
|
|
2017-07-26 12:40:58 +08:00
|
|
|
|
// constructor(props) {
|
|
|
|
|
// super(props)
|
|
|
|
|
// }
|
2017-07-18 12:53:53 +08:00
|
|
|
|
|
2017-07-26 12:40:58 +08:00
|
|
|
|
// @autobind
|
|
|
|
|
// deleteReqParams (e) {
|
|
|
|
|
// let newSeqParams = []
|
|
|
|
|
// let reqParams = this.props.reqParams
|
|
|
|
|
// let dataNum = e.target.getAttribute('data-num')
|
|
|
|
|
// reqParams.map(value => {
|
|
|
|
|
// if (+dataNum !== value.id) {
|
|
|
|
|
// newSeqParams.push(value)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// this.props.deleteReqParams(newSeqParams)
|
|
|
|
|
// }
|
2017-07-19 19:29:18 +08:00
|
|
|
|
|
2017-07-26 12:40:58 +08:00
|
|
|
|
// render () {
|
|
|
|
|
// const Option = Select.Option
|
|
|
|
|
// const dataNum = this.props.dataNum
|
2017-07-18 12:53:53 +08:00
|
|
|
|
|
2017-07-26 12:40:58 +08:00
|
|
|
|
// return (
|
|
|
|
|
// <li>
|
|
|
|
|
// <Select defaultValue="选填" style={{ width: 'auto' }} onChange={this.handleChange} size="large" className="required">
|
|
|
|
|
// <Option value="必填">必填</Option>
|
|
|
|
|
// <Option value="选填">选填</Option>
|
2017-08-07 19:34:34 +08:00
|
|
|
|
// </Select>
|
2017-07-26 12:40:58 +08:00
|
|
|
|
// <em className="title">参数名称</em>
|
|
|
|
|
// <Input placeholder="参数名称" className="name" size="large" />
|
|
|
|
|
// <em className="title">参数说明</em>
|
|
|
|
|
// <Input placeholder="参数说明" className="name" size="large" />
|
|
|
|
|
// <span className="close" onClick={this.deleteReqParams} data-num={dataNum}>×</span>
|
2017-08-07 19:34:34 +08:00
|
|
|
|
// </li>
|
2017-07-26 12:40:58 +08:00
|
|
|
|
// )
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2017-07-18 12:53:53 +08:00
|
|
|
|
|
2017-08-07 19:34:34 +08:00
|
|
|
|
// export default ParamsList
|