|
@@ -10,6 +10,7 @@ import {
|
|
Select,
|
|
Select,
|
|
} from 'antd';
|
|
} from 'antd';
|
|
import {productType} from '@/dataDic.js';
|
|
import {productType} from '@/dataDic.js';
|
|
|
|
+import {getProStatus} from '@/tools.js'
|
|
import Editors from '@/richTextEditors';
|
|
import Editors from '@/richTextEditors';
|
|
import Crop from '@/crop/cropBlock';
|
|
import Crop from '@/crop/cropBlock';
|
|
import KeyWordTagGroup from '@/crop/keyword';
|
|
import KeyWordTagGroup from '@/crop/keyword';
|
|
@@ -36,7 +37,7 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
method: "get",
|
|
method: "get",
|
|
dataType: "json",
|
|
dataType: "json",
|
|
crossDomain: false,
|
|
crossDomain: false,
|
|
- url: globalConfig.context + '/api/admin/news/detail' ,
|
|
|
|
|
|
+ url: globalConfig.context + '/api/admin/community/getCommunintyById' ,
|
|
data: {
|
|
data: {
|
|
id: id
|
|
id: id
|
|
},
|
|
},
|
|
@@ -49,13 +50,12 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
thisData = {};
|
|
thisData = {};
|
|
};
|
|
};
|
|
this.setState({
|
|
this.setState({
|
|
- type:thisData.type,
|
|
|
|
id:thisData.id,
|
|
id:thisData.id,
|
|
data: thisData,
|
|
data: thisData,
|
|
- tags:thisData.keywords||[],
|
|
|
|
- auditStatus:thisData.auditStatus,
|
|
|
|
|
|
+ tags:(thisData.keyword).split(',')||[],
|
|
|
|
+ status:thisData.status,
|
|
edit:thisData.content,
|
|
edit:thisData.content,
|
|
- pictureUrl: thisData.coverUrl ? thisData.coverUrl.split(',') : []
|
|
|
|
|
|
+ pictureUrl: thisData.picUrl ? thisData.picUrl.split(',') : []
|
|
});
|
|
});
|
|
}.bind(this),
|
|
}.bind(this),
|
|
}).always(function () {
|
|
}).always(function () {
|
|
@@ -83,20 +83,18 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
method: "post",
|
|
method: "post",
|
|
dataType: "json",
|
|
dataType: "json",
|
|
async:true,
|
|
async:true,
|
|
- url: this.props.data.id ? globalConfig.context + '/api/admin/news/updateNews' : globalConfig.context + '/api/admin/news/apply',
|
|
|
|
|
|
+ url: this.props.data.id ? globalConfig.context + '/api/admin/community/updateCommunity' : globalConfig.context + '/api/admin/community/insertCommunity',
|
|
data: {
|
|
data: {
|
|
id: this.props.data.id,
|
|
id: this.props.data.id,
|
|
title: values.title,
|
|
title: values.title,
|
|
- author: values.author,
|
|
|
|
- titleImg: this.state.pictureUrl.join(','),
|
|
|
|
|
|
+ picUrl: this.state.pictureUrl.join(','),
|
|
content:this.state.edit,
|
|
content:this.state.edit,
|
|
- hot:values.hot,
|
|
|
|
|
|
+ category:values.category,
|
|
|
|
+ recommend:values.recommend,
|
|
|
|
+ top:values.top,
|
|
source:values.source,
|
|
source:values.source,
|
|
- sourceUrl:values.sourceUrl,
|
|
|
|
- keyword:values.keyword,
|
|
|
|
- auditStatus:index,
|
|
|
|
|
|
+ status:index,
|
|
keyword: this.state.tags ? this.state.tags.join(",") : '',
|
|
keyword: this.state.tags ? this.state.tags.join(",") : '',
|
|
- keywords: this.state.tags,
|
|
|
|
summary: values.summary,
|
|
summary: values.summary,
|
|
}
|
|
}
|
|
}).done(function (data) {
|
|
}).done(function (data) {
|
|
@@ -168,9 +166,9 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
})(<Input placeholder="请输入您的专栏标题" />)}
|
|
})(<Input placeholder="请输入您的专栏标题" />)}
|
|
</FormItem>
|
|
</FormItem>
|
|
<FormItem className="half-item" {...formItemLayout} label="产品类型">
|
|
<FormItem className="half-item" {...formItemLayout} label="产品类型">
|
|
- {getFieldDecorator('productType', {
|
|
|
|
|
|
+ {getFieldDecorator('category', {
|
|
rules: [ { required: true, message: '此项为必填项!' } ],
|
|
rules: [ { required: true, message: '此项为必填项!' } ],
|
|
- initialValue: theData.productType!=undefined?String(theData.type):theData.type
|
|
|
|
|
|
+ initialValue: theData.category!=undefined?String(theData.category):theData.category
|
|
})(
|
|
})(
|
|
<Select placeholder="产品类型">
|
|
<Select placeholder="产品类型">
|
|
{
|
|
{
|
|
@@ -187,11 +185,11 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
initialValue: theData.source
|
|
initialValue: theData.source
|
|
})(<Input placeholder="请输入来源" />)}
|
|
})(<Input placeholder="请输入来源" />)}
|
|
</FormItem>
|
|
</FormItem>
|
|
- <FormItem className="half-item" {...formItemLayout} label="来源链接">
|
|
|
|
|
|
+ {/* <FormItem className="half-item" {...formItemLayout} label="来源链接">
|
|
{getFieldDecorator('sourceUrl', {
|
|
{getFieldDecorator('sourceUrl', {
|
|
initialValue: theData.sourceUrl
|
|
initialValue: theData.sourceUrl
|
|
})(<Input placeholder="请输入来源链接" />)}
|
|
})(<Input placeholder="请输入来源链接" />)}
|
|
- </FormItem>
|
|
|
|
|
|
+ </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="关键字">
|
|
@@ -209,8 +207,8 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
getAllImg={(e)=>{this.setState({pictureUrl:e})}}
|
|
getAllImg={(e)=>{this.setState({pictureUrl:e})}}
|
|
number = {1}
|
|
number = {1}
|
|
aspectRatio = {2/1}
|
|
aspectRatio = {2/1}
|
|
- url ={globalConfig.context + '/api/admin/video/upload'}
|
|
|
|
- uploadData = {{sign:'video_cover'}}
|
|
|
|
|
|
+ url ={globalConfig.context + '/api/admin/community/upload'}
|
|
|
|
+ uploadData = {{sign:'knowledge_base'}}
|
|
urlArr = {this.state.pictureUrl}
|
|
urlArr = {this.state.pictureUrl}
|
|
/>
|
|
/>
|
|
</FormItem>
|
|
</FormItem>
|
|
@@ -233,14 +231,14 @@ 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>{theData.releaseStatus?'已发布':'未发布'}</span>
|
|
|
|
|
|
+ <FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="发布状态">
|
|
|
|
+ <span>{getProStatus(theData.status)}</span>
|
|
</FormItem>
|
|
</FormItem>
|
|
</div>
|
|
</div>
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
<FormItem className="half-item" {...formItemLayout} label="置顶">
|
|
<FormItem className="half-item" {...formItemLayout} label="置顶">
|
|
- {getFieldDecorator('hot', {
|
|
|
|
- initialValue: theData.hot
|
|
|
|
|
|
+ {getFieldDecorator('top', {
|
|
|
|
+ initialValue: theData.top
|
|
})(
|
|
})(
|
|
<Radio.Group>
|
|
<Radio.Group>
|
|
<Radio value={0}>否</Radio>
|
|
<Radio value={0}>否</Radio>
|
|
@@ -249,8 +247,8 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
)}
|
|
)}
|
|
</FormItem>
|
|
</FormItem>
|
|
<FormItem className="half-item" {...formItemLayout} label="推荐">
|
|
<FormItem className="half-item" {...formItemLayout} label="推荐">
|
|
- {getFieldDecorator('hot1', {
|
|
|
|
- initialValue: theData.hot1
|
|
|
|
|
|
+ {getFieldDecorator('recommend', {
|
|
|
|
+ initialValue: theData.recommend
|
|
})(
|
|
})(
|
|
<Radio.Group>
|
|
<Radio.Group>
|
|
<Radio value={0}>否</Radio>
|
|
<Radio value={0}>否</Radio>
|
|
@@ -258,6 +256,15 @@ 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>
|
|
</div>
|
|
</div>
|
|
<div className="clearfix">
|
|
<div className="clearfix">
|
|
<FormItem wrapperCol={{ span: 12, offset: 3 }}>
|
|
<FormItem wrapperCol={{ span: 12, offset: 3 }}>
|
|
@@ -268,7 +275,7 @@ const NewDetailForm = Form.create()(React.createClass({
|
|
className="set-submit"
|
|
className="set-submit"
|
|
type="ghost"
|
|
type="ghost"
|
|
onClick={(e) => {
|
|
onClick={(e) => {
|
|
- this.handleSubmit(e,2)
|
|
|
|
|
|
+ this.handleSubmit(e,1)
|
|
}}
|
|
}}
|
|
>
|
|
>
|
|
发布新闻
|
|
发布新闻
|