| | |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | let _config = values.config |
| | | let _config = values.config.replace(/(\n|\s)+/g, '') |
| | | |
| | | if (!_config) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请输入配置信息', |
| | | duration: 5 |
| | | }) |
| | | reject() |
| | | return |
| | | } |
| | | try { |
| | | _config = JSON.parse(window.decodeURIComponent(window.atob(_config))) |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | enterPress = (e) => { |
| | | e.stopPropagation() |
| | | |
| | | setTimeout(() => { |
| | | this.props.inputSubmit && this.props.inputSubmit() |
| | | }, 200) |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | |
| | | message: '请输入配置信息!' |
| | | } |
| | | ] |
| | | })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }}/>)} |
| | | })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }} onPressEnter={this.enterPress}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |