king
2021-06-29 3f85ff9067b806df7848ce7b852ff357a7bac7f5
src/mob/components/topbar/normal-navbar/wrapsetting/settingform/index.jsx
@@ -11,7 +11,9 @@
    inputSubmit: PropTypes.func  // 回车事件
  }
  state = {}
  state = {
    type: this.props.wrap.type || 'navbar'
  }
  handleConfirm = () => {
    // 表单提交时检查输入值是否正确
@@ -37,6 +39,7 @@
  render() {
    const { wrap } = this.props
    const { getFieldDecorator } = this.props.form
    const { type } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -52,14 +55,26 @@
      <div className="model-menu-setting-form">
        <Form {...formItemLayout}>
          <Row gutter={24}>
            <Col span={22}>
            <Col span={12}>
              <Form.Item label="类型">
                {getFieldDecorator('type', {
                  initialValue: wrap.type || 'navbar'
                })(
                  <Radio.Group onChange={(e) => this.setState({type: e.target.value})}>
                    <Radio value="navbar">导航栏</Radio>
                    <Radio value="search">搜索栏</Radio>
                  </Radio.Group>
                )}
              </Form.Item>
            </Col>
            {type === 'navbar' ? <Col span={12}>
              <Form.Item label="标题">
                {getFieldDecorator('title', {
                  initialValue: wrap.title || ''
                })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)}
              </Form.Item>
            </Col>
            <Col span={22}>
            </Col> : null}
            <Col span={12}>
              <Form.Item label="高度">
                {getFieldDecorator('height', {
                  initialValue: wrap.height || 50,
@@ -72,19 +87,31 @@
                })(<InputNumber min={30} max={200} precision={0} onPressEnter={this.handleSubmit} />)}
              </Form.Item>
            </Col>
            <Col span={24}>
            <Col span={12}>
              <Form.Item label="返回">
                {getFieldDecorator('back', {
                  initialValue: wrap.back || 'true'
                })(
                  <Radio.Group>
                    <Radio value="true">显示</Radio>
                    <Radio value="false">不显示</Radio>
                    <Radio value="false">隐藏</Radio>
                  </Radio.Group>
                )}
              </Form.Item>
            </Col>
            <Col span={24}>
            {type === 'navbar' ? <Col span={12}>
              <Form.Item label="搜索">
                {getFieldDecorator('search', {
                  initialValue: wrap.search || 'false'
                })(
                  <Radio.Group>
                    <Radio value="true">显示</Radio>
                    <Radio value="false">隐藏</Radio>
                  </Radio.Group>
                )}
              </Form.Item>
            </Col> : null}
            <Col span={12}>
              <Form.Item label={
                <Tooltip placement="topLeft" title="点击退出时,返回第一个页面。">
                  <Icon type="question-circle" />
@@ -96,7 +123,7 @@
                })(
                  <Radio.Group>
                    <Radio value="true">显示</Radio>
                    <Radio value="false">不显示</Radio>
                    <Radio value="false">隐藏</Radio>
                  </Radio.Group>
                )}
              </Form.Item>