|
@@ -1,6 +1,6 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
2
|
import { PageHeaderWrapper } from '@ant-design/pro-layout';
|
3
|
|
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb } from 'antd';
|
|
3
|
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb,Radio } from 'antd';
|
4
|
4
|
import router from 'umi/router';
|
5
|
5
|
import moment from 'moment';
|
6
|
6
|
import styles from './style.less';
|
|
@@ -8,11 +8,14 @@ import { fetch, apis } from '../../utils/request';
|
8
|
8
|
import request from '../../utils/request';
|
9
|
9
|
import AuthButton from '@/components/AuthButton';
|
10
|
10
|
import Navigate from '@/components/Navigate';
|
|
11
|
+import ModelForm from './components/ModelForm';
|
11
|
12
|
|
12
|
13
|
function header(props) {
|
13
|
14
|
|
14
|
15
|
const [taNoticeList, setTaNoticeList] = useState([])
|
15
|
16
|
const [ data, setData ] = useState({})
|
|
17
|
+ const [visible, setVisible] = useState(false);
|
|
18
|
+ const [currentData, setCurrentData] = useState(false);
|
16
|
19
|
|
17
|
20
|
useEffect(() => {
|
18
|
21
|
getList({ pageNum: 1, pageSize: 10 });
|
|
@@ -34,9 +37,9 @@ function header(props) {
|
34
|
37
|
});
|
35
|
38
|
}
|
36
|
39
|
|
37
|
|
- const publishNew = (row) => () => {
|
38
|
|
- row.status = row.status === 1 ? 0 : 1
|
39
|
|
- editNewsById(row)
|
|
40
|
+ const openModel = (row) => () => {
|
|
41
|
+ setVisible(true)
|
|
42
|
+ setCurrentData(row)
|
40
|
43
|
}
|
41
|
44
|
|
42
|
45
|
const topNew = (row) => () => {
|
|
@@ -94,6 +97,20 @@ function header(props) {
|
94
|
97
|
getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
|
95
|
98
|
}
|
96
|
99
|
|
|
100
|
+ const deleteContact =(row) => () => {
|
|
101
|
+ Modal.confirm({
|
|
102
|
+ title: '确认将所选数据删除?',
|
|
103
|
+ okText: '确定',
|
|
104
|
+ cancelText: '取消',
|
|
105
|
+ onOk() {
|
|
106
|
+ request({ ...apis.promote.update, urlData: { id: row.serialNo }, data: { status: -1} }).then((data) => {
|
|
107
|
+ message.info("操作成功")
|
|
108
|
+ getList({ pageNum: 1, pageSize: 10 });
|
|
109
|
+ })
|
|
110
|
+ },
|
|
111
|
+ });
|
|
112
|
+ }
|
|
113
|
+
|
97
|
114
|
|
98
|
115
|
const columns = [
|
99
|
116
|
{
|
|
@@ -148,11 +165,11 @@ function header(props) {
|
148
|
165
|
align: 'center',
|
149
|
166
|
render: (x, row) => (
|
150
|
167
|
<>
|
151
|
|
- <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={publishNew(row)}>
|
|
168
|
+ <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={openModel(row)}>
|
152
|
169
|
{row.status === 2 ? "立即跟进" : '添加备注'}<Icon type="form" className={styles.edit} />
|
153
|
170
|
</span>
|
154
|
|
- <span style={{ color: '#FF925C', cursor: 'pointer', marginLeft: '20px' }} onClick={publishNew(row)}>
|
155
|
|
- {row.status === 0 ? "删除" : ''}<Icon type="form" className={styles.edit} />
|
|
171
|
+ <span style={{ color: '#FF925C', cursor: 'pointer', marginLeft: '20px' }} onClick={deleteContact(row)}>
|
|
172
|
+ {row.status === 0 ? <span>删除<Icon type="form" className={styles.edit} /></span> : ''}
|
156
|
173
|
</span>
|
157
|
174
|
</>
|
158
|
175
|
),
|
|
@@ -167,6 +184,14 @@ function header(props) {
|
167
|
184
|
setTaNoticeList(selectedRows)
|
168
|
185
|
},
|
169
|
186
|
};
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+ const modelCancel = (state) => {
|
|
190
|
+ setVisible(false)
|
|
191
|
+ if(state === "success"){
|
|
192
|
+ getList({ pageNum: 1, pageSize: 10 });
|
|
193
|
+ }
|
|
194
|
+ }
|
170
|
195
|
|
171
|
196
|
return (
|
172
|
197
|
|
|
@@ -227,6 +252,8 @@ function header(props) {
|
227
|
252
|
<Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current} />
|
228
|
253
|
</div>
|
229
|
254
|
</div>
|
|
255
|
+
|
|
256
|
+ <ModelForm visible={visible} currentData={currentData} onCancel={(state) => modelCancel(state)}/>
|
230
|
257
|
</>
|
231
|
258
|
)
|
232
|
259
|
}
|