king
2022-05-18 f1bac4fe4feacc8110ce98b0f54e675cd07713cd
src/templates/zshare/pasteform/index.jsx
@@ -26,7 +26,17 @@
    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)))
@@ -63,6 +73,14 @@
    })
  }
  enterPress = (e) => {
    e.stopPropagation()
    setTimeout(() => {
      this.props.inputSubmit && this.props.inputSubmit()
    }, 200)
  }
  render() {
    const { getFieldDecorator } = this.props.form
    const formItemLayout = {
@@ -88,7 +106,7 @@
                    message: '请输入配置信息!'
                  }
                ]
              })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }}/>)}
              })(<TextArea autoSize={{ minRows: 6, maxRows: 6 }} onPressEnter={this.enterPress}/>)}
            </Form.Item>
          </Col>
        </Row>