king
2021-01-15 76a4300654a18d228838c3f27455dc8e7a8cd616
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,         // 菜单信息,新建时为null
    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>
    )