From e603c97dbe7a4f1dbd6445e00383ed651182e0fe Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 03 三月 2020 17:09:11 +0800 Subject: [PATCH] 2020-03-03 --- src/templates/tableshare/tabform/index.jsx | 26 +++++++++++++++----------- 1 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/templates/tableshare/tabform/index.jsx b/src/templates/tableshare/tabform/index.jsx index c09e01c..64b356a 100644 --- a/src/templates/tableshare/tabform/index.jsx +++ b/src/templates/tableshare/tabform/index.jsx @@ -8,11 +8,12 @@ class MainTab extends Component { static propTpyes = { - tabs: PropTypes.array, // 绫诲瀷 - type: PropTypes.string, // 绫诲瀷 - dict: PropTypes.object, // 瀛楀吀椤� - formlist: PropTypes.any, // 琛ㄥ崟 - card: PropTypes.object // 鏍囩椤典俊鎭� + tabs: PropTypes.array, // 鍙叧鑱旀爣绛鹃泦 + type: PropTypes.string, // 绫诲瀷 + dict: PropTypes.object, // 瀛楀吀椤� + formlist: PropTypes.any, // 琛ㄥ崟 + card: PropTypes.object, // 鏍囩椤典俊鎭� + inputSubmit: PropTypes.any // 鍥炶溅鎻愪氦浜嬩欢 } state = { @@ -26,10 +27,8 @@ const { formlist } = this.props let type = formlist.filter(cell => cell.key === 'type')[0].initVal - // let _initval = formlist.filter(cell => cell.key === 'linkTab')[0].initVal let _tabs = this.props.tabs.filter(tab => tab.type === type) - // let initTab = _tabs.filter(tab => tab.uuid === _initval)[0] this.setState({ formlist: formlist.map(item => { @@ -41,9 +40,6 @@ }, ..._tabs ] - // if (!initTab) { - // item.initVal = '' - // } } return item @@ -101,6 +97,14 @@ } } + handleSubmit = (e) => { + e.preventDefault() + + if (this.props.inputSubmit) { + this.props.inputSubmit() + } + } + getFields() { const { getFieldDecorator } = this.props.form const fields = [] @@ -124,7 +128,7 @@ message: formRule.input.message } ] - })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} + })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.handleSubmit} />)} </Form.Item> </Col> ) -- Gitblit v1.8.0