|
@@ -21,7 +21,7 @@ const tempDate = [{ code: 's101' }]
|
21
|
21
|
*/
|
22
|
22
|
function CartBody(props) {
|
23
|
23
|
const { data } = props
|
24
|
|
-
|
|
24
|
+ console.log(data);
|
25
|
25
|
const cancelPage = () =>{
|
26
|
26
|
router.push({
|
27
|
27
|
pathname: '/news/list/NewsList',
|
|
@@ -66,6 +66,29 @@ function CartBody(props) {
|
66
|
66
|
newsId
|
67
|
67
|
},
|
68
|
68
|
});
|
|
69
|
+ }
|
|
70
|
+
|
|
71
|
+ function cancelRelease (newsId, newsStatus, buildingId,newsTypeId) {
|
|
72
|
+ console.log("newsId" + newsId + "status" + newsStatus);
|
|
73
|
+ Modal.confirm({
|
|
74
|
+ title: '确认发布或取消该资讯?',
|
|
75
|
+ okText: '确认',
|
|
76
|
+ cancelText: '取消',
|
|
77
|
+ onOk () {
|
|
78
|
+ request({
|
|
79
|
+ url: '/api/admin/taNews/' + newsId,
|
|
80
|
+ method: 'PUT',
|
|
81
|
+ data: { "newsStatus": newsStatus, "buildingId":buildingId, "newsTypeId":newsTypeId },
|
|
82
|
+ }).then((data) => {
|
|
83
|
+ message.info('操作成功!')
|
|
84
|
+ getList({ pageNum: 1, pageSize: 10 });
|
|
85
|
+ })
|
|
86
|
+ },
|
|
87
|
+ onCancel () {
|
|
88
|
+ console.log('Cancel');
|
|
89
|
+ },
|
|
90
|
+ });
|
|
91
|
+
|
69
|
92
|
}
|
70
|
93
|
|
71
|
94
|
return (
|
|
@@ -108,10 +131,17 @@ function CartBody(props) {
|
108
|
131
|
<span >:{ data.createDate }</span>
|
109
|
132
|
</p>
|
110
|
133
|
<p style={{ margin: '15px 0', position: 'relative', fontSize: '18px' }}>
|
111
|
|
- <span style={{ color: '#1990FF' }}>
|
112
|
|
- 取消发布
|
113
|
|
- <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
|
|
134
|
+ {data.newsStatus === 0 ?
|
|
135
|
+ <span style={{ color: '#1990FF' }} onClick={cancelRelease.bind(this,data.newsId, 1, data.buildingId, data.newsType.newsTypeId)}>
|
|
136
|
+ 取消发布
|
|
137
|
+ <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
|
|
138
|
+ </span>:
|
|
139
|
+ <span style={{ color: '#1990FF' }} onClick={cancelRelease.bind(this,data.newsId, 0, data.buildingId, data.newsType.newsTypeId)}>
|
|
140
|
+ 发布
|
|
141
|
+ <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
|
114
|
142
|
</span>
|
|
143
|
+ }
|
|
144
|
+
|
115
|
145
|
<span style={{
|
116
|
146
|
color: '#FF4A4A', position: 'absolute', right: '0',
|
117
|
147
|
}} onClick={changeNewsListStatus(data.newsId)}>
|