|
@@ -18,7 +18,7 @@ import {
|
|
|
InputNumber,
|
|
|
Radio
|
|
|
} from 'antd';
|
|
|
-import { getGameState, splitUrl, getprovince ,getReleaseStateList,getTypeModule
|
|
|
+import { getGameState, splitUrl, getprovince ,getReleaseStateList,getboutique,getTypeModule
|
|
|
} from '@/tools.js';
|
|
|
import { releaseStateList } from '@/dataDic.js';
|
|
|
|
|
@@ -91,6 +91,7 @@ const BusinessProject = Form.create()(
|
|
|
introduce: thisdata.introduce,
|
|
|
createTime: thisdata.createTime ? new Date(thisdata.createTime).toLocaleString() : '',
|
|
|
value: thisdata.value,
|
|
|
+ isHot:thisdata.isHot.toString(),
|
|
|
applyConditions: thisdata.applyConditions
|
|
|
});
|
|
|
}
|
|
@@ -208,6 +209,14 @@ const BusinessProject = Form.create()(
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
+ title: '是否热门',
|
|
|
+ dataIndex: 'isHot',
|
|
|
+ key: 'isHot',
|
|
|
+ render:text=>{
|
|
|
+ return getboutique(text);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
title: '市场价(万元)',
|
|
|
dataIndex: 'price',
|
|
|
key: 'price'
|
|
@@ -358,6 +367,70 @@ const BusinessProject = Form.create()(
|
|
|
editvisible: false
|
|
|
});
|
|
|
},
|
|
|
+ delectRow(recard) {
|
|
|
+ this.setState({
|
|
|
+ loading:true
|
|
|
+ })
|
|
|
+ let deletedIds =[];
|
|
|
+ let rowItem = this.state.selectedRowKeys[0];
|
|
|
+ let data = this.state.dataSource ||[];
|
|
|
+ if (data.length) {
|
|
|
+ deletedIds.push(data[rowItem].id);
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ method: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/jtBusiness/project/annul",
|
|
|
+ data: {
|
|
|
+ id: deletedIds[0]
|
|
|
+ }
|
|
|
+ }).done(function (data) {
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success('下架成功!');
|
|
|
+ this.setState({
|
|
|
+ loading: false,
|
|
|
+ selectedRowKeys:[],
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ this.loadData();
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ changeHot(recard) {
|
|
|
+ this.setState({
|
|
|
+ loading:true
|
|
|
+ })
|
|
|
+ let deletedIds =[];
|
|
|
+ let rowItem = this.state.selectedRowKeys[0];
|
|
|
+ let data = this.state.dataSource ||[];
|
|
|
+ if (data.length) {
|
|
|
+ deletedIds.push(data[rowItem].id);
|
|
|
+ deletedIds.push(data[rowItem].isHot);
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ method: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/jtBusiness/project/ifHot",
|
|
|
+ data: {
|
|
|
+ id: deletedIds[0],
|
|
|
+ isHot:deletedIds[1]
|
|
|
+ }
|
|
|
+ }).done(function (data) {
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success('修改成功!');
|
|
|
+ this.setState({
|
|
|
+ loading: false,
|
|
|
+ selectedRowKeys:[],
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ this.loadData();
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
search() {
|
|
|
this.loadData();
|
|
|
},
|
|
@@ -391,6 +464,7 @@ const BusinessProject = Form.create()(
|
|
|
}
|
|
|
};
|
|
|
const theData = this.state.data || {};
|
|
|
+ const hasSelect = this.state.selectedRowKeys.length;
|
|
|
return (
|
|
|
<div className="user-content">
|
|
|
<div className="content-title">
|
|
@@ -434,6 +508,8 @@ const BusinessProject = Form.create()(
|
|
|
<Button onClick={this.reset} style={{ marginRight: '10px' }}>
|
|
|
重置
|
|
|
</Button>
|
|
|
+ <Button type="danger" disabled={!hasSelect} onClick={(e)=>{this.delectRow()}}>下架</Button>
|
|
|
+ <Button type="primary" disabled={!hasSelect} onClick={(e)=>{this.changeHot()}}>修改是否热门</Button>
|
|
|
</div>
|
|
|
<div className="patent-table">
|
|
|
<Spin spinning={this.state.loading}>
|