xujing 5 년 전
부모
커밋
ad216c0907

+ 41
- 11
config/routes.js 파일 보기

353
               },
353
               },
354
               {
354
               {
355
                 path: '/activity/liveActivity/add',
355
                 path: '/activity/liveActivity/add',
356
-                name: '新增', 
356
+                name: '新增',
357
                 hideInMenu: true,
357
                 hideInMenu: true,
358
                 component: './activity/liveActivity/add',
358
                 component: './activity/liveActivity/add',
359
               },
359
               },
360
               {
360
               {
361
                 path: '/activity/liveActivity/edit',
361
                 path: '/activity/liveActivity/edit',
362
-                name: '编辑', 
362
+                name: '编辑',
363
                 hideInMenu: true,
363
                 hideInMenu: true,
364
                 component: './activity/liveActivity/edit',
364
                 component: './activity/liveActivity/edit',
365
               },
365
               },
562
                 name: '置业顾问KPI',
562
                 name: '置业顾问KPI',
563
                 component: './statistical/consultant/index',
563
                 component: './statistical/consultant/index',
564
               },
564
               },
565
+              {
566
+                path: '/statistical/consultant/table',
567
+                name: '拓客统计',
568
+                hideInMenu: true,
569
+                component: './statistical/consultant/table',
570
+              },
571
+              {
572
+                path: '/statistical/consultant/sharetable',
573
+                name: '分享统计',
574
+                hideInMenu: true,
575
+                component: './statistical/consultant/sharetable',
576
+              },
577
+              {
578
+                path: '/statistical/consultant/visitPersons',
579
+                name: '分享访问人数',
580
+                hideInMenu: true,
581
+                component: './statistical/consultant/visitPersons',
582
+              },
583
+              {
584
+                path: '/statistical/consultant/visitNum',
585
+                name: '分享访问次数',
586
+                hideInMenu: true,
587
+                component: './statistical/consultant/visitNum',
588
+              },
589
+              {
590
+                path: '/statistical/consultant/homePagePersons',
591
+                name: '主页访问次数',
592
+                hideInMenu: true,
593
+                component: './statistical/consultant/homePagePersons',
594
+              },
565
             ],
595
             ],
566
           },
596
           },
567
           {
597
           {
576
               },
606
               },
577
               {
607
               {
578
                 path: '/house/house/add',
608
                 path: '/house/house/add',
579
-                name: '新增', 
609
+                name: '新增',
580
                 hideInMenu: true,
610
                 hideInMenu: true,
581
                 component: './house/house/add/index',
611
                 component: './house/house/add/index',
582
               },
612
               },
583
               {
613
               {
584
                 path: '/house/house/batch',
614
                 path: '/house/house/batch',
585
-                name: '批量上传', 
615
+                name: '批量上传',
586
                 hideInMenu: true,
616
                 hideInMenu: true,
587
                 component: './house/house/add/HouseBatchAdd',
617
                 component: './house/house/add/HouseBatchAdd',
588
               },
618
               },
589
               {
619
               {
590
                 path: '/house/house/edit',
620
                 path: '/house/house/edit',
591
-                name: '编辑', 
621
+                name: '编辑',
592
                 hideInMenu: true,
622
                 hideInMenu: true,
593
                 component: './house/house/edit/index',
623
                 component: './house/house/edit/index',
594
               },
624
               },
599
               },
629
               },
600
               {
630
               {
601
                 path: '/house/preSelect/add',
631
                 path: '/house/preSelect/add',
602
-                name: '新增', 
632
+                name: '新增',
603
                 hideInMenu: true,
633
                 hideInMenu: true,
604
                 component: './house/preSelect/add/index',
634
                 component: './house/preSelect/add/index',
605
               },
635
               },
606
               {
636
               {
607
                 path: '/house/preSelect/batch',
637
                 path: '/house/preSelect/batch',
608
-                name: '批量上传', 
638
+                name: '批量上传',
609
                 hideInMenu: true,
639
                 hideInMenu: true,
610
                 component: './house/preSelect/add/HouseBatchAdd',
640
                 component: './house/preSelect/add/HouseBatchAdd',
611
               },
641
               },
612
               {
642
               {
613
                 path: '/house/preSelect/edit',
643
                 path: '/house/preSelect/edit',
614
-                name: '编辑', 
644
+                name: '编辑',
615
                 hideInMenu: true,
645
                 hideInMenu: true,
616
                 component: './house/preSelect/edit/index',
646
                 component: './house/preSelect/edit/index',
617
               },
647
               },
622
               },
652
               },
623
               {
653
               {
624
                 path: '/house/raise/add',
654
                 path: '/house/raise/add',
625
-                name: '新增', 
655
+                name: '新增',
626
                 hideInMenu: true,
656
                 hideInMenu: true,
627
                 component: './house/raise/add/index',
657
                 component: './house/raise/add/index',
628
               },
658
               },
629
               {
659
               {
630
                 path: '/house/raise/batch',
660
                 path: '/house/raise/batch',
631
-                name: '批量上传', 
661
+                name: '批量上传',
632
                 hideInMenu: true,
662
                 hideInMenu: true,
633
                 component: './house/raise/add/HouseBatchAdd',
663
                 component: './house/raise/add/HouseBatchAdd',
634
               },
664
               },
635
               {
665
               {
636
                 path: '/house/raise/edit',
666
                 path: '/house/raise/edit',
637
-                name: '编辑', 
667
+                name: '编辑',
638
                 hideInMenu: true,
668
                 hideInMenu: true,
639
                 component: './house/raise/edit/index',
669
                 component: './house/raise/edit/index',
640
               },
670
               },

+ 23
- 23
src/pages/record/drainage/DrainageVisitRecordList.jsx 파일 보기

46
       dataIndex: 'activityName',
46
       dataIndex: 'activityName',
47
       key: 'activityName',
47
       key: 'activityName',
48
       align: 'center',
48
       align: 'center',
49
-      render: (text, record) => <span>{record.activityName != null ? record.activityName : 
50
-        record.drainageName != null ? record.drainageName : record.buildingName != null ? record.buildingName:record.newsName != null ? record.newsName : record.helpActivityName !=null ? record.helpActivityName :
51
-        record.groupActivityName!=null ? record.groupActivityName:''}</span>,
49
+      render: (text, record) => <span>{record.activityName != null ? record.activityName :
50
+        record.drainageName != null ? record.drainageName : record.buildingName != null ? record.buildingName : record.newsName != null ? record.newsName : record.helpActivityName != null ? record.helpActivityName :
51
+          record.groupActivityName != null ? record.groupActivityName : ''}</span>,
52
     },
52
     },
53
     {
53
     {
54
       title: '用户名',
54
       title: '用户名',
86
       dataIndex: 'personType',
86
       dataIndex: 'personType',
87
       key: 'personType',
87
       key: 'personType',
88
       align: 'center',
88
       align: 'center',
89
-      render: (text, record) => <span>{record.personType === 'Realty Consultant' ? '置业顾问' : '普通客户' }</span>,
89
+      render: (text, record) => <span>{record.personType === 'Realty Consultant' ? '置业顾问' : '普通客户'}</span>,
90
     },
90
     },
91
   ];
91
   ];
92
-  
92
+
93
 
93
 
94
   const changePageNum = (pageNumber, props) => {
94
   const changePageNum = (pageNumber, props) => {
95
     getList({ pageNumber: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
95
     getList({ pageNumber: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
104
 
104
 
105
         if (!values.buildingId) {
105
         if (!values.buildingId) {
106
           message.error("请选择项目")
106
           message.error("请选择项目")
107
-          return ;
107
+          return;
108
         }
108
         }
109
 
109
 
110
         getList({ pageNum: 1, pageSize: 10, ...values })
110
         getList({ pageNum: 1, pageSize: 10, ...values })
113
   }
113
   }
114
 
114
 
115
   //重置搜索
115
   //重置搜索
116
-  function handleReset () {
116
+  function handleReset() {
117
     props.form.resetFields();
117
     props.form.resetFields();
118
     getList({ pageNum: 1, pageSize: 10 })
118
     getList({ pageNum: 1, pageSize: 10 })
119
   }
119
   }
132
         <Form.Item>
132
         <Form.Item>
133
           {getFieldDecorator('eventType')(
133
           {getFieldDecorator('eventType')(
134
             <Select placeholder="分享类型" style={{ width: 150 }}>
134
             <Select placeholder="分享类型" style={{ width: 150 }}>
135
-            <Option value="activity_share">报名活动</Option>
136
-            <Option value="help_share">助力活动</Option>
137
-            <Option value="group_share">拼团活动</Option>
138
-            <Option value="h5_share">H5活动</Option>
139
-            <Option value="building_share">项目</Option>
140
-            <Option value="news_share">资讯</Option>
141
-          </Select>
135
+              <Option value="activity_share">报名活动</Option>
136
+              <Option value="help_share">助力活动</Option>
137
+              <Option value="group_share">拼团活动</Option>
138
+              <Option value="h5_share">H5活动</Option>
139
+              <Option value="building_share">项目</Option>
140
+              <Option value="news_share">资讯</Option>
141
+            </Select>
142
           )}
142
           )}
143
         </Form.Item>
143
         </Form.Item>
144
         <Form.Item>
144
         <Form.Item>
159
         </Form.Item>
159
         </Form.Item>
160
         <Form.Item>
160
         <Form.Item>
161
           {getFieldDecorator('personType')(
161
           {getFieldDecorator('personType')(
162
-             <Select placeholder="分享者类型" style={{ width: 150 }}>
163
-             <Option value="Realty Consultant">置业顾问</Option>
164
-             <Option value="customer">普通客户</Option>
165
-           </Select>
162
+            <Select placeholder="分享者类型" style={{ width: 150 }}>
163
+              <Option value="Realty Consultant">置业顾问</Option>
164
+              <Option value="customer">普通客户</Option>
165
+            </Select>
166
           )}
166
           )}
167
         </Form.Item>
167
         </Form.Item>
168
         <Form.Item>
168
         <Form.Item>
174
           )}
174
           )}
175
         </Form.Item>
175
         </Form.Item>
176
         <Form.Item>
176
         <Form.Item>
177
-        <AuthButton name="admin.visit.record.search" noRight={null}>
178
-          <Button type="primary" htmlType="submit" className={styles.searchBtn}> 
179
-            搜索
177
+          <AuthButton name="admin.visit.record.search" noRight={null}>
178
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
179
+              搜索
180
           </Button>
180
           </Button>
181
           </AuthButton>
181
           </AuthButton>
182
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
182
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
184
             </Button>
184
             </Button>
185
         </Form.Item>
185
         </Form.Item>
186
       </Form>
186
       </Form>
187
-      <Table style={{marginTop:'30px'}} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" locale={{ emptyText: defaultTip }} />
187
+      <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" locale={{ emptyText: defaultTip }} />
188
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
188
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
189
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e,props)} current={data.current} />
189
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e, props)} current={data.current} />
190
       </div>
190
       </div>
191
     </>
191
     </>
192
   )
192
   )

+ 119
- 0
src/pages/statistical/consultant/homePagePersons.jsx 파일 보기

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Button, Table, Pagination, Radio, Typography, Avatar } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
6
+import apis from '../../../services/apis';
7
+import request from '../../../utils/request'
8
+
9
+/**
10
+  @param {*} props
11
+  @returns
12
+ */
13
+const { Text } = Typography;
14
+
15
+function record(props) {
16
+    const [formData, updateFormData] = useState({
17
+        pageNum: 1,
18
+        pageSize: 10,
19
+        ...props.location.query,
20
+
21
+    })
22
+
23
+    // 获取初始化数据
24
+    const [data, setData] = useState({})
25
+
26
+
27
+    useEffect(() => {
28
+        getList(formData);
29
+    }, [])
30
+
31
+    // 查询列表
32
+    const getList = (params) => {
33
+        request({ ...apis.stats.totalPersons, params: { ...params }, }).then((data) => {
34
+            setData(data)
35
+        })
36
+    }
37
+
38
+    // 更新页码
39
+    const changePageNum = (pageNumber) => {
40
+        props.form.validateFields((err, values) => {
41
+            if (!err) {
42
+                getList({ ...props.location.query, pageNum: pageNumber });
43
+            }
44
+        });
45
+    }
46
+    const toPersonDetail = (personId) => {
47
+        router.push({
48
+            pathname: '/customer/customerlist/publicCustomerDetail',
49
+            query: {
50
+                id: personId,
51
+            },
52
+        });
53
+    }
54
+    // 表格数据
55
+    const columns = [
56
+
57
+        {
58
+            title: '头像',
59
+            dataIndex: 'picture',
60
+            key: 'picture',
61
+            align: 'center',
62
+            render: (_, record) => <Avatar shape="square" src={record.picture || record.avatarurl} size={64} icon="user" />,
63
+        },
64
+        {
65
+            title: '姓名',
66
+            dataIndex: 'name',
67
+            key: 'name',
68
+            align: 'center',
69
+            render: (_, record) => <span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => toPersonDetail(record.personId)} >{record.name}</span>,
70
+        },
71
+        {
72
+            title: '电话',
73
+            dataIndex: 'phone',
74
+            key: 'phone',
75
+            align: 'center',
76
+        },
77
+        {
78
+            title: '性别',
79
+            dataIndex: 'sex',
80
+            key: 'sex',
81
+            align: 'center',
82
+            render: (_, record) => <span>{record.sex == 1 ? '男' : '女'}</span>,
83
+        },
84
+        {
85
+            title: '访问次数',
86
+            dataIndex: 'verifyStatus',
87
+            key: 'verifyStatus',
88
+            align: 'center',
89
+            render: (_, record) => <span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => toPersonDetail(record.personId)} >{record.verifyStatus}</span>,
90
+        },
91
+        {
92
+            title: '最后访问时间',
93
+            dataIndex: 'reportDate',
94
+            key: 'reportDate',
95
+            align: 'center',
96
+            render: (_, record) => <><span>{record.reportDate && moment(record.reportDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
97
+        },
98
+
99
+    ];
100
+
101
+    return (
102
+
103
+        <>
104
+            <Button type="danger" style={{ marginLeft: '18px' }} onClick={() => router.go(-1)}>返回</Button>
105
+            <Table rowKey={record => (record.phone + record.buildingId || '')}
106
+                style={{ marginTop: '30px' }}
107
+                dataSource={data.records}
108
+                columns={columns}
109
+                pagination={false}
110
+            />
111
+            < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
112
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
113
+            </div>
114
+        </>
115
+    )
116
+}
117
+const WrappedHeader = Form.create({ name: 'record' })(record);
118
+
119
+export default WrappedHeader

+ 215
- 105
src/pages/statistical/consultant/index.jsx 파일 보기

14
 const { Text } = Typography;
14
 const { Text } = Typography;
15
 
15
 
16
 function record(props) {
16
 function record(props) {
17
-    const { getFieldDecorator } = props.form
17
+    const [radioVal, updateRadioVal] = useState(7)
18
+    const [formData, updateFormData] = useState({
19
+        pageNum: 1,
20
+        pageSize: 10,
21
+        startDate: moment().subtract(radioVal, 'day').format('YYYYMMDD'),
22
+        endDate: moment().format('YYYYMMDD'),
23
+        buildingId: '',
24
+        asc: '',
25
+        desc: '',
26
+    })
18
 
27
 
19
     // 获取初始化数据
28
     // 获取初始化数据
20
     const [data, setData] = useState({})
29
     const [data, setData] = useState({})
30
+    const [totalRow, setTotalRow] = useState({})
21
 
31
 
22
     useEffect(() => {
32
     useEffect(() => {
23
-        getList({ pageNum: 1, pageSize: 10 });
33
+        getList(formData);
24
     }, [])
34
     }, [])
25
 
35
 
26
     // 查询列表
36
     // 查询列表
27
     const getList = (params) => {
37
     const getList = (params) => {
28
-        request({ ...apis.activity.saleCountList, params: { ...params }, }).then((data) => {
29
-            setData(data)
30
-            console.log("data:", data)
38
+        request({ ...apis.stats.consultantKPI, params: { ...params }, }).then((data) => {
39
+            setData(data.paged)
40
+            setTotalRow(data.total)
31
         })
41
         })
32
     }
42
     }
33
 
43
 
36
         props.form.resetFields();
46
         props.form.resetFields();
37
     }
47
     }
38
 
48
 
39
-    // 分享详情
40
-    function shareCount(personId) {
41
-        router.push({
42
-            pathname: '/record/share/shareCountList',
43
-            query: {
44
-                id: personId,
45
-            },
46
-        });
47
-    }
48
-
49
-    // 点击人数详情
50
-    function clickCount(personId) {
51
-        router.push({
52
-            pathname: '/record/share/clickCountList',
53
-            query: {
54
-                id: personId,
55
-            },
56
-        });
57
-    }
58
-
59
     // 提交事件
49
     // 提交事件
60
-    const handleSubmit = (e, props) => {
50
+    const handleSubmit = (e) => {
61
         e.preventDefault();
51
         e.preventDefault();
62
-        props.form.validateFields((err, values) => {
63
-            if (!err) {
64
-                let { shareTime, receiveTime, ...submitValue } = values
65
-                if (null != shareTime && shareTime.length > 0) {
66
-                    const [startCreateDate, endCreateDate] = shareTime
67
-                    submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
68
-                    submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
69
-                } else {
70
-                    submitValue.startCreateDate = null
71
-                    submitValue.endCreateDate = null
72
-                }
73
-                console.log(submitValue)
74
-                getList({ pageNum: 1, pageSize: 10, ...submitValue })
75
-            }
76
-        });
52
+        getList(formData);
77
     }
53
     }
78
-
54
+    // 更新页码
79
     const changePageNum = (pageNumber) => {
55
     const changePageNum = (pageNumber) => {
80
         props.form.validateFields((err, values) => {
56
         props.form.validateFields((err, values) => {
81
             if (!err) {
57
             if (!err) {
82
-                let { shareTime, receiveTime, ...submitValue } = values
83
-                if (null != shareTime && shareTime.length > 0) {
84
-                    const [startCreateDate, endCreateDate] = shareTime
85
-                    submitValue.startCreateDate = moment(startCreateDate).format('YYYY-MM-DD');
86
-                    submitValue.endCreateDate = moment(endCreateDate).format('YYYY-MM-DD');
87
-                } else {
88
-                    submitValue.startCreateDate = null
89
-                    submitValue.endCreateDate = null
90
-                }
91
-                getList({ pageNum: pageNumber, pageSize: 10, ...submitValue })
58
+                getList({ ...formData, pageNum: pageNumber });
92
             }
59
             }
93
         });
60
         });
94
     }
61
     }
95
-    function getDataOf(days) {
96
-        // this.setState({ endDate: new Date(), startDate: moment().subtract(days, 'day').toDate() })
62
+    // 切换日期 与picker联动
63
+    function setFormData(e) {
64
+        updateRadioVal(e.target.value)
65
+        updateFormData({
66
+            ...formData,
67
+            startDate: moment().subtract(e.target.value, 'day').format('YYYYMMDD'),
68
+            endDate: moment().format('YYYYMMDD'),
69
+        })
70
+        getList({
71
+            ...formData, startDate: moment().subtract(e.target.value, 'day').format('YYYYMMDD'),
72
+            endDate: moment().format('YYYYMMDD'),
73
+        });
74
+
75
+    }
76
+    // 选择日期
77
+    const handleDateChange = (val) => {
78
+        updateFormData({
79
+            ...formData,
80
+            startDate: val[0].format('YYYYMMDD'),
81
+            endDate: val[1].format('YYYYMMDD'),
82
+        })
83
+    }
84
+    // 选择项目
85
+    const handleBuildingChange = e => {
86
+        updateFormData({
87
+            ...formData,
88
+            buildingId: e,
89
+        })
97
     }
90
     }
91
+
92
+    const clickCon = (val, record, type) => {
93
+        if (val == 0) {
94
+            return <><span onClick={() => toDetail(record, type)}>{val}</span></>
95
+        }
96
+        return <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => toDetail(record, type)} >{val}</span></>
97
+    }
98
+
99
+    // 分享详情
100
+    function toDetail(record, type) {
101
+        if (type === 'totalPersons') {
102
+            router.push({
103
+                pathname: '/statistical/consultant/table',
104
+                query: {
105
+                    buildingId: formData.buildingId,
106
+                    userId: record.userId,
107
+                },
108
+            });
109
+        } else if (type === 'newPersons') {
110
+            router.push({
111
+                pathname: '/statistical/consultant/table',
112
+                query: {
113
+                    startDate: formData.startDate,
114
+                    endDate: formData.endDate,
115
+                    buildingId: formData.buildingId,
116
+                    userId: record.userId,
117
+                },
118
+            });
119
+        } else if (type === 'shareNum') {
120
+            router.push({
121
+                pathname: '/statistical/consultant/sharetable',
122
+                query: {
123
+                    startDate: formData.startDate,
124
+                    endDate: formData.endDate,
125
+                    buildingId: formData.buildingId,
126
+                    userId: record.userId,
127
+                },
128
+            });
129
+        } else if (type === 'visitPersons') {
130
+            router.push({
131
+                pathname: '/statistical/consultant/visitPersons',
132
+                query: {
133
+                    startDate: formData.startDate,
134
+                    endDate: formData.endDate,
135
+                    buildingId: formData.buildingId,
136
+                    userId: record.userId,
137
+                },
138
+            });
139
+        } else if (type === 'visitNum') {
140
+            router.push({
141
+                pathname: '/statistical/consultant/visitNum',
142
+                query: {
143
+                    startDate: formData.startDate,
144
+                    endDate: formData.endDate,
145
+                    buildingId: formData.buildingId,
146
+                    userId: record.userId,
147
+                },
148
+            });
149
+        } else if (type === 'homePagePersons') {
150
+            router.push({
151
+                pathname: '/statistical/consultant/homePagePersons',
152
+                query: {
153
+                    startDate: formData.startDate,
154
+                    endDate: formData.endDate,
155
+                    buildingId: formData.buildingId,
156
+                    userId: record.userId,
157
+                },
158
+            });
159
+        }
160
+
161
+    }
162
+
163
+    // 表格数据
98
     const columns = [
164
     const columns = [
99
 
165
 
100
         {
166
         {
102
             dataIndex: 'buildingName',
168
             dataIndex: 'buildingName',
103
             key: 'buildingName',
169
             key: 'buildingName',
104
             align: 'center',
170
             align: 'center',
171
+            // render: (txt, _, index) => index ? txt : <span>总计</span>,
105
         },
172
         },
173
+
106
         {
174
         {
107
-            title: '置业顾问名称1',
108
-            dataIndex: 'consultantName',
109
-            key: 'consultantName',
175
+            title: '置业顾问名称',
176
+            dataIndex: 'userName',
177
+            key: 'userName',
110
             align: 'center',
178
             align: 'center',
111
         },
179
         },
112
         {
180
         {
113
             title: '置业顾问电话',
181
             title: '置业顾问电话',
114
-            dataIndex: 'consultantPhone',
115
-            key: 'consultantPhone',
182
+            dataIndex: 'phone',
183
+            key: 'phone',
116
             align: 'center',
184
             align: 'center',
117
         },
185
         },
118
         {
186
         {
119
             title: '客户总计',
187
             title: '客户总计',
120
-            dataIndex: 'customerAggregate',
121
-            key: 'customerAggregate',
188
+            dataIndex: 'totalPersons',
189
+            key: 'totalPersons',
122
             align: 'center',
190
             align: 'center',
123
-            sorter: (a, b) => a.customerAggregate - b.customerAggregate,
124
-            render: (_, record) => <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => shareCount(record.personId)} >{record.customerAggregate}</span></>,
191
+            sorter: (a, b) => a.totalPersons - b.totalPersons,
192
+            render: (txt, record, index) => clickCon(txt, record, 'totalPersons'),
193
+            // render: (txt, record, index) => index ? clickCon(txt, record, 'totalPersons') : <strong>{txt}</strong>,
125
         },
194
         },
126
         {
195
         {
127
             title: '新增客户',
196
             title: '新增客户',
128
-            dataIndex: 'newCustomers',
129
-            key: 'newCustomers',
197
+            dataIndex: 'newPersons',
198
+            key: 'newPersons',
130
             align: 'center',
199
             align: 'center',
131
-            sorter: (a, b) => a.newCustomers - b.newCustomers,
132
-            render: (_, record) => <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => shareCount(record.personId)} >{record.newCustomers}</span></>,
200
+            sorter: (a, b) => a.newPersons - b.newPersons,
201
+            render: (txt, record, index) => clickCon(txt, record, 'newPersons'),
133
         },
202
         },
134
         {
203
         {
135
             title: '分享次数',
204
             title: '分享次数',
136
-            dataIndex: 'shareCount',
137
-            key: 'shareCount',
205
+            dataIndex: 'shareNum',
206
+            key: 'shareNum',
138
             align: 'center',
207
             align: 'center',
139
-            sorter: (a, b) => a.shareCount - b.shareCount,
140
-            render: (_, record) => <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => shareCount(record.personId)} >{record.shareCount}</span></>,
208
+            sorter: (a, b) => a.shareNum - b.shareNum,
209
+            render: (txt, record, index) => clickCon(txt, record, 'shareNum'),
141
         },
210
         },
142
         {
211
         {
143
             title: '分享访问人数',
212
             title: '分享访问人数',
144
-            dataIndex: 'shareVisitPersonNum',
145
-            key: 'shareVisitPersonNum',
213
+            dataIndex: 'visitPersons',
214
+            key: 'visitPersons',
146
             align: 'center',
215
             align: 'center',
147
-            sorter: (a, b) => a.shareVisitPersonNum - b.shareVisitPersonNum,
148
-            render: (_, record) => <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => shareCount(record.personId)} >{record.shareVisitPersonNum}</span></>,
216
+            sorter: (a, b) => a.visitPersons - b.visitPersons,
217
+            render: (txt, record, index) => clickCon(txt, record, 'visitPersons'),
149
         },
218
         },
150
         {
219
         {
151
             title: '分享访问次数',
220
             title: '分享访问次数',
152
-            dataIndex: 'shareVisitNum',
153
-            key: 'shareVisitNum',
221
+            dataIndex: 'visitNum',
222
+            key: 'visitNum',
154
             align: 'center',
223
             align: 'center',
155
-            sorter: (a, b) => a.shareVisitNum - b.shareVisitNum,
156
-            render: (_, record) => <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => shareCount(record.personId)} >{record.shareVisitNum}</span></>,
224
+            sorter: (a, b) => a.visitNum - b.visitNum,
225
+            render: (txt, record, index) => clickCon(txt, record, 'visitNum'),
157
         },
226
         },
158
 
227
 
159
         {
228
         {
160
             title: '分享拓客',
229
             title: '分享拓客',
161
-            dataIndex: 'sharePossess',
162
-            key: 'sharePossess',
230
+            dataIndex: 'sharePersons',
231
+            key: 'sharePersons',
163
             align: 'center',
232
             align: 'center',
164
-            sorter: (a, b) => a.sharePossess - b.sharePossess,
165
-            render: (_, record) => <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => clickCount(record.personId)} >{record.sharePossess}</span></>,
233
+            sorter: (a, b) => a.sharePersons - b.sharePersons,
234
+            render: (txt, record, index) => clickCon(txt, record),
166
         },
235
         },
167
         {
236
         {
168
             title: '主页访问人数',
237
             title: '主页访问人数',
169
-            dataIndex: 'visitPerson',
170
-            key: 'visitPerson',
238
+            dataIndex: 'homePagePersons',
239
+            key: 'homePagePersons',
171
             align: 'center',
240
             align: 'center',
172
-            sorter: (a, b) => a.visitPerson - b.visitPerson,
173
-            render: (_, record) => <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => clickCount(record.personId)} >{record.visitPerson}</span></>,
241
+            sorter: (a, b) => a.homePagePersons - b.homePagePersons,
242
+            render: (txt, record, index) => clickCon(txt, record, 'homePagePersons'),
174
         },
243
         },
175
         {
244
         {
176
             title: '主页访问次数',
245
             title: '主页访问次数',
177
-            dataIndex: 'clickNum',
178
-            key: 'clickNum',
246
+            dataIndex: 'homePageNums',
247
+            key: 'homePageNums',
248
+            align: 'center',
249
+            sorter: (a, b) => a.homePageNums - b.homePageNums,
250
+            render: (txt, record, index) => clickCon(txt, record),
251
+        },
252
+        {
253
+            title: '咨询数',
254
+            dataIndex: 'chatPersons',
255
+            key: 'chatPersons',
256
+            align: 'center',
257
+            sorter: (a, b) => a.chatPersons - b.chatPersons,
258
+            render: (txt, record, index) => clickCon(txt, record),
259
+        },
260
+        {
261
+            title: '点赞数',
262
+            dataIndex: 'favorNum',
263
+            key: 'favorNum',
179
             align: 'center',
264
             align: 'center',
180
-            sorter: (a, b) => a.clickNum - b.clickNum,
181
-            render: (_, record) => <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => clickCount(record.personId)} >{record.clickNum}</span></>,
265
+            sorter: (a, b) => a.favorNum - b.favorNum,
266
+            render: (txt, record, index) => clickCon(txt, record),
182
         },
267
         },
183
     ];
268
     ];
269
+    // 下载文档
270
+    function download(data) {
271
+        if (!data) {
272
+            return
273
+        }
274
+        const url = window.URL.createObjectURL(new Blob([data]))
275
+        const link = document.createElement('a')
276
+        link.style.display = 'none'
277
+        link.href = url
278
+        link.setAttribute('download', '置业顾问KPI.xlsx')
279
+        document.body.append(link)
280
+        link.click()
281
+    }
282
+    // 导出
283
+    function exportRecord() {
284
+        request({ ...apis.stats.exportConsultantKPI, responseType: 'blob', params: { startDate: formData.startDate, endDate: formData.endDate, buildingId: formData.buildingId } })
285
+            .then(response => {
286
+                download(response)
287
+            }).catch(error => {
184
 
288
 
185
-
186
-
289
+            })
290
+    }
291
+    // 默认日期
292
+    const dateRange = [
293
+        moment(formData.startDate),
294
+        moment(formData.endDate),
295
+    ]
296
+    // const list = data.records
297
+    // const _list = list && list.length > 0 ? [totalRow, ...list] : [];
187
     return (
298
     return (
188
 
299
 
189
         <>
300
         <>
190
-            <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
301
+            <Form layout="inline">
191
                 <div style={{ display: 'flex', alignItems: 'center' }}>
302
                 <div style={{ display: 'flex', alignItems: 'center' }}>
192
-                    <Radio.Group buttonStyle="solid" defaultValue="a" style={{ marginRight: '16px', }}>
193
-                        <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
194
-                        <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
303
+                    <Radio.Group buttonStyle="solid" value={radioVal} onChange={setFormData} style={{ marginRight: '16px', }}>
304
+                        <Radio.Button value={7}>最近7天</Radio.Button>
305
+                        <Radio.Button value={30}>最近1月</Radio.Button>
195
                     </Radio.Group>
306
                     </Radio.Group>
196
                     <Form.Item>
307
                     <Form.Item>
197
-                        {getFieldDecorator('shareTime')(
198
-                            <RangePicker placeholder={['开始日期', '结束日期']} />
199
-                        )}
308
+                        <RangePicker value={dateRange} onChange={handleDateChange} placeholder={['开始日期', '结束日期']} />
200
                     </Form.Item>
309
                     </Form.Item>
201
                     <Form.Item>
310
                     <Form.Item>
202
-                        {getFieldDecorator('buildingId')(
203
-                            <BuildSelect />,
204
-                        )}
311
+                        <BuildSelect value={formData.buildingId} onChange={handleBuildingChange} />
205
                     </Form.Item>
312
                     </Form.Item>
206
                     <Form.Item style={{ position: 'absolute', right: '38px' }}>
313
                     <Form.Item style={{ position: 'absolute', right: '38px' }}>
207
-                        <Button type="primary" onClick={handleReset}>查询</Button>
314
+                        <Button type="primary" onClick={handleSubmit}>查询</Button>
208
                         <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
315
                         <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
209
                     </Form.Item>
316
                     </Form.Item>
210
                 </div>
317
                 </div>
211
             </Form>
318
             </Form>
212
-            <Table rowKey="KPIRecords"
319
+            <Button type="primary" onClick={exportRecord} style={{ float: 'right', margin: '20px 23px 20px 0', zIndex: 1 }}>
320
+                导出
321
+          </Button>
322
+            <Table rowKey={record => (record.userId + record.buildingId || '')}
213
                 style={{ marginTop: '30px' }}
323
                 style={{ marginTop: '30px' }}
214
                 dataSource={data.records}
324
                 dataSource={data.records}
215
                 columns={columns}
325
                 columns={columns}

+ 131
- 0
src/pages/statistical/consultant/sharetable.jsx 파일 보기

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Button, Table, Pagination, Select, Input, Icon } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import apis from '../../../services/apis';
6
+import request from '../../../utils/request'
7
+
8
+/**
9
+  @param {*} props
10
+  @returns
11
+ */
12
+const { Option } = Select;
13
+
14
+function record(props) {
15
+    const [radioVal, updateRadioVal] = useState(7)
16
+    const [formData, updateFormData] = useState({
17
+        pageNum: 1,
18
+        pageSize: 10,
19
+        ...props.location.query,
20
+    })
21
+
22
+    // 获取初始化数据
23
+    const [data, setData] = useState({})
24
+
25
+    useEffect(() => {
26
+        getList(formData);
27
+    }, [])
28
+
29
+    // 查询列表
30
+    const getList = (params) => {
31
+        request({ ...apis.stats.totalPersons, params: { ...params }, }).then((data) => {
32
+            setData(data)
33
+        })
34
+    }
35
+
36
+    //重置搜索
37
+    function handleReset() {
38
+        props.form.resetFields();
39
+    }
40
+
41
+    // 提交事件
42
+    const handleSubmit = (e) => {
43
+        e.preventDefault();
44
+        props.form.validateFields((err, values) => {
45
+            if (!err) {
46
+                console.log('提交数据: ', values)
47
+
48
+            }
49
+        });
50
+        // getList(formData);
51
+    }
52
+    // 更新页码
53
+    const changePageNum = (pageNumber) => {
54
+        props.form.validateFields((err, values) => {
55
+            if (!err) {
56
+                getList({ ...formData, pageNum: pageNumber });
57
+            }
58
+        });
59
+    }
60
+
61
+
62
+    // 表格数据
63
+    const columns = [
64
+
65
+        {
66
+            title: '分享标题',
67
+            dataIndex: 'intention',
68
+            key: 'intention',
69
+            align: 'center',
70
+        },
71
+        {
72
+            title: '分享时间',
73
+            dataIndex: 'userName',
74
+            key: 'userName',
75
+            align: 'center',
76
+            render: (_, record) => <><span>{record.reportDate && moment(record.reportDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
77
+        },
78
+
79
+    ];
80
+
81
+    const { getFieldDecorator } = props.form
82
+    return (
83
+
84
+        <>
85
+            <Button type="danger" style={{ margin: '0 0 18px 8px' }} onClick={() => router.go(-1)}>返回</Button>
86
+            <Form layout="inline">
87
+                <div style={{ display: 'flex', alignItems: 'center' }}>
88
+                    <Form.Item>
89
+                        {getFieldDecorator('eventType')(
90
+                            <Select placeholder="分享类型" style={{ width: 150 }}>
91
+                                <Option value="activity_share">报名活动</Option>
92
+                                <Option value="help_share">助力活动</Option>
93
+                                <Option value="group_share">拼团活动</Option>
94
+                                <Option value="h5_share">H5活动</Option>
95
+                                <Option value="live_share">直播活动</Option>
96
+                                <Option value="house_share">房源列表</Option>
97
+                                <Option value="building_share">项目</Option>
98
+                                <Option value="news_share">资讯</Option>
99
+                                <Option value="index_share">首页</Option>
100
+                            </Select>
101
+                        )}
102
+                    </Form.Item>
103
+                    <Form.Item>
104
+                        {getFieldDecorator('activityName')(
105
+                            <Input
106
+                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
107
+                                placeholder="分享标题"
108
+                            />,
109
+                        )}
110
+                    </Form.Item>
111
+                    <Form.Item style={{ position: 'absolute', right: '38px' }}>
112
+                        <Button type="primary" onClick={handleSubmit}>搜索</Button>
113
+                        <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
114
+                    </Form.Item>
115
+                </div>
116
+            </Form>
117
+            <Table rowKey={record => (record.userId + record.buildingId || '')}
118
+                style={{ marginTop: '30px' }}
119
+                dataSource={data.records}
120
+                columns={columns}
121
+                pagination={false}
122
+            />
123
+            < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
124
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
125
+            </div>
126
+        </>
127
+    )
128
+}
129
+const WrappedHeader = Form.create({ name: 'record' })(record);
130
+
131
+export default WrappedHeader

+ 112
- 0
src/pages/statistical/consultant/table.jsx 파일 보기

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Button, Table, Pagination, Radio, Typography, Avatar } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
6
+import apis from '../../../services/apis';
7
+import request from '../../../utils/request'
8
+
9
+/**
10
+  @param {*} props
11
+  @returns
12
+ */
13
+const { Text } = Typography;
14
+
15
+function record(props) {
16
+    const [formData, updateFormData] = useState({
17
+        pageNum: 1,
18
+        pageSize: 10,
19
+        ...props.location.query,
20
+
21
+    })
22
+
23
+    // 获取初始化数据
24
+    const [data, setData] = useState({})
25
+
26
+
27
+    useEffect(() => {
28
+        getList(formData);
29
+    }, [])
30
+
31
+    // 查询列表
32
+    const getList = (params) => {
33
+        request({ ...apis.stats.totalPersons, params: { ...params }, }).then((data) => {
34
+            setData(data)
35
+        })
36
+    }
37
+
38
+    // 更新页码
39
+    const changePageNum = (pageNumber) => {
40
+        props.form.validateFields((err, values) => {
41
+            if (!err) {
42
+                getList({ ...props.location.query, pageNum: pageNumber });
43
+            }
44
+        });
45
+    }
46
+    const toPersonDetail = (personId) => {
47
+        router.push({
48
+            pathname: '/customer/customerlist/publicCustomerDetail',
49
+            query: {
50
+                id: personId,
51
+            },
52
+        });
53
+    }
54
+    // 表格数据
55
+    const columns = [
56
+
57
+        {
58
+            title: '头像',
59
+            dataIndex: 'picture',
60
+            key: 'picture',
61
+            align: 'center',
62
+            render: (_, record) => <Avatar shape="square" src={record.picture || record.avatarurl} size={64} icon="user" />,
63
+        },
64
+        {
65
+            title: '姓名',
66
+            dataIndex: 'name',
67
+            key: 'name',
68
+            align: 'center',
69
+            render: (_, record) => <span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => toPersonDetail(record.personId)} >{record.name}</span>,
70
+        },
71
+        {
72
+            title: '电话',
73
+            dataIndex: 'phone',
74
+            key: 'phone',
75
+            align: 'center',
76
+        },
77
+        {
78
+            title: '性别',
79
+            dataIndex: 'sex',
80
+            key: 'sex',
81
+            align: 'center',
82
+            render: (_, record) => <span>{record.sex == 1 ? '男' : '女'}</span>,
83
+        },
84
+        {
85
+            title: '报备时间',
86
+            dataIndex: 'reportDate',
87
+            key: 'reportDate',
88
+            align: 'center',
89
+            render: (_, record) => <><span>{record.reportDate && moment(record.reportDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
90
+        },
91
+
92
+    ];
93
+
94
+    return (
95
+
96
+        <>
97
+            <Button type="danger" style={{ marginLeft: '18px' }} onClick={() => router.go(-1)}>返回</Button>
98
+            <Table rowKey={record => (record.phone + record.buildingId || '')}
99
+                style={{ marginTop: '30px' }}
100
+                dataSource={data.records}
101
+                columns={columns}
102
+                pagination={false}
103
+            />
104
+            < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
105
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
106
+            </div>
107
+        </>
108
+    )
109
+}
110
+const WrappedHeader = Form.create({ name: 'record' })(record);
111
+
112
+export default WrappedHeader

+ 158
- 0
src/pages/statistical/consultant/visitNum.jsx 파일 보기

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Button, Table, Pagination, Select, Input, Icon } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import apis from '../../../services/apis';
6
+import request from '../../../utils/request'
7
+
8
+/**
9
+  @param {*} props
10
+  @returns
11
+ */
12
+const { Option } = Select;
13
+
14
+function record(props) {
15
+    const [radioVal, updateRadioVal] = useState(7)
16
+    const [formData, updateFormData] = useState({
17
+        pageNum: 1,
18
+        pageSize: 10,
19
+        ...props.location.query,
20
+    })
21
+
22
+    // 获取初始化数据
23
+    const [data, setData] = useState({})
24
+
25
+    useEffect(() => {
26
+        getList(formData);
27
+    }, [])
28
+
29
+    // 查询列表
30
+    const getList = (params) => {
31
+        request({ ...apis.stats.totalPersons, params: { ...params }, }).then((data) => {
32
+            setData(data)
33
+        })
34
+    }
35
+
36
+    //重置搜索
37
+    function handleReset() {
38
+        props.form.resetFields();
39
+    }
40
+
41
+    // 提交事件
42
+    const handleSubmit = (e) => {
43
+        e.preventDefault();
44
+        props.form.validateFields((err, values) => {
45
+            if (!err) {
46
+                console.log('提交数据: ', values)
47
+
48
+            }
49
+        });
50
+        // getList(formData);
51
+    }
52
+    // 更新页码
53
+    const changePageNum = (pageNumber) => {
54
+        props.form.validateFields((err, values) => {
55
+            if (!err) {
56
+                getList({ ...formData, pageNum: pageNumber });
57
+            }
58
+        });
59
+    }
60
+
61
+
62
+    // 表格数据
63
+    const columns = [
64
+
65
+        {
66
+            title: '分享标题',
67
+            dataIndex: 'intention',
68
+            key: 'intention',
69
+            align: 'center',
70
+        },
71
+        {
72
+            title: '姓名',
73
+            dataIndex: 'name',
74
+            key: 'name',
75
+            align: 'center',
76
+        },
77
+        {
78
+            title: '电话',
79
+            dataIndex: 'phone',
80
+            key: 'phone',
81
+            align: 'center',
82
+        },
83
+        {
84
+            title: '性别',
85
+            dataIndex: 'sex',
86
+            key: 'sex',
87
+            align: 'center',
88
+            render: (_, record) => <span>{record.sex == 1 ? '男' : '女'}</span>,
89
+        },
90
+        {
91
+            title: '访问时间',
92
+            dataIndex: 'userName',
93
+            key: 'userName',
94
+            align: 'center',
95
+            render: (_, record) => <><span>{record.reportDate && moment(record.reportDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
96
+        },
97
+
98
+    ];
99
+
100
+    const { getFieldDecorator } = props.form
101
+    return (
102
+
103
+        <>
104
+            <Button type="danger" style={{ margin: '0 0 18px 8px' }} onClick={() => router.go(-1)}>返回</Button>
105
+            <Form layout="inline">
106
+                <div style={{ display: 'flex', alignItems: 'center' }}>
107
+                    <Form.Item>
108
+                        {getFieldDecorator('eventType')(
109
+                            <Select placeholder="分享类型" style={{ width: 150 }}>
110
+                                <Option value="activity_share">报名活动</Option>
111
+                                <Option value="help_share">助力活动</Option>
112
+                                <Option value="group_share">拼团活动</Option>
113
+                                <Option value="h5_share">H5活动</Option>
114
+                                <Option value="live_share">直播活动</Option>
115
+                                <Option value="house_share">房源列表</Option>
116
+                                <Option value="building_share">项目</Option>
117
+                                <Option value="news_share">资讯</Option>
118
+                                <Option value="index_share">首页</Option>
119
+                            </Select>
120
+                        )}
121
+                    </Form.Item>
122
+                    <Form.Item>
123
+                        {getFieldDecorator('activityName')(
124
+                            <Input
125
+                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
126
+                                placeholder="分享标题"
127
+                            />,
128
+                        )}
129
+                    </Form.Item>
130
+                    <Form.Item>
131
+                        {getFieldDecorator('userName')(
132
+                            <Input
133
+                                prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
134
+                                placeholder="用户名"
135
+                            />,
136
+                        )}
137
+                    </Form.Item>
138
+                    <Form.Item style={{ position: 'absolute', right: '38px' }}>
139
+                        <Button type="primary" onClick={handleSubmit}>搜索</Button>
140
+                        <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
141
+                    </Form.Item>
142
+                </div>
143
+            </Form>
144
+            <Table rowKey={record => (record.userId + record.buildingId || '')}
145
+                style={{ marginTop: '30px' }}
146
+                dataSource={data.records}
147
+                columns={columns}
148
+                pagination={false}
149
+            />
150
+            < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
151
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
152
+            </div>
153
+        </>
154
+    )
155
+}
156
+const WrappedHeader = Form.create({ name: 'record' })(record);
157
+
158
+export default WrappedHeader

+ 111
- 0
src/pages/statistical/consultant/visitPersons.jsx 파일 보기

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Button, DatePicker, Table, Pagination, Radio, Typography, Avatar } from 'antd';
3
+import router from 'umi/router';
4
+import moment from 'moment';
5
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
6
+import apis from '../../../services/apis';
7
+import request from '../../../utils/request'
8
+
9
+/**
10
+  @param {*} props
11
+  @returns
12
+ */
13
+const { RangePicker } = DatePicker;
14
+const { Text } = Typography;
15
+
16
+function record(props) {
17
+    const [formData, updateFormData] = useState({
18
+        pageNum: 1,
19
+        pageSize: 10,
20
+        ...props.location.query,
21
+
22
+    })
23
+
24
+    // 获取初始化数据
25
+    const [data, setData] = useState({})
26
+
27
+
28
+    useEffect(() => {
29
+        getList(formData);
30
+    }, [])
31
+
32
+    // 查询列表
33
+    const getList = (params) => {
34
+        request({ ...apis.stats.totalPersons, params: { ...params }, }).then((data) => {
35
+            setData(data)
36
+        })
37
+    }
38
+
39
+    // 更新页码
40
+    const changePageNum = (pageNumber) => {
41
+        props.form.validateFields((err, values) => {
42
+            if (!err) {
43
+                getList({ ...props.location.query, pageNum: pageNumber });
44
+            }
45
+        });
46
+    }
47
+    const toPersonDetail = (personId) => {
48
+        router.push({
49
+            pathname: '/customer/customerlist/publicCustomerDetail',
50
+            query: {
51
+                id: personId,
52
+            },
53
+        });
54
+    }
55
+    // 表格数据
56
+    const columns = [
57
+        {
58
+            title: '姓名',
59
+            dataIndex: 'name',
60
+            key: 'name',
61
+            align: 'center',
62
+        },
63
+        {
64
+            title: '电话',
65
+            dataIndex: 'phone',
66
+            key: 'phone',
67
+            align: 'center',
68
+        },
69
+        {
70
+            title: '性别',
71
+            dataIndex: 'sex',
72
+            key: 'sex',
73
+            align: 'center',
74
+            render: (_, record) => <span>{record.sex == 1 ? '男' : '女'}</span>,
75
+        },
76
+        {
77
+            title: '访问次数',
78
+            dataIndex: 'visitNum',
79
+            key: 'visitNum',
80
+            align: 'center',
81
+            render: (_, record) => <span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => toPersonDetail(record.personId)} >{record.visitNum}</span>,
82
+        },
83
+        {
84
+            title: '最后访问时间',
85
+            dataIndex: 'reportDate',
86
+            key: 'reportDate',
87
+            align: 'center',
88
+            render: (_, record) => <><span>{record.reportDate && moment(record.reportDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
89
+        },
90
+
91
+    ];
92
+
93
+    return (
94
+
95
+        <>
96
+            <Button type="danger" style={{ marginLeft: '18px' }} onClick={() => router.go(-1)}>返回</Button>
97
+            <Table rowKey={record => (record.phone + record.buildingId || '')}
98
+                style={{ marginTop: '30px' }}
99
+                dataSource={data.records}
100
+                columns={columns}
101
+                pagination={false}
102
+            />
103
+            < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
104
+                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
105
+            </div>
106
+        </>
107
+    )
108
+}
109
+const WrappedHeader = Form.create({ name: 'record' })(record);
110
+
111
+export default WrappedHeader

+ 23
- 7
src/services/apis.js 파일 보기

1425
     },
1425
     },
1426
   },
1426
   },
1427
   taH5SampleManager: {
1427
   taH5SampleManager: {
1428
-    taH5Demand:{
1428
+    taH5Demand: {
1429
       url: `${prefix}/taH5Demand`,
1429
       url: `${prefix}/taH5Demand`,
1430
       method: 'GET',
1430
       method: 'GET',
1431
       action: 'admin.taH5Demand.get',
1431
       action: 'admin.taH5Demand.get',
1432
     },
1432
     },
1433
-    addTaH5Demand:{
1433
+    addTaH5Demand: {
1434
       url: `${prefix}/taH5Demand`,
1434
       url: `${prefix}/taH5Demand`,
1435
       method: 'POST',
1435
       method: 'POST',
1436
       action: 'admin.taH5Demand.get',
1436
       action: 'admin.taH5Demand.get',
1437
     },
1437
     },
1438
-    taH5DemandById:{
1438
+    taH5DemandById: {
1439
       url: `${prefix}/taH5Demand/:id`,
1439
       url: `${prefix}/taH5Demand/:id`,
1440
       method: 'GET',
1440
       method: 'GET',
1441
       action: 'admin.taH5Demand.get',
1441
       action: 'admin.taH5Demand.get',
1442
     },
1442
     },
1443
-    updateH5DemandById:{
1443
+    updateH5DemandById: {
1444
       url: `${prefix}/taH5Demand/:id`,
1444
       url: `${prefix}/taH5Demand/:id`,
1445
       method: 'PUT',
1445
       method: 'PUT',
1446
       action: 'admin.taH5Demand.get',
1446
       action: 'admin.taH5Demand.get',
1447
     },
1447
     },
1448
-    batchDelDemands:{
1448
+    batchDelDemands: {
1449
       url: `${prefix}/batchDelTaH5Demands`,
1449
       url: `${prefix}/batchDelTaH5Demands`,
1450
       method: 'PUT',
1450
       method: 'PUT',
1451
       action: 'admin.taH5Demand.get',
1451
       action: 'admin.taH5Demand.get',
1562
       url: `${prefix}/taContractTemplate/:id`,
1562
       url: `${prefix}/taContractTemplate/:id`,
1563
       action: 'admin.getContractTemplate.get',
1563
       action: 'admin.getContractTemplate.get',
1564
     },
1564
     },
1565
-   
1565
+
1566
   },
1566
   },
1567
   manage: {
1567
   manage: {
1568
     list: {
1568
     list: {
1591
       method: 'GET',
1591
       method: 'GET',
1592
       url: `${prefix}/stats/tableList`,
1592
       url: `${prefix}/stats/tableList`,
1593
       action: 'admin.contract.list.get',
1593
       action: 'admin.contract.list.get',
1594
-    }
1594
+    },
1595
+    consultantKPI: {
1596
+      method: 'GET',
1597
+      url: `${prefix}/stats/consultant/kpi`,
1598
+      action: 'admin.contract.list.get',
1599
+    },
1600
+    exportConsultantKPI: {
1601
+      method: 'POST',
1602
+      url: `${prefix}/stats/consultant/kpi`,
1603
+      action: 'admin.contract.list.post',
1604
+    },
1605
+    totalPersons: { // 客户总计
1606
+      method: 'GET',
1607
+      url: `${prefix}/stats/consultant/customer`,
1608
+      action: 'admin.contract.list.post',
1609
+    },
1610
+
1595
   }
1611
   }
1596
 }
1612
 }