From 76a4300654a18d228838c3f27455dc8e7a8cd616 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 15 一月 2021 17:04:42 +0800 Subject: [PATCH] Merge branch 'master' into bms --- src/templates/menuconfig/editfirstmenu/menuform/index.jsx | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/templates/menuconfig/editfirstmenu/menuform/index.jsx b/src/templates/menuconfig/editfirstmenu/menuform/index.jsx index 23993be..e263eba 100644 --- a/src/templates/menuconfig/editfirstmenu/menuform/index.jsx +++ b/src/templates/menuconfig/editfirstmenu/menuform/index.jsx @@ -6,9 +6,10 @@ class MainSearch extends Component { static propTpyes = { - menu: PropTypes.any, // 鎼滅储鏉′欢鍒楄〃 - dict: PropTypes.object, // 瀛楀吀椤� - type: PropTypes.string // 瀛楀吀椤� + menu: PropTypes.any, // 鑿滃崟淇℃伅锛屾柊寤烘椂涓簄ull + dict: PropTypes.object, // 瀛楀吀椤� + type: PropTypes.string, // 鎿嶄綔绫诲瀷 + inputSubmit: PropTypes.func } state = { @@ -115,7 +116,7 @@ message: this.props.dict['form.required.input'] + item.label + '!' } ] - })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} + })(<Input placeholder="" autoFocus={item.key.toLowerCase() === 'menuname'} autoComplete="off" disabled={item.readonly} />)} </Form.Item> </Col> ) @@ -136,7 +137,7 @@ showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} onChange={(value) => {this.openTypeChange(item.key, value)}} - getPopupContainer={() => document.getElementById('form-box')} + getPopupContainer={() => document.getElementById('first-menu-form-box')} > {item.options.map(option => <Select.Option key={option.id} value={option.id}>{option.text}</Select.Option> @@ -209,6 +210,13 @@ }) } + onEnterSubmit = (e) => { + // 琛ㄥ崟鍥炶溅鎻愪氦 + if (e.key !== 'Enter') return + + this.props.inputSubmit && this.props.inputSubmit() + } + render() { const formItemLayout = { labelCol: { @@ -221,7 +229,7 @@ } } return ( - <Form {...formItemLayout} className="ant-advanced-search-form" id="form-box"> + <Form {...formItemLayout} className="ant-advanced-search-form" id="first-menu-form-box" onKeyDown={this.onEnterSubmit}> <Row gutter={24}>{this.getFields()}</Row> </Form> ) -- Gitblit v1.8.0