|
@@ -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 } from 'antd';
|
4
|
4
|
import router from 'umi/router';
|
5
|
5
|
import moment from 'moment';
|
6
|
6
|
import styles from './style.less';
|
|
@@ -12,184 +12,203 @@ function header(props) {
|
12
|
12
|
|
13
|
13
|
const [houseIdList, setHouseIdList] = useState([])
|
14
|
14
|
|
|
15
|
+ useEffect(() => {
|
|
16
|
+ getList({ pageNum: 1, pageSize: 10 });
|
|
17
|
+ }, [])
|
|
18
|
+ // 查询列表
|
|
19
|
+ const getList = params => {
|
|
20
|
+ // request({ ...apis.house.taSalesBatch, params: { ...params } }).then(data => {
|
|
21
|
+ // console.log(data)
|
|
22
|
+ // setData(data)
|
|
23
|
+ // })
|
|
24
|
+ }
|
|
25
|
+
|
|
26
|
+ const toEditResource = (id) => () => {
|
|
27
|
+ router.push({
|
|
28
|
+ pathname: '/resource/edit',
|
|
29
|
+ // query: {
|
|
30
|
+ // id
|
|
31
|
+ // },
|
|
32
|
+ });
|
|
33
|
+ }
|
|
34
|
+
|
15
|
35
|
const handleSubmit = (e, props) => {
|
16
|
36
|
e.preventDefault();
|
17
|
|
-
|
18
|
|
- }
|
19
|
37
|
|
20
|
|
- function handleReset() {
|
|
38
|
+ }
|
|
39
|
+
|
|
40
|
+ function handleReset() {
|
21
|
41
|
props.form.resetFields();
|
22
|
42
|
// getList({ pageNum: 1, pageSize: 10 });
|
23
|
|
- }
|
|
43
|
+ }
|
24
|
44
|
|
25
|
|
- const toEditGoods = (goodsId) => () => {
|
26
|
|
- // router.push({
|
27
|
|
- // pathname: '/integralMall/editGoods',
|
28
|
|
- // query: {
|
29
|
|
- // goodsId
|
30
|
|
- // },
|
31
|
|
- // });
|
32
|
|
- }
|
33
|
|
-
|
34
|
|
- const toDelBatch = rowData => () =>{
|
|
45
|
+ const toDelBatch = rowData => () => {
|
35
|
46
|
console.log(houseIdList, 'houseIdListhouseIdList')
|
36
|
|
- if(houseIdList.length < 1){
|
37
|
|
- openNotificationWithIcon('error', '请先选择需要删除的批次')
|
38
|
|
- return
|
|
47
|
+ if (houseIdList.length < 1) {
|
|
48
|
+ openNotificationWithIcon('error', '请先选择需要删除的批次')
|
|
49
|
+ return
|
39
|
50
|
}
|
40
|
|
-
|
|
51
|
+
|
41
|
52
|
Modal.confirm({
|
42
|
|
- title: '确定删除批次信息吗',
|
43
|
|
- okText: '确定',
|
44
|
|
- cancelText: '取消',
|
45
|
|
- onOk () {
|
46
|
|
- // request({ ...apis.house.deleteTaSalesBatch, data: houseIdList, }).then((data) => {
|
47
|
|
- // message.info("操作成功")
|
48
|
|
- // getList({ pageNum: 1, pageSize: 10 });
|
49
|
|
- // }).catch((err) => {
|
50
|
|
- // })
|
51
|
|
- },
|
|
53
|
+ title: '确定删除批次信息吗',
|
|
54
|
+ okText: '确定',
|
|
55
|
+ cancelText: '取消',
|
|
56
|
+ onOk() {
|
|
57
|
+ // request({ ...apis.house.deleteTaSalesBatch, data: houseIdList, }).then((data) => {
|
|
58
|
+ // message.info("操作成功")
|
|
59
|
+ // getList({ pageNum: 1, pageSize: 10 });
|
|
60
|
+ // }).catch((err) => {
|
|
61
|
+ // })
|
|
62
|
+ },
|
52
|
63
|
});
|
53
|
|
- }
|
|
64
|
+ }
|
54
|
65
|
|
55
|
|
- const rowSelection = {
|
|
66
|
+ const rowSelection = {
|
56
|
67
|
onChange: (selectedRowKeys, selectedRows) => {
|
57
|
|
- console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
|
58
|
|
- setHouseIdList(selectedRows)
|
|
68
|
+ console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
|
|
69
|
+ setHouseIdList(selectedRows)
|
59
|
70
|
},
|
60
|
|
- };
|
|
71
|
+ };
|
61
|
72
|
|
62
|
|
- const data =[]
|
|
73
|
+ const changePageNum = pageNumber => {
|
|
74
|
+ // getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
|
|
75
|
+ }
|
63
|
76
|
|
64
|
|
- const columns = [
|
|
77
|
+ const data = []
|
|
78
|
+
|
|
79
|
+ const columns = [
|
65
|
80
|
{
|
66
|
|
- title: '通知标题',
|
67
|
|
- dataIndex: 'title',
|
68
|
|
- key: 'title',
|
69
|
|
- align: 'center',
|
70
|
|
- render: (text, record) => <img src={record.imgUrl} className={styles.touxiang} />,
|
|
81
|
+ title: '通知标题',
|
|
82
|
+ dataIndex: 'title',
|
|
83
|
+ key: 'title',
|
|
84
|
+ align: 'center',
|
|
85
|
+
|
71
|
86
|
},
|
72
|
87
|
{
|
73
|
|
- title: '通知图',
|
74
|
|
- dataIndex: 'imgUrl',
|
75
|
|
- key: 'imgUrl',
|
76
|
|
- align: 'center',
|
77
|
|
-
|
|
88
|
+ title: '通知图',
|
|
89
|
+ dataIndex: 'imgUrl',
|
|
90
|
+ key: 'imgUrl',
|
|
91
|
+ align: 'center',
|
|
92
|
+ render: (text, record) => <img src={record.imgUrl} className={styles.touxiang} />,
|
78
|
93
|
},
|
79
|
94
|
{
|
80
|
|
- title: '关联业务类型',
|
81
|
|
- dataIndex: 'pointPrice',
|
82
|
|
- key: 'pointPrice',
|
83
|
|
- align: 'center',
|
|
95
|
+ title: '关联业务类型',
|
|
96
|
+ dataIndex: 'pointPrice',
|
|
97
|
+ key: 'pointPrice',
|
|
98
|
+ align: 'center',
|
84
|
99
|
},
|
85
|
100
|
{
|
86
|
|
- title: '关联业务',
|
87
|
|
- dataIndex: 'totalNum',
|
88
|
|
- key: 'totalNum',
|
89
|
|
- align: 'center',
|
|
101
|
+ title: '关联业务',
|
|
102
|
+ dataIndex: 'totalNum',
|
|
103
|
+ key: 'totalNum',
|
|
104
|
+ align: 'center',
|
90
|
105
|
},
|
91
|
106
|
{
|
92
|
|
- title: '发布状态',
|
93
|
|
- dataIndex: 'status',
|
94
|
|
- key: 'status',
|
95
|
|
- align: 'center',
|
96
|
|
- // render: (status)=> <><span>{status == 1 ? '是' : '否'}</span></>
|
|
107
|
+ title: '发布状态',
|
|
108
|
+ dataIndex: 'status',
|
|
109
|
+ key: 'status',
|
|
110
|
+ align: 'center',
|
|
111
|
+ // render: (status) => <><span>{status == 1 ? '是' : '否'}</span></>
|
97
|
112
|
},
|
98
|
113
|
{
|
99
|
|
- title: '自动下架时间',
|
100
|
|
- dataIndex: 'inventory',
|
101
|
|
- key: 'inventory',
|
102
|
|
- align: 'center',
|
|
114
|
+ title: '自动下架时间',
|
|
115
|
+ dataIndex: 'inventory',
|
|
116
|
+ key: 'inventory',
|
|
117
|
+ align: 'center',
|
103
|
118
|
},
|
104
|
119
|
{
|
105
|
|
- title: '权重',
|
106
|
|
- dataIndex: 'status',
|
107
|
|
- key: 'status',
|
108
|
|
- align: 'center',
|
109
|
|
-
|
|
120
|
+ title: '权重',
|
|
121
|
+ dataIndex: 'status',
|
|
122
|
+ key: 'status',
|
|
123
|
+ align: 'center',
|
|
124
|
+
|
110
|
125
|
},
|
111
|
126
|
{
|
112
|
127
|
title: '新增时间',
|
113
|
128
|
dataIndex: 'inventory',
|
114
|
129
|
key: 'inventory',
|
115
|
130
|
align: 'center',
|
116
|
|
- },
|
|
131
|
+ },
|
117
|
132
|
{
|
118
|
|
- title: '操作',
|
119
|
|
- dataIndex: 'handle',
|
120
|
|
- key: 'handle',
|
121
|
|
- align: 'center',
|
122
|
|
- render: (x, row) => (
|
123
|
|
- <>
|
124
|
|
-
|
125
|
|
-
|
126
|
|
- <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={toEditGoods(row.goodsId)}>
|
127
|
|
- 编辑<Icon type="form" className={styles.edit} />
|
128
|
|
- </span>
|
129
|
|
-
|
130
|
|
- </>
|
131
|
|
- ),
|
|
133
|
+ title: '操作',
|
|
134
|
+ dataIndex: 'handle',
|
|
135
|
+ key: 'handle',
|
|
136
|
+ align: 'center',
|
|
137
|
+ render: (x, row) => (
|
|
138
|
+ <>
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+ <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.goodsId)}>
|
|
142
|
+ 编辑<Icon type="form" className={styles.edit} />
|
|
143
|
+ </span>
|
|
144
|
+
|
|
145
|
+ </>
|
|
146
|
+ ),
|
132
|
147
|
},
|
133
|
|
- ];
|
|
148
|
+ ];
|
134
|
149
|
|
135
|
150
|
const { getFieldDecorator } = props.form
|
136
|
|
- return (
|
137
|
|
-
|
138
|
|
- <>
|
139
|
|
- <div>
|
140
|
|
- <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
141
|
|
- <Form.Item>
|
142
|
|
- {getFieldDecorator('goodsName')(
|
143
|
|
- <Input
|
144
|
|
- prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
145
|
|
- placeholder="通知标题"
|
146
|
|
- />,
|
147
|
|
- )}
|
148
|
|
- </Form.Item>
|
149
|
|
- <Form.Item>
|
150
|
|
- {getFieldDecorator('status')(
|
151
|
|
- <Select style={{ width: '180px' }} placeholder="关联业务类型">
|
152
|
|
-
|
153
|
|
- </Select>,
|
154
|
|
- )}
|
155
|
|
- </Form.Item>
|
156
|
|
-
|
157
|
|
- <Form.Item>
|
158
|
|
- {getFieldDecorator('priceLesser')(
|
159
|
|
- <Input
|
160
|
|
- prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
161
|
|
- placeholder="关联业务"
|
162
|
|
- />,
|
163
|
|
- )}
|
164
|
|
- </Form.Item>
|
165
|
|
- <Form.Item>
|
166
|
|
- {getFieldDecorator('qbc')(
|
167
|
|
- <Input
|
168
|
|
- prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
169
|
|
- placeholder="发布状态"
|
170
|
|
- />,
|
171
|
|
- )}
|
172
|
|
- </Form.Item>
|
173
|
|
- <Form.Item>
|
174
|
|
-
|
175
|
|
- <Button type="primary" htmlType="submit" className={styles.searchBtn}>
|
176
|
|
- 搜索
|
|
151
|
+ return (
|
|
152
|
+
|
|
153
|
+ <>
|
|
154
|
+ <div>
|
|
155
|
+ <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
|
|
156
|
+ <Form.Item>
|
|
157
|
+ {getFieldDecorator('goodsName')(
|
|
158
|
+ <Input
|
|
159
|
+ prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
|
160
|
+ placeholder="通知标题"
|
|
161
|
+ />,
|
|
162
|
+ )}
|
|
163
|
+ </Form.Item>
|
|
164
|
+ <Form.Item>
|
|
165
|
+ {getFieldDecorator('status')(
|
|
166
|
+ <Select style={{ width: '180px' }} placeholder="关联业务类型">
|
|
167
|
+
|
|
168
|
+ </Select>,
|
|
169
|
+ )}
|
|
170
|
+ </Form.Item>
|
|
171
|
+
|
|
172
|
+ <Form.Item>
|
|
173
|
+ {getFieldDecorator('priceLesser')(
|
|
174
|
+ <Input
|
|
175
|
+ prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
|
176
|
+ placeholder="关联业务"
|
|
177
|
+ />,
|
|
178
|
+ )}
|
|
179
|
+ </Form.Item>
|
|
180
|
+ <Form.Item>
|
|
181
|
+ {getFieldDecorator('qbc')(
|
|
182
|
+ <Input
|
|
183
|
+ prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
|
|
184
|
+ placeholder="发布状态"
|
|
185
|
+ />,
|
|
186
|
+ )}
|
|
187
|
+ </Form.Item>
|
|
188
|
+ <Form.Item>
|
|
189
|
+
|
|
190
|
+ <Button type="primary" htmlType="submit" className={styles.searchBtn}>
|
|
191
|
+ 搜索
|
177
|
192
|
</Button>
|
178
|
|
- {/* */}
|
179
|
|
- <Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
180
|
|
- 重置
|
|
193
|
+ {/* */}
|
|
194
|
+ <Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
|
195
|
+ 重置
|
181
|
196
|
</Button>
|
182
|
|
- </Form.Item>
|
183
|
|
- </Form>
|
|
197
|
+ </Form.Item>
|
|
198
|
+ </Form>
|
|
199
|
+
|
|
200
|
+ <Button type="danger" className={styles.addBtn} onClick={toEditResource()}>新增</Button>
|
184
|
201
|
|
185
|
|
- <Button type="danger" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
|
|
202
|
+ <Button type="primary" className={styles.addBtn} onClick={toDelBatch()} style={{ marginLeft: '30px' }} >删除</Button>
|
186
|
203
|
|
187
|
|
- <Button type="danger" className={styles.addBtn} onClick={toDelBatch()} style={{marginLeft:'30px'}} >删除</Button>
|
|
204
|
+ <Table rowSelection={rowSelection} rowKey="goodsList" dataSource={data} columns={columns} pagination={false} />
|
188
|
205
|
|
189
|
|
- <Table rowSelection={rowSelection} rowKey="goodsList" dataSource={data} columns={columns} pagination={false} />
|
190
|
|
- </div>
|
191
|
|
- </>
|
192
|
|
- )
|
|
206
|
+ <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
|
|
207
|
+ {/* <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current} /> */}
|
|
208
|
+ </div>
|
|
209
|
+ </div>
|
|
210
|
+ </>
|
|
211
|
+ )
|
193
|
212
|
}
|
194
|
213
|
|
195
|
214
|
const WrappedHeader = Form.create({ name: 'header' })(header);
|