|
@@ -5,6 +5,7 @@ import channels from './channelList.less';
|
5
|
5
|
import router from 'umi/router';
|
6
|
6
|
import apis from '../../services/apis';
|
7
|
7
|
import request from '../../utils/request'
|
|
8
|
+import Navigate from '@/components/Navigate';
|
8
|
9
|
|
9
|
10
|
const { Option } = Select;
|
10
|
11
|
function handleChange(value) {
|
|
@@ -43,7 +44,7 @@ const columns = [
|
43
|
44
|
dataIndex: 'nickname',
|
44
|
45
|
key: 'nickname',
|
45
|
46
|
align: 'center',
|
46
|
|
- render: (text, list) => <><span>{ list.name || list.nickname }</span></>,
|
|
47
|
+ render: (text, list) => <><span>{list.name || list.nickname}</span></>,
|
47
|
48
|
},
|
48
|
49
|
{
|
49
|
50
|
title: '电话',
|
|
@@ -56,14 +57,15 @@ const columns = [
|
56
|
57
|
dataIndex: 'sex',
|
57
|
58
|
key: 'sex',
|
58
|
59
|
align: 'center',
|
59
|
|
- render: (text, list) => <a>{list.gender === '1' ? '男' : list.gender === '2' ? '女':'未知'}</a>,
|
|
60
|
+ render: (text, list) => <a>{list.gender === '1' ? '男' : list.gender === '2' ? '女' : '未知'}</a>,
|
60
|
61
|
},
|
61
|
62
|
{
|
62
|
63
|
title: '推荐客户',
|
63
|
64
|
dataIndex: 'recommendCount',
|
64
|
65
|
key: 'recommendCount',
|
65
|
66
|
align: 'center',
|
66
|
|
- render: (text, list) => <a style={ { color: '#66B3FF' } } onClick= {() => torecommend(list.personId)} >{ list.recommendCount }</a>,
|
|
67
|
+ // render: (text, list) => <a style={ { color: '#66B3FF' } } onClick= {() => torecommend(list.personId)} >{ list.recommendCount }</a>,
|
|
68
|
+ render: (text, list) => <Navigate onClick={() => torecommend(list.personId)} >{list.recommendCount}</Navigate>,
|
67
|
69
|
},
|
68
|
70
|
// {
|
69
|
71
|
// title: '邀请经纪人',
|
|
@@ -101,31 +103,31 @@ const header = props => {
|
101
|
103
|
|
102
|
104
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
103
|
105
|
const [queryData, setQueryData] = useState({})
|
104
|
|
-// const [page, changePage] = useState({})
|
|
106
|
+ // const [page, changePage] = useState({})
|
105
|
107
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
106
|
108
|
useEffect(() => {
|
107
|
109
|
getListBroker({ channelId: props.location.query.id, pageNum: 1, pageSize: 10 })
|
108
|
110
|
}, [])
|
109
|
111
|
|
110
|
|
- function getListBroker(params) {
|
111
|
|
- request({ ...apis.channelList.getListBroker, params: { ...params } }).then((data) => {
|
112
|
|
- setData(data)
|
|
112
|
+ function getListBroker(params) {
|
|
113
|
+ request({ ...apis.channelList.getListBroker, params: { ...params } }).then((data) => {
|
|
114
|
+ setData(data)
|
113
|
115
|
}).catch((err) => {
|
114
|
|
- console.log(err)
|
115
|
|
- message.info(err.msg || err.message)
|
|
116
|
+ console.log(err)
|
|
117
|
+ message.info(err.msg || err.message)
|
116
|
118
|
})
|
117
|
|
- }
|
|
119
|
+ }
|
118
|
120
|
|
119
|
121
|
|
120
|
|
- // 搜索
|
121
|
|
- function queryList() {
|
122
|
|
- getListBroker({ ...queryData, pageNum: 1, pageSize: 10, channelId: props.location.query.id })
|
123
|
|
-}
|
124
|
|
- // 分页
|
125
|
|
- function onChange(pageNumber) {
|
126
|
|
- // eslint-disable-next-line react-hooks/rules-of-hooks
|
127
|
|
- getListBroker({ pageNum: pageNumber, pageSize: 10 })
|
128
|
|
- }
|
|
122
|
+ // 搜索
|
|
123
|
+ function queryList() {
|
|
124
|
+ getListBroker({ ...queryData, pageNum: 1, pageSize: 10, channelId: props.location.query.id })
|
|
125
|
+ }
|
|
126
|
+ // 分页
|
|
127
|
+ function onChange(pageNumber) {
|
|
128
|
+ // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
129
|
+ getListBroker({ pageNum: pageNumber, pageSize: 10 })
|
|
130
|
+ }
|
129
|
131
|
// // 获取input的值
|
130
|
132
|
// function onInputChangeName (e) {
|
131
|
133
|
// // const InputValue = e.target.name.x.value;
|
|
@@ -161,25 +163,25 @@ const header = props => {
|
161
|
163
|
getListBroker({ pageNum: 1, pageSize: 10, channelId: props.location.query.id })
|
162
|
164
|
}
|
163
|
165
|
const { getFieldDecorator } = props.form;
|
164
|
|
-return (
|
165
|
|
- <>
|
166
|
|
- <Form layout="inline" onSubmit={handleSubmit}>
|
167
|
|
- <Form.Item label="姓名">
|
|
166
|
+ return (
|
|
167
|
+ <>
|
|
168
|
+ <Form layout="inline" onSubmit={handleSubmit}>
|
|
169
|
+ <Form.Item label="姓名">
|
168
|
170
|
{getFieldDecorator('name', {
|
169
|
|
- })(<Input/>)}
|
|
171
|
+ })(<Input />)}
|
|
172
|
+ </Form.Item>
|
|
173
|
+ <Form.Item label="电话">
|
|
174
|
+ {getFieldDecorator('phone', {
|
|
175
|
+ })(<Input />)}
|
|
176
|
+ </Form.Item>
|
|
177
|
+ <Form.Item >
|
|
178
|
+ <Button type="primary" htmlType="submit" >搜索</Button>
|
|
179
|
+ <Button onClick={handleReset} style={{ marginLeft: 18 }}>重置</Button>
|
170
|
180
|
</Form.Item>
|
171
|
|
- <Form.Item label="电话">
|
172
|
|
- {getFieldDecorator('phone', {
|
173
|
|
- })(<Input/>)}
|
174
|
|
- </Form.Item>
|
175
|
|
- <Form.Item >
|
176
|
|
- <Button type="primary" htmlType="submit" >搜索</Button>
|
177
|
|
- <Button onClick={handleReset} style={{ marginLeft: 18 }}>重置</Button>
|
178
|
|
- </Form.Item>
|
179
|
|
- </Form>
|
180
|
|
- <Table style={{ marginTop: '40px' }} dataSource={data.list} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} rowKey="brokerList"/>
|
181
|
|
- </>
|
182
|
|
-)
|
|
181
|
+ </Form>
|
|
182
|
+ <Table style={{ marginTop: '40px' }} dataSource={data.list} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} rowKey="brokerList" />
|
|
183
|
+ </>
|
|
184
|
+ )
|
183
|
185
|
}
|
184
|
186
|
const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
|
185
|
187
|
function handleMenuClick(e) {
|