Select类型:
{getFieldDecorator('sceneCategoryId', {
                  rules: [{ required: true, message: '请选择场景类型' }],
                  initialValue: sceneCategoryId
                })(
                  <Select style={{ width: '100%' }} onChange={this.typeSelect} placeholder='请选择场景类型'
                    className='selectStyle'
                    dropdownClassName='mySelect'>
                    {this.state.selectData.map((item, i) => {
                      return (<Option key={item.SCENE_CATEGORY_ID} value={item.SCENE_CATEGORY_ID}>{item.SCENE_CATEGORY_NAME}</Option>)
                    })}
                  </Select>
                )}
 
Input类型:
{getFieldDecorator('sceneName', {
                  rules: [{ required: true, message: '请输入场景名称' },
                  {
                    whitespace: true,
                    message: '不能输入空格',
                  }
                    // ,
                    // {
                    //   validator: this.validateToSceneName
                    // }
                  ],
                  initialValue: sceneName
                })(<Input onChange={this.sceneNameChange} placeholder='请输入场景名称' />)}
Textarea类型和Input类型一样
      
 {getFieldDecorator('sceneDsc', {
                  rules: [{ required: true, message: '请输入场景描述' },
                  {
                    whitespace: true,
                    message: '不能输入空格',
                  }
                  ],
                  initialValue: sceneDsc
                })(<TextArea style={{ height: '100px' }} rows={4} onChange={this.sceneDscChange} placeholder='请输入场景描述' />)}

相关文章:

  • 2021-12-17
  • 2021-07-27
  • 2021-05-29
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2021-10-28
  • 2021-12-13
  • 2021-12-18
相关资源
相似解决方案