|
@@ -5,8 +5,8 @@ import moment from 'moment';
|
|
|
import '@/account/demand/techDemand.less';
|
|
|
import NewDesc from '@/administration/product/proDesc';
|
|
|
import '@/administration/news/news.less';
|
|
|
-import {releaseStateList,productType } from '@/dataDic.js';
|
|
|
-import {getReleaseStateList,getProductType } from '@/tools.js';
|
|
|
+import {proStatus,productType } from '@/dataDic.js';
|
|
|
+import {getProStatus,getProductType } from '@/tools.js';
|
|
|
|
|
|
const DemandList = React.createClass({
|
|
|
loadData(pageNo) {
|
|
@@ -20,15 +20,15 @@ const DemandList = React.createClass({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/news/list",
|
|
|
+ url: globalConfig.context + "/api/admin/community/list",
|
|
|
data: {
|
|
|
pageNo: pageNo || 1,
|
|
|
pageSize: this.state.pagination.pageSize,
|
|
|
title: this.state.nameSearch, //需求名称
|
|
|
- startCreateTime: this.state.releaseDate[0],
|
|
|
- endCreateTime: this.state.releaseDate[1],
|
|
|
- auditStatus:this.state.auditStatusSearch,
|
|
|
- type:this.state.typeSearch
|
|
|
+ startTime: this.state.releaseDate[0],
|
|
|
+ endTime: this.state.releaseDate[1],
|
|
|
+ status:this.state.auditStatusSearch,
|
|
|
+ category:this.state.typeSearch
|
|
|
},
|
|
|
success: function (data) {
|
|
|
let theArr = [];
|
|
@@ -43,10 +43,10 @@ const DemandList = React.createClass({
|
|
|
key: i,
|
|
|
id: thisdata.id,
|
|
|
title: thisdata.title,
|
|
|
- author:thisdata.author,
|
|
|
- source: thisdata.source,
|
|
|
- auditStatus: thisdata.auditStatus, //审核状态
|
|
|
- releaseDate:thisdata.releaseDate?(new Date(thisdata.releaseDate)).toLocaleString():''
|
|
|
+ category:thisdata.category,
|
|
|
+ status: thisdata.status,
|
|
|
+ source:thisdata.source,
|
|
|
+ releaseTime:thisdata.releaseTime?(new Date(thisdata.releaseTime)).toLocaleString():''
|
|
|
});
|
|
|
};
|
|
|
};
|
|
@@ -95,15 +95,15 @@ const DemandList = React.createClass({
|
|
|
},
|
|
|
{
|
|
|
title: '产品类型',
|
|
|
- dataIndex: 'author1',
|
|
|
- key: 'author1',
|
|
|
+ dataIndex: 'category',
|
|
|
+ key: 'category',
|
|
|
render:text=>{return getProductType(text)}
|
|
|
},
|
|
|
{
|
|
|
title: '发布状态',
|
|
|
- dataIndex: 'auditStatus',
|
|
|
- key: 'auditStatus',
|
|
|
- render: text => { return getReleaseStateList(text) }
|
|
|
+ dataIndex: 'status',
|
|
|
+ key: 'status',
|
|
|
+ render: text => { return getProStatus(text) }
|
|
|
},
|
|
|
{
|
|
|
title: '来源',
|
|
@@ -112,8 +112,8 @@ const DemandList = React.createClass({
|
|
|
},
|
|
|
{
|
|
|
title: '发布时间',
|
|
|
- dataIndex: 'releaseDate',
|
|
|
- key: 'releaseDate'
|
|
|
+ dataIndex: 'releaseTime',
|
|
|
+ key: 'releaseTime'
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
@@ -121,9 +121,8 @@ const DemandList = React.createClass({
|
|
|
key: 'caozuo',
|
|
|
render:(text,recard) => {
|
|
|
return <div className="btnRight">
|
|
|
- {recard.auditStatus!='1'&&recard.auditStatus!='2'&&<Button type="primary" style={{ background: "#3fcf9e", border: "none", color: "#fff" }} onClick={(e)=>{e.stopPropagation(),this.submission(recard)}}>发布</Button>}
|
|
|
- {recard.auditStatus!='1'&&recard.auditStatus=='2'&&<Button type="success" onClick={(e)=>{ e.stopPropagation(),this.updateFun(recard)}}>刷新发布</Button>}
|
|
|
- {recard.auditStatus!='1'&&recard.auditStatus=='2'&&<Button type="danger" onClick={(e)=>{e.stopPropagation(),this.revokeFun(recard)}}>撤销发布</Button>}
|
|
|
+ {recard.status!='1'&&<Button type="primary" style={{ background: "#3fcf9e", border: "none", color: "#fff" }} onClick={(e)=>{e.stopPropagation(),this.submission(recard,1)}}>发布</Button>}
|
|
|
+ {recard.status=='1'&&<Button type="danger" onClick={(e)=>{e.stopPropagation(),this.submission(recard,3)}}>撤销发布</Button>}
|
|
|
</div>
|
|
|
}
|
|
|
}
|
|
@@ -133,7 +132,7 @@ const DemandList = React.createClass({
|
|
|
};
|
|
|
},
|
|
|
//发布
|
|
|
- submission(record){
|
|
|
+ submission(record,status){
|
|
|
this.setState({
|
|
|
showDesc:false,
|
|
|
loading:true
|
|
@@ -142,14 +141,14 @@ const DemandList = React.createClass({
|
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/news/updateStatus",
|
|
|
+ url: globalConfig.context + "/api/admin/community/updateCommunity",
|
|
|
data: {
|
|
|
id:record.id,
|
|
|
- auditStatus:2
|
|
|
+ status:status
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
|
- message.success('发布成功.');
|
|
|
+ message.success('操作成功.');
|
|
|
this.setState({
|
|
|
loading: false,
|
|
|
});
|
|
@@ -159,59 +158,6 @@ const DemandList = React.createClass({
|
|
|
};
|
|
|
}.bind(this));
|
|
|
},
|
|
|
- //刷新发布
|
|
|
- updateFun(recard){
|
|
|
- this.setState({
|
|
|
- loading:true
|
|
|
- })
|
|
|
- $.ajax({
|
|
|
- method: "POST",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context +'/api/admin/news/updateStatus',
|
|
|
- data: {
|
|
|
- id: recard.id,
|
|
|
- auditStatus:recard.auditStatus,
|
|
|
- refresh:1
|
|
|
- }
|
|
|
- }).done(function (data) {
|
|
|
- if (!data.error.length) {
|
|
|
- message.success('刷新成功!');
|
|
|
- this.setState({
|
|
|
- loading: false,
|
|
|
- });
|
|
|
- } else {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- };
|
|
|
- this.loadData(this.state.page);
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
- //撤销发布
|
|
|
- revokeFun(recard){
|
|
|
- this.setState({
|
|
|
- loading:true
|
|
|
- })
|
|
|
- $.ajax({
|
|
|
- method: "POST",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + '/api/admin/news/updateStatus',
|
|
|
- data: {
|
|
|
- id: recard.id,
|
|
|
- auditStatus:4,
|
|
|
- }
|
|
|
- }).done(function (data) {
|
|
|
- if (!data.error.length) {
|
|
|
- message.success('撤销成功!');
|
|
|
- this.setState({
|
|
|
- loading: false,
|
|
|
- });
|
|
|
- this.loadData(this.state.page);
|
|
|
- } else {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- };
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
componentWillMount() {
|
|
|
this.loadData();
|
|
|
},
|
|
@@ -235,9 +181,10 @@ const DemandList = React.createClass({
|
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/news/deleteById",
|
|
|
+ url: globalConfig.context + "/api/admin/community/updateCommunity",
|
|
|
data: {
|
|
|
- id: deletedIds[0]
|
|
|
+ id: deletedIds[0],
|
|
|
+ status:2
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
@@ -307,7 +254,7 @@ const DemandList = React.createClass({
|
|
|
value={this.state.auditStatusSearch}
|
|
|
onChange={(e) => { this.setState({ auditStatusSearch: e }) }}>
|
|
|
{
|
|
|
- releaseStateList.map(item=>{
|
|
|
+ proStatus.map(item=>{
|
|
|
return <Select.Option value={item.value} >{item.key}</Select.Option>
|
|
|
})
|
|
|
}
|