|
@@ -1,5 +1,5 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
|
-import { Form, Button, DatePicker, Table, Pagination, Radio, Typography } from 'antd';
|
|
2
|
+import { Form, Button, DatePicker, Modal, Table, Pagination, Radio, Typography } from 'antd';
|
3
|
3
|
import router from 'umi/router';
|
4
|
4
|
import moment from 'moment';
|
5
|
5
|
import BuildSelect from '../../../components/SelectButton/BuildSelect'
|
|
@@ -15,7 +15,7 @@ const { RangePicker } = DatePicker;
|
15
|
15
|
const { Text } = Typography;
|
16
|
16
|
|
17
|
17
|
function record(props) {
|
18
|
|
- const [radioVal, updateRadioVal] = useState(7)
|
|
18
|
+ const [radioVal, updateRadioVal] = useState(6)
|
19
|
19
|
const [formData, updateFormData] = useState({
|
20
|
20
|
pageNum: 1,
|
21
|
21
|
pageSize: 10,
|
|
@@ -31,6 +31,7 @@ function record(props) {
|
31
|
31
|
const [totalRow, setTotalRow] = useState({})
|
32
|
32
|
const [loading, updataLoading] = useState(true)
|
33
|
33
|
const [btnloading, updataBtnloading] = useState(false)
|
|
34
|
+ const [visible, setVisible] = useState(false)
|
34
|
35
|
|
35
|
36
|
useEffect(() => {
|
36
|
37
|
getList(formData);
|
|
@@ -38,6 +39,7 @@ function record(props) {
|
38
|
39
|
|
39
|
40
|
// 查询列表
|
40
|
41
|
const getList = (params) => {
|
|
42
|
+ updataLoading(true)
|
41
|
43
|
request({ ...apis.stats.consultantKPI, params: { ...params }, }).then((data) => {
|
42
|
44
|
setData(data.paged)
|
43
|
45
|
setTotalRow(data.total)
|
|
@@ -50,6 +52,21 @@ function record(props) {
|
50
|
52
|
//重置搜索
|
51
|
53
|
function handleReset() {
|
52
|
54
|
props.form.resetFields();
|
|
55
|
+ updateFormData({
|
|
56
|
+ pageNum: 1,
|
|
57
|
+ pageSize: 10,
|
|
58
|
+ startDate: moment().subtract(radioVal, 'day').format('YYYYMMDD'),
|
|
59
|
+ endDate: moment().format('YYYYMMDD'),
|
|
60
|
+ buildingId: '',
|
|
61
|
+ })
|
|
62
|
+ updateRadioVal(6)
|
|
63
|
+ getList({
|
|
64
|
+ pageNum: 1,
|
|
65
|
+ pageSize: 10,
|
|
66
|
+ startDate: moment().subtract(radioVal, 'day').format('YYYYMMDD'),
|
|
67
|
+ endDate: moment().format('YYYYMMDD'),
|
|
68
|
+ buildingId: '',
|
|
69
|
+ });
|
53
|
70
|
}
|
54
|
71
|
|
55
|
72
|
// 提交事件
|
|
@@ -227,7 +244,7 @@ function record(props) {
|
227
|
244
|
dataIndex: 'buildingName',
|
228
|
245
|
key: 'buildingName',
|
229
|
246
|
align: 'center',
|
230
|
|
- // render: (txt, _, index) => index ? txt : <span>总计</span>,
|
|
247
|
+ render: (txt, _, index) => index ? txt : <span>总计</span>,
|
231
|
248
|
},
|
232
|
249
|
|
233
|
250
|
{
|
|
@@ -248,8 +265,8 @@ function record(props) {
|
248
|
265
|
key: 'totalPersons',
|
249
|
266
|
align: 'center',
|
250
|
267
|
sorter: true,
|
251
|
|
- render: (txt, record, index) => clickCon(txt, record, 'totalPersons'),
|
252
|
|
- // render: (txt, record, index) => index ? clickCon(txt, record, 'totalPersons') : <strong>{txt}</strong>,
|
|
268
|
+ // render: (txt, record, index) => clickCon(txt, record, 'totalPersons'),
|
|
269
|
+ render: (txt, record, index) => index ? clickCon(txt, record, 'totalPersons') : <strong>{txt}</strong>,
|
253
|
270
|
},
|
254
|
271
|
{
|
255
|
272
|
title: '新增客户',
|
|
@@ -257,7 +274,8 @@ function record(props) {
|
257
|
274
|
key: 'newPersons',
|
258
|
275
|
align: 'center',
|
259
|
276
|
sorter: true,
|
260
|
|
- render: (txt, record, index) => clickCon(txt, record, 'newPersons'),
|
|
277
|
+ // render: (txt, record, index) => clickCon(txt, record, 'newPersons'),
|
|
278
|
+ render: (txt, record, index) => index ? clickCon(txt, record, 'newPersons') : <strong>{txt}</strong>,
|
261
|
279
|
},
|
262
|
280
|
{
|
263
|
281
|
title: '分享次数',
|
|
@@ -265,7 +283,8 @@ function record(props) {
|
265
|
283
|
key: 'shareNum',
|
266
|
284
|
align: 'center',
|
267
|
285
|
sorter: true,
|
268
|
|
- render: (txt, record, index) => clickCon(txt, record, 'shareNum'),
|
|
286
|
+ // render: (txt, record, index) => clickCon(txt, record, 'shareNum'),
|
|
287
|
+ render: (txt, record, index) => index ? clickCon(txt, record, 'shareNum') : <strong>{txt}</strong>,
|
269
|
288
|
},
|
270
|
289
|
{
|
271
|
290
|
title: '分享访问人数',
|
|
@@ -273,7 +292,8 @@ function record(props) {
|
273
|
292
|
key: 'visitPersons',
|
274
|
293
|
align: 'center',
|
275
|
294
|
sorter: true,
|
276
|
|
- render: (txt, record, index) => clickCon(txt, record, 'visitPersons'),
|
|
295
|
+ // render: (txt, record, index) => clickCon(txt, record, 'visitPersons'),
|
|
296
|
+ render: (txt, record, index) => index ? clickCon(txt, record, 'visitPersons') : <strong>{txt}</strong>,
|
277
|
297
|
},
|
278
|
298
|
{
|
279
|
299
|
title: '分享访问次数',
|
|
@@ -281,7 +301,8 @@ function record(props) {
|
281
|
301
|
key: 'visitNum',
|
282
|
302
|
align: 'center',
|
283
|
303
|
sorter: true,
|
284
|
|
- render: (txt, record, index) => clickCon(txt, record, 'visitNum'),
|
|
304
|
+ // render: (txt, record, index) => clickCon(txt, record, 'visitNum'),
|
|
305
|
+ render: (txt, record, index) => index ? clickCon(txt, record, 'visitNum') : <strong>{txt}</strong>,
|
285
|
306
|
},
|
286
|
307
|
|
287
|
308
|
{
|
|
@@ -290,7 +311,8 @@ function record(props) {
|
290
|
311
|
key: 'sharePersons',
|
291
|
312
|
align: 'center',
|
292
|
313
|
sorter: true,
|
293
|
|
- render: (txt, record, index) => clickCon(txt, record, 'sharePersons'),
|
|
314
|
+ // render: (txt, record, index) => clickCon(txt, record, 'sharePersons'),
|
|
315
|
+ render: (txt, record, index) => index ? clickCon(txt, record, 'sharePersons') : <strong>{txt}</strong>,
|
294
|
316
|
},
|
295
|
317
|
{
|
296
|
318
|
title: '主页访问人数',
|
|
@@ -298,7 +320,8 @@ function record(props) {
|
298
|
320
|
key: 'homePagePersons',
|
299
|
321
|
align: 'center',
|
300
|
322
|
sorter: true,
|
301
|
|
- render: (txt, record, index) => clickCon(txt, record, 'homePagePersons'),
|
|
323
|
+ // render: (txt, record, index) => clickCon(txt, record, 'homePagePersons'),
|
|
324
|
+ render: (txt, record, index) => index ? clickCon(txt, record, 'homePagePersons') : <strong>{txt}</strong>,
|
302
|
325
|
},
|
303
|
326
|
{
|
304
|
327
|
title: '主页访问次数',
|
|
@@ -306,7 +329,8 @@ function record(props) {
|
306
|
329
|
key: 'homePageNums',
|
307
|
330
|
align: 'center',
|
308
|
331
|
sorter: true,
|
309
|
|
- render: (txt, record, index) => clickCon(txt, record, 'homePageNums'),
|
|
332
|
+ // render: (txt, record, index) => clickCon(txt, record, 'homePageNums'),
|
|
333
|
+ render: (txt, record, index) => index ? clickCon(txt, record, 'homePageNums') : <strong>{txt}</strong>,
|
310
|
334
|
},
|
311
|
335
|
{
|
312
|
336
|
title: '咨询数',
|
|
@@ -314,7 +338,8 @@ function record(props) {
|
314
|
338
|
key: 'chatPersons',
|
315
|
339
|
align: 'center',
|
316
|
340
|
sorter: true,
|
317
|
|
- render: (txt, record, index) => clickCon(txt, record, 'chatPersons'),
|
|
341
|
+ // render: (txt, record, index) => clickCon(txt, record, 'chatPersons'),
|
|
342
|
+ render: (txt, record, index) => index ? clickCon(txt, record, 'chatPersons') : <strong>{txt}</strong>,
|
318
|
343
|
},
|
319
|
344
|
{
|
320
|
345
|
title: '点赞数',
|
|
@@ -322,7 +347,8 @@ function record(props) {
|
322
|
347
|
key: 'favorNum',
|
323
|
348
|
align: 'center',
|
324
|
349
|
sorter: true,
|
325
|
|
- render: (txt, record, index) => clickCon(txt, record, 'favorNum'),
|
|
350
|
+ // render: (txt, record, index) => clickCon(txt, record, 'favorNum'),
|
|
351
|
+ render: (txt, record, index) => index ? clickCon(txt, record, 'favorNum') : <strong>{txt}</strong>,
|
326
|
352
|
},
|
327
|
353
|
];
|
328
|
354
|
// 下载文档
|
|
@@ -354,16 +380,44 @@ function record(props) {
|
354
|
380
|
moment(formData.startDate),
|
355
|
381
|
moment(formData.endDate),
|
356
|
382
|
]
|
357
|
|
- // const list = data.records
|
358
|
|
- // const _list = list && list.length > 0 ? [totalRow, ...list] : [];
|
|
383
|
+ const list = data.records
|
|
384
|
+ const _list = list && list.length > 0 ? [totalRow, ...list] : [];
|
359
|
385
|
return (
|
360
|
386
|
|
361
|
387
|
<>
|
|
388
|
+ <p style={{ fontSize: '0.09rem', color: '#999' }} onClick={() => setVisible(true)}>指标说明</p>
|
|
389
|
+ <Modal
|
|
390
|
+ title="指标说明(数据会存在一定时间延迟)"
|
|
391
|
+ centered
|
|
392
|
+ visible={visible}
|
|
393
|
+ footer={null}
|
|
394
|
+ onCancel={() => setVisible(false)}
|
|
395
|
+ >
|
|
396
|
+ <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>主页访问人数:</p>
|
|
397
|
+ <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问置业顾问名片的用户数</p>
|
|
398
|
+ <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>主页访问次数:</p>
|
|
399
|
+ <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问置业顾问名片的用户数</p>
|
|
400
|
+ <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>客户总计:</p>
|
|
401
|
+ <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>当前置业顾问的所有客户数(与列表时间筛选无关)</p>
|
|
402
|
+ <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>新增客户:</p>
|
|
403
|
+ <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>当前时间段内置业顾问新增的客户数</p>
|
|
404
|
+ <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享次数:</p>
|
|
405
|
+ <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>置业顾问分享小程序内容的次数</p>
|
|
406
|
+ <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享访问人数:</p>
|
|
407
|
+ <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过置业顾问分享访问小程序内容的用户数</p>
|
|
408
|
+ <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享拓客:</p>
|
|
409
|
+ <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过置业顾问分享内容进行手机授权的用户数</p>
|
|
410
|
+ <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>咨询数:</p>
|
|
411
|
+ <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>在线微聊,咨询置业顾问的用户数</p>
|
|
412
|
+ <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>点赞数:</p>
|
|
413
|
+ <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>置业顾问获得的点赞数</p>
|
|
414
|
+ </Modal>
|
362
|
415
|
<Form layout="inline">
|
363
|
416
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
364
|
417
|
<Radio.Group buttonStyle="solid" value={radioVal} onChange={setFormData} style={{ marginRight: '16px', }}>
|
365
|
|
- <Radio.Button value={7}>最近7天</Radio.Button>
|
366
|
|
- <Radio.Button value={30}>最近1月</Radio.Button>
|
|
418
|
+ <Radio.Button value={0}>今日</Radio.Button>
|
|
419
|
+ <Radio.Button value={6}>最近7天</Radio.Button>
|
|
420
|
+ <Radio.Button value={29}>最近1月</Radio.Button>
|
367
|
421
|
</Radio.Group>
|
368
|
422
|
<Form.Item>
|
369
|
423
|
<RangePicker value={dateRange} onChange={handleDateChange} placeholder={['开始日期', '结束日期']} />
|
|
@@ -384,7 +438,8 @@ function record(props) {
|
384
|
438
|
</AuthButton>
|
385
|
439
|
<Table rowKey={record => (record.userId + record.buildingId || '')}
|
386
|
440
|
style={{ marginTop: '30px' }}
|
387
|
|
- dataSource={data.records}
|
|
441
|
+ dataSource={_list}
|
|
442
|
+ // dataSource={data.records}
|
388
|
443
|
columns={columns}
|
389
|
444
|
pagination={false}
|
390
|
445
|
onChange={handleChange}
|