From ba7c54e0029456e6b1bf7f0e0d31af69a3d74db3 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 02 三月 2020 15:34:51 +0800 Subject: [PATCH] 2020-03-02 --- src/templates/ushare/modalform/index.jsx | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/templates/ushare/modalform/index.jsx b/src/templates/ushare/modalform/index.jsx index ce82397..9771c0b 100644 --- a/src/templates/ushare/modalform/index.jsx +++ b/src/templates/ushare/modalform/index.jsx @@ -13,7 +13,8 @@ dict: PropTypes.object, // 瀛楀吀椤� optionLibs: PropTypes.any, // 鑷畾涔変笅鎷夐泦 formlist: PropTypes.any, - card: PropTypes.object + card: PropTypes.object, + inputSubmit: PropTypes.any } state = { @@ -257,6 +258,14 @@ } } + handleSubmit = (e) => { + e.preventDefault() + + if (this.props.inputSubmit) { + this.props.inputSubmit() + } + } + getFields() { const { getFieldDecorator } = this.props.form const fields = [] @@ -299,7 +308,7 @@ }, ...rules ] - })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} + })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.handleSubmit} />)} </Form.Item> </Col> ) @@ -316,7 +325,7 @@ message: this.props.dict['form.required.input'] + item.label + '!' } ] - })(<InputNumber min={0} max={18} precision={0} />)} + })(<InputNumber min={0} max={18} precision={0} onPressEnter={this.handleSubmit} />)} </Form.Item> </Col> ) @@ -332,7 +341,7 @@ message: this.props.dict['form.required.input'] + item.label + '!' } ] - })(<InputNumber min={1} precision={0} />)} + })(<InputNumber min={1} precision={0} onPressEnter={this.handleSubmit} />)} </Form.Item> </Col> ) @@ -348,7 +357,7 @@ message: this.props.dict['form.required.input'] + item.label + '!' } ] - })(<InputNumber />)} + })(<InputNumber onPressEnter={this.handleSubmit} />)} </Form.Item> </Col> ) -- Gitblit v1.8.0