return (
<div>
<Form onSubmit={this.handleSubmit} className=‘container333‘>
<FormItem
label="请输入主标题:"
{...formItemLayout}
>
{getFieldDecorator(‘title‘, {
rules: [{
required: true, message: ‘请输入主标题名称‘,
}],
})(
<Input placeholder="请输入主题" />
)}
</FormItem>
<FormItem
label="摘要:"
{...formItemLayout}
>
{getFieldDecorator(‘zhaiyao‘, {
rules: [{
required: true, message: ‘限制200个字‘,
}],
})(
<TextArea placeholder="限制200个字" autosize={{ minRows: 5, maxRows: 5 }} />
)}
</FormItem>
<FormItem
label="封面图片:"
{...formItemLayout}
>
{getFieldDecorator(‘image‘, {
rules: [{
required: true, message: ‘请上传封面图片‘,
}],
})(
<div>
<Uploading />
</div>
)}
</FormItem>
<FormItem
label="文章标签:"
{...formItemLayout}
>
{getFieldDecorator(‘biaoqian‘)(
<RadioGroup name="radiogroup" >
<Radio name=‘feel‘ value=‘new‘ style={{ width: 20, height: 20 }} /><label style={{ marginRight: 40 }}>new</label>
<Radio name=‘feel‘ value=‘hot‘ style={{ width: 20, height: 20 }} /><label>hot</label>
</RadioGroup>
)}
</FormItem>
<FormItem
label="内容编辑器:"
{...formItemLayout}
>
{getFieldDecorator(‘content‘, {
validateTrigger:‘onBlur‘,
rules: [
{ required: true},
{validator:(rule,value,callback)=>{
if (value.isEmpty()) {
callback(‘请输入正文内容‘)
} else {
callback()
}
}
}
]
})(
<Editor
editorState={editorState}
onEditorStateChange={this.onEditorStateChange}
onContentStateChange={this.onContentStateChange}
wrapperClassName="wrapper-class"
editorClassName="editor-class"
toolbarClassName="toolbar-class"
localization={{ locale: ‘zh‘ }}
toolbar={{
image: {
previewImage: true,
uploadEnabled: true,
urlEnabled: true,
uploadCallback: this.uploadImageCallBack,
alt: { present: true, mandatory: true }
}
}}
/>
)}
</FormItem>
<div className=‘footer11‘>
<div className=‘footer-right‘>
每5分钟保存一次
</div>
</div>
<div className=‘footerbox‘>
<Button type=‘primary‘ size=‘large‘ htmlType="submit" style={{ marginRight: 10, marginLeft: 10 }} className=‘save‘>保存</Button>
<Button type=‘primary‘ size=‘large‘>预览</Button>
</div>
</Form>
{/* <div className=‘footerbox‘>
<Button type=‘primary‘ key=‘submit‘ size=‘large‘ style={{marginRight:10,marginLeft:10}} className=‘save‘>保存</Button>
<Button type=‘primary‘ size=‘large‘ onClick={()=>setPreviewType(‘publishCode2‘)}>预览</Button>
</div> */}
</div>
)
}
}
const WrappedEditForm = Form.create()(EditForm);
export default WrappedEditForm