|
@@ -1,32 +1,41 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
2
|
import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
|
3
|
|
-import { FormattedMessage } from 'umi-plugin-react/locale';
|
|
3
|
+// import { FormattedMessage } from 'umi-plugin-react/locale';
|
4
|
4
|
import styles from '../style/GoodsList.less';
|
5
|
5
|
import router from 'umi/router';
|
6
|
6
|
import moment from 'moment';
|
7
|
|
-import SelectCity from '../../components/SelectButton/CitySelect'
|
8
|
|
-import BuildSelect from '../../components/SelectButton/BuildSelect'
|
9
|
|
-import apis from '../../services/apis';
|
10
|
|
-import request from '../../utils/request'
|
|
7
|
+// import SelectCity from '../../components/SelectButton/CitySelect'
|
|
8
|
+// import BuildSelect from '../../components/SelectButton/BuildSelect'
|
|
9
|
+// import apis from '../../services/apis';
|
|
10
|
+// import request from '../../utils/request'
|
|
11
|
+import { fetch, apis } from '../../utils/request'
|
|
12
|
+// import { useQuery } from '../../utils/hooks'
|
|
13
|
+import PaginationWrapper from '../../components/PaginationWrapper'
|
|
14
|
+import SearchForm from '../../components/SearchForm'
|
11
|
15
|
|
12
|
|
-const { Option } = Select;
|
13
|
|
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
|
16
|
+// const { Option } = Select;
|
|
17
|
+// const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
|
18
|
+
|
|
19
|
+const getMessageList = fetch(apis.system.taCustomerMessage)
|
14
|
20
|
|
15
|
21
|
const header = (props) => {
|
16
|
|
- const [ data, setData ] = useState({})
|
17
|
|
-// const [page, changePage] = useState({})
|
|
22
|
+ // const [ data, setData ] = useState({})
|
|
23
|
+// // const [page, changePage] = useState({})
|
|
24
|
+
|
|
25
|
+// useEffect(() => {
|
|
26
|
+// getList({ pageNum: 1, pageSize: 10 });
|
|
27
|
+// },[])
|
18
|
28
|
|
19
|
|
- useEffect(() => {
|
20
|
|
- getList({ pageNum: 1, pageSize: 10 });
|
21
|
|
- },[])
|
|
29
|
+// // 查询列表
|
|
30
|
+// const getList = (params) => {
|
|
31
|
+// request({ ...apis.system.taCustomerMessage, params: { ...params },}).then((data) => {
|
|
32
|
+// console.log(data)
|
|
33
|
+// setData(data)
|
|
34
|
+// })
|
|
35
|
+// }
|
22
|
36
|
|
23
|
|
- // 查询列表
|
24
|
|
- const getList = (params) => {
|
25
|
|
- request({ ...apis.system.taCustomerMessage, params: { ...params },}).then((data) => {
|
26
|
|
- console.log(data)
|
27
|
|
- setData(data)
|
28
|
|
- })
|
29
|
|
- }
|
|
37
|
+ // const [pageNum, setPage] = useState(1)
|
|
38
|
+ // const [data, loading, err] = useQuery({params: { pageNum }}, getMessageList)
|
30
|
39
|
|
31
|
40
|
const columns = [
|
32
|
41
|
{
|
|
@@ -51,22 +60,49 @@ const header = (props) => {
|
51
|
60
|
];
|
52
|
61
|
|
53
|
62
|
|
54
|
|
- const changePageNum = (pageNumber) => {
|
55
|
|
- getList({ pageNum: pageNumber, pageSize: 10 })
|
56
|
|
- }
|
|
63
|
+ // const changePageNum = (pageNumber) => {
|
|
64
|
+ // getList({ pageNum: pageNumber, pageSize: 10 })
|
|
65
|
+ // }
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+ console.log('------render messagelist-------')
|
57
|
69
|
|
58
|
70
|
|
59
|
|
- const { getFieldDecorator } = props.form
|
|
71
|
+ // const { getFieldDecorator } = props.form
|
60
|
72
|
return (
|
61
|
|
-
|
62
|
73
|
<>
|
63
|
|
- <Table rowKey="messageList" dataSource={data.records} columns={columns} pagination={false}/>
|
64
|
|
- <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
|
65
|
|
- <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
|
66
|
|
- </div>
|
|
74
|
+ <SearchForm
|
|
75
|
+ onSearch={console.log}
|
|
76
|
+ fields={[
|
|
77
|
+ {
|
|
78
|
+ label: 'Foo',
|
|
79
|
+ name: 'foo',
|
|
80
|
+ element: <Input />,
|
|
81
|
+ },
|
|
82
|
+ {
|
|
83
|
+ label: 'Bar',
|
|
84
|
+ name: 'bar',
|
|
85
|
+ element: (<Select style={{ width: '200px' }}>
|
|
86
|
+ <Select.Option value={1}>a</Select.Option>
|
|
87
|
+ <Select.Option value={2}>b</Select.Option>
|
|
88
|
+ </Select>)
|
|
89
|
+ },
|
|
90
|
+ ]}
|
|
91
|
+ ></SearchForm>
|
|
92
|
+ <PaginationWrapper
|
|
93
|
+ request={getMessageList}
|
|
94
|
+ render={data => <Table rowKey={record => record.messageId} dataSource={data.records} columns={columns} pagination={false}/>}
|
|
95
|
+ >
|
|
96
|
+ </PaginationWrapper>
|
67
|
97
|
</>
|
|
98
|
+ // <>
|
|
99
|
+ // <Table rowKey="messageList" dataSource={data.records} columns={columns} pagination={false}/>
|
|
100
|
+ // <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
|
|
101
|
+ // <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={pg => setPage(pg)} current={data.current}/>
|
|
102
|
+ // </div>
|
|
103
|
+ // </>
|
68
|
104
|
)
|
69
|
105
|
}
|
70
|
|
-const WrappedHeader = Form.create({ name: 'header' })(header);
|
|
106
|
+// const WrappedHeader = Form.create({ name: 'header' })(header);
|
71
|
107
|
|
72
|
|
-export default WrappedHeader
|
|
108
|
+export default header
|