|
@@ -67,10 +67,10 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
handleSubmit(e,index) {
|
|
handleSubmit(e,index) {
|
|
e.preventDefault();
|
|
e.preventDefault();
|
|
this.props.form.validateFields((err, values) => {
|
|
this.props.form.validateFields((err, values) => {
|
|
- if (!this.state.pictureUrl.length) {
|
|
|
|
- message.warning('请上传专栏图片!');
|
|
|
|
- return false;
|
|
|
|
- };
|
|
|
|
|
|
+ // if (!this.state.pictureUrl.length) {
|
|
|
|
+ // message.warning('请上传专栏图片!');
|
|
|
|
+ // return false;
|
|
|
|
+ // };
|
|
if((this.state.edit)==undefined||!this.state.edit||(this.state.edit)=='<p><br></p>'){
|
|
if((this.state.edit)==undefined||!this.state.edit||(this.state.edit)=='<p><br></p>'){
|
|
message.warning('请填写专栏正文');
|
|
message.warning('请填写专栏正文');
|
|
return false;
|
|
return false;
|
|
@@ -92,7 +92,6 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
category:values.category,
|
|
category:values.category,
|
|
recommend:values.recommend,
|
|
recommend:values.recommend,
|
|
top:values.top,
|
|
top:values.top,
|
|
- source:values.source,
|
|
|
|
status:index,
|
|
status:index,
|
|
keyword: this.state.tags ? this.state.tags.join(",") : '',
|
|
keyword: this.state.tags ? this.state.tags.join(",") : '',
|
|
summary: values.summary,
|
|
summary: values.summary,
|
|
@@ -179,12 +178,6 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
</Select>
|
|
</Select>
|
|
)}
|
|
)}
|
|
</FormItem>
|
|
</FormItem>
|
|
- <FormItem className="half-item" {...formItemLayout} label="专栏来源">
|
|
|
|
- {getFieldDecorator('source', {
|
|
|
|
- rules: [ { required: true, message: '此项为必填项!' } ],
|
|
|
|
- initialValue: theData.source
|
|
|
|
- })(<Input placeholder="请输入来源" maxLength={45} />)}
|
|
|
|
- </FormItem>
|
|
|
|
</div>
|
|
</div>
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="关键字">
|
|
<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="关键字">
|
|
@@ -197,10 +190,7 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
</FormItem>
|
|
</FormItem>
|
|
</div>
|
|
</div>
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
- <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label={<span>
|
|
|
|
- <strong style={{ color: '#f00' }}> * </strong>
|
|
|
|
- <span>专栏图片</span>
|
|
|
|
- </span>}>
|
|
|
|
|
|
+ <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="专栏图片">
|
|
<Crop
|
|
<Crop
|
|
getAllImg={(e)=>{this.setState({pictureUrl:e})}}
|
|
getAllImg={(e)=>{this.setState({pictureUrl:e})}}
|
|
number = {1}
|
|
number = {1}
|
|
@@ -234,7 +224,7 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
</FormItem>
|
|
</FormItem>
|
|
</div>
|
|
</div>
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
- <FormItem className="half-item" {...formItemLayout} label="置顶">
|
|
|
|
|
|
+ <FormItem className="half-item" {...formItemLayout} label="热门">
|
|
{getFieldDecorator('top', {
|
|
{getFieldDecorator('top', {
|
|
initialValue: theData.top
|
|
initialValue: theData.top
|
|
})(
|
|
})(
|
|
@@ -254,15 +244,17 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
</Radio.Group>
|
|
</Radio.Group>
|
|
)}
|
|
)}
|
|
</FormItem>
|
|
</FormItem>
|
|
- <FormItem className="half-item" {...formItemLayout} label="阅读量">
|
|
|
|
- <span>{theData.readNumber||0}</span>
|
|
|
|
- </FormItem>
|
|
|
|
- <FormItem className="half-item" {...formItemLayout} label="评论量">
|
|
|
|
- <span>{theData.commentNumber||0}</span>
|
|
|
|
- </FormItem>
|
|
|
|
- <FormItem className="half-item" {...formItemLayout} label="点赞量">
|
|
|
|
- <span>{theData.starNumber||0}</span>
|
|
|
|
- </FormItem>
|
|
|
|
|
|
+ {this.props.data.id&&<div className="clearfix">
|
|
|
|
+ <FormItem className="half-item" {...formItemLayout} label="阅读量">
|
|
|
|
+ <span>{theData.readNumber||0}</span>
|
|
|
|
+ </FormItem>
|
|
|
|
+ <FormItem className="half-item" {...formItemLayout} label="评论量">
|
|
|
|
+ <span>{theData.commentNumber||0}</span>
|
|
|
|
+ </FormItem>
|
|
|
|
+ <FormItem className="half-item" {...formItemLayout} label="点赞量">
|
|
|
|
+ <span>{theData.starNumber||0}</span>
|
|
|
|
+ </FormItem>
|
|
|
|
+ </div>}
|
|
</div>
|
|
</div>
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
<FormItem wrapperCol={{ span: 12, offset: 3 }}>
|
|
<FormItem wrapperCol={{ span: 12, offset: 3 }}>
|