|
@@ -83,7 +83,8 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
|
videoFileList: [],
|
|
|
pictureUrl: [],
|
|
|
tags:[],
|
|
|
- edit:{}
|
|
|
+ edit:{},
|
|
|
+ edits:{}
|
|
|
};
|
|
|
},
|
|
|
loadData(id) {
|
|
@@ -118,7 +119,7 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
|
Province:provice,
|
|
|
publishPages:publishPagesArr,
|
|
|
auditStatus:thisData.auditStatus,
|
|
|
- edit:{content:thisData.content},
|
|
|
+ edit:thisData.content,
|
|
|
pictureUrl: thisData.titleImg ? splitUrl(thisData.titleImg, ',', globalConfig.avatarHost + '/upload') : []
|
|
|
});
|
|
|
}.bind(this),
|
|
@@ -134,7 +135,7 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
|
handleSubmit(e,index) {
|
|
|
e.preventDefault();
|
|
|
this.props.form.validateFields((err, values) => {
|
|
|
- if((this.state.edit).content==undefined||!(this.state.edit).content||(this.state.edit).content=='<p><br></p>'){
|
|
|
+ if((this.state.edit)==undefined||!this.state.edit||(this.state.edit)=='<p><br></p>'){
|
|
|
message.warning('请填写政策正文');
|
|
|
return false;
|
|
|
}
|
|
@@ -165,7 +166,7 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
|
title: values.title,
|
|
|
author: values.author,
|
|
|
titleImg: thePictureUrl,
|
|
|
- content:this.state.edit.content,
|
|
|
+ content:this.state.edit,
|
|
|
hot:values.hot,
|
|
|
source:values.source,
|
|
|
sourceUrl:values.sourceUrl,
|
|
@@ -199,8 +200,9 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
|
if (this.props.data.id) {
|
|
|
this.loadData(this.props.data.id);
|
|
|
} else {
|
|
|
+ this.state.visible=true;
|
|
|
this.state.data = {};
|
|
|
- this.state.edit={};
|
|
|
+ this.state.edit='<p><br></p>';
|
|
|
this.state.pictureUrl = [];
|
|
|
this.setState({
|
|
|
publishPages:['web_index','app_policy_index']
|
|
@@ -214,8 +216,9 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
|
if (nextProps.data.id) {
|
|
|
this.loadData(nextProps.data.id);
|
|
|
} else {
|
|
|
+ this.state.visible=true;
|
|
|
this.state.data = {};
|
|
|
- this.state.edit={};
|
|
|
+ this.state.edit='<p><br></p>';
|
|
|
this.state.pictureUrl = [];
|
|
|
this.state.theData={};
|
|
|
this.setState({
|
|
@@ -233,7 +236,6 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
|
labelCol: { span: 6 },
|
|
|
wrapperCol: { span: 12 },
|
|
|
};
|
|
|
-
|
|
|
return (
|
|
|
<div className='login'>
|
|
|
<Form layout="horizontal" onSubmit={(e)=>{this.handleSubmit(e,0)}} id="demand-form">
|
|
@@ -300,19 +302,18 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label={<span><i style={{color:"red",fontSize:14}}> * </i>新闻正文</span>}>
|
|
|
- <Editors textContent={this.state.edit.content}
|
|
|
+ <Editors textContent={this.state.edit}
|
|
|
uploadUrl={'/api/user/demand/uploadPicture'}
|
|
|
uploadSign={'demand_picture'}
|
|
|
- handleRichText={(value) => { this.state.edit.content = value; }}
|
|
|
+ handleRichText={(value) => { this.state.edit = value; }}
|
|
|
visible={this.state.visible} />
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
-
|
|
|
- {theData.createTime&&<div className="clearfix">
|
|
|
+ <div className="clearfix">
|
|
|
<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="是否发布">
|
|
|
<span>{theData.releaseStatus?'已发布':'未发布'}</span>
|
|
|
</FormItem>
|
|
|
- </div>}
|
|
|
+ </div>
|
|
|
<div className="clearfix">
|
|
|
<FormItem className="full-item"
|
|
|
labelCol={{ span: 3 }}
|
|
@@ -334,9 +335,9 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
|
</div>
|
|
|
<div className="clearfix">
|
|
|
<FormItem wrapperCol={{ span: 12, offset: 3 }}>
|
|
|
- {this.props.data&&!this.props.data.id&&<Button className="set-submit" type="primary" htmlType="submit">
|
|
|
+ <Button className="set-submit" type="primary" htmlType="submit">
|
|
|
保存草稿
|
|
|
- </Button>}
|
|
|
+ </Button>
|
|
|
<Button
|
|
|
className="set-submit"
|
|
|
type="ghost"
|