|
@@ -1,19 +1,197 @@
|
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
|
4
|
import router from 'umi/router';
|
|
5
|
+import moment from 'moment';
|
|
6
|
+import styles from './style.less';
|
|
7
|
+import { fetch, apis } from '../../utils/request';
|
|
8
|
+import request from '../../utils/request';
|
|
9
|
+import AuthButton from '@/components/AuthButton';
|
4
|
10
|
|
5
|
|
-function WrappedHeader(props) {
|
|
11
|
+function header(props) {
|
6
|
12
|
|
|
13
|
+ const [houseIdList, setHouseIdList] = useState([])
|
7
|
14
|
|
|
15
|
+ const handleSubmit = (e, props) => {
|
|
16
|
+ e.preventDefault();
|
|
17
|
+
|
|
18
|
+ }
|
8
|
19
|
|
9
|
|
-
|
|
20
|
+ function handleReset() {
|
|
21
|
+ props.form.resetFields();
|
|
22
|
+ // getList({ pageNum: 1, pageSize: 10 });
|
|
23
|
+ }
|
|
24
|
+
|
|
25
|
+ const toEditGoods = (goodsId) => () => {
|
|
26
|
+ // router.push({
|
|
27
|
+ // pathname: '/integralMall/editGoods',
|
|
28
|
+ // query: {
|
|
29
|
+ // goodsId
|
|
30
|
+ // },
|
|
31
|
+ // });
|
|
32
|
+ }
|
|
33
|
+
|
|
34
|
+ const toDelBatch = rowData => () =>{
|
|
35
|
+ console.log(houseIdList, 'houseIdListhouseIdList')
|
|
36
|
+ if(houseIdList.length < 1){
|
|
37
|
+ openNotificationWithIcon('error', '请先选择需要删除的批次')
|
|
38
|
+ return
|
|
39
|
+ }
|
|
40
|
+
|
|
41
|
+ 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
|
+ },
|
|
52
|
+ });
|
|
53
|
+ }
|
|
54
|
+
|
|
55
|
+ const rowSelection = {
|
|
56
|
+ onChange: (selectedRowKeys, selectedRows) => {
|
|
57
|
+ console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
|
|
58
|
+ setHouseIdList(selectedRows)
|
|
59
|
+ },
|
|
60
|
+ };
|
|
61
|
+
|
|
62
|
+ const data =[]
|
|
63
|
+
|
|
64
|
+ const columns = [
|
|
65
|
+ {
|
|
66
|
+ title: '通知标题',
|
|
67
|
+ dataIndex: 'title',
|
|
68
|
+ key: 'title',
|
|
69
|
+ align: 'center',
|
|
70
|
+ render: (text, record) => <img src={record.imgUrl} className={styles.touxiang} />,
|
|
71
|
+ },
|
|
72
|
+ {
|
|
73
|
+ title: '通知图',
|
|
74
|
+ dataIndex: 'imgUrl',
|
|
75
|
+ key: 'imgUrl',
|
|
76
|
+ align: 'center',
|
|
77
|
+
|
|
78
|
+ },
|
|
79
|
+ {
|
|
80
|
+ title: '关联业务类型',
|
|
81
|
+ dataIndex: 'pointPrice',
|
|
82
|
+ key: 'pointPrice',
|
|
83
|
+ align: 'center',
|
|
84
|
+ },
|
|
85
|
+ {
|
|
86
|
+ title: '关联业务',
|
|
87
|
+ dataIndex: 'totalNum',
|
|
88
|
+ key: 'totalNum',
|
|
89
|
+ align: 'center',
|
|
90
|
+ },
|
|
91
|
+ {
|
|
92
|
+ title: '发布状态',
|
|
93
|
+ dataIndex: 'status',
|
|
94
|
+ key: 'status',
|
|
95
|
+ align: 'center',
|
|
96
|
+ // render: (status)=> <><span>{status == 1 ? '是' : '否'}</span></>
|
|
97
|
+ },
|
|
98
|
+ {
|
|
99
|
+ title: '自动下架时间',
|
|
100
|
+ dataIndex: 'inventory',
|
|
101
|
+ key: 'inventory',
|
|
102
|
+ align: 'center',
|
|
103
|
+ },
|
|
104
|
+ {
|
|
105
|
+ title: '权重',
|
|
106
|
+ dataIndex: 'status',
|
|
107
|
+ key: 'status',
|
|
108
|
+ align: 'center',
|
|
109
|
+
|
|
110
|
+ },
|
|
111
|
+ {
|
|
112
|
+ title: '新增时间',
|
|
113
|
+ dataIndex: 'inventory',
|
|
114
|
+ key: 'inventory',
|
|
115
|
+ align: 'center',
|
|
116
|
+ },
|
|
117
|
+ {
|
|
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
|
+ ),
|
|
132
|
+ },
|
|
133
|
+ ];
|
|
134
|
+
|
|
135
|
+ const { getFieldDecorator } = props.form
|
10
|
136
|
return (
|
11
|
137
|
|
12
|
138
|
<>
|
13
|
|
- <div>123</div>
|
|
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
|
+ 搜索
|
|
177
|
+ </Button>
|
|
178
|
+ {/* */}
|
|
179
|
+ <Button style={{ marginLeft: 8 }} onClick={handleReset}>
|
|
180
|
+ 重置
|
|
181
|
+ </Button>
|
|
182
|
+ </Form.Item>
|
|
183
|
+ </Form>
|
|
184
|
+
|
|
185
|
+ <Button type="danger" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
|
|
186
|
+
|
|
187
|
+ <Button type="danger" className={styles.addBtn} onClick={toDelBatch()} style={{marginLeft:'30px'}} >删除</Button>
|
|
188
|
+
|
|
189
|
+ <Table rowSelection={rowSelection} rowKey="goodsList" dataSource={data} columns={columns} pagination={false} />
|
|
190
|
+ </div>
|
14
|
191
|
</>
|
15
|
192
|
)
|
16
|
193
|
}
|
17
|
194
|
|
|
195
|
+const WrappedHeader = Form.create({ name: 'header' })(header);
|
18
|
196
|
|
19
|
197
|
export default WrappedHeader
|