ソースを参照

Merge branch 'dev'

魏超 5 年 前
コミット
c66943b658
共有26 個のファイルを変更した786 個の追加101 個の削除を含む
  1. 1
    1
      config/routes.js
  2. 1
    1
      src/components/GlobalHeader/AvatarDropdown.jsx
  3. 45
    0
      src/components/SelectButton/WxDictSelect.jsx
  4. 1
    1
      src/pages/activity/SignList.jsx
  5. 23
    0
      src/pages/activity/drainage/DrainageList.jsx
  6. 14
    5
      src/pages/building/list/add/components/base.jsx
  7. 1
    1
      src/pages/building/list/add/components/buildingImage.jsx
  8. 1
    1
      src/pages/building/list/add/components/buildingProjectType.jsx
  9. 29
    0
      src/pages/building/list/add/components/imageSet.jsx
  10. 35
    1
      src/pages/building/list/add/components/modalImage.jsx
  11. 10
    1
      src/pages/customer/customerlist/customerDetail.jsx
  12. 6
    0
      src/pages/customer/customerlist/index.jsx
  13. 10
    1
      src/pages/customer/customerlist/publicCustomerDetail.jsx
  14. 52
    5
      src/pages/customer/drift/index.jsx
  15. 11
    4
      src/pages/indexEcharts/components/IntentionalCustomers.jsx
  16. 289
    0
      src/pages/indexEcharts/components/UserBehaviorIndex.jsx
  17. 1
    7
      src/pages/indexEcharts/components/UserConversion.jsx
  18. 3
    0
      src/pages/indexEcharts/components/UserSex.jsx
  19. 20
    12
      src/pages/indexEcharts/components/UserSource.jsx
  20. 139
    0
      src/pages/indexEcharts/components/UserSourceDetail.jsx
  21. 9
    14
      src/pages/indexEcharts/components/UserSourcepie.jsx
  22. 2
    2
      src/pages/indexEcharts/index.jsx
  23. 55
    38
      src/pages/indexEcharts/userSource.jsx
  24. 1
    1
      src/pages/record/drainage/DrainageVisitRecordList.jsx
  25. 22
    0
      src/services/apis.js
  26. 5
    5
      src/utils/request.js

+ 1
- 1
config/routes.js ファイルの表示

@@ -296,7 +296,7 @@ export default [
296 296
               },
297 297
               {
298 298
                 path: '/activity/helpActivity/signList',
299
-                name: '报名列表',
299
+                name: '助力记录',
300 300
                 hideInMenu: true,
301 301
                 component: './activity/helpActivity/signList',
302 302
               },

+ 1
- 1
src/components/GlobalHeader/AvatarDropdown.jsx ファイルの表示

@@ -79,7 +79,7 @@ class AvatarDropdown extends React.Component {
79 79
       <>
80 80
         <HeaderDropdown overlay={menuHeaderDropdown}>
81 81
             <span className={`${styles.action} ${styles.account}`}>
82
-              <Avatar size="small" className={styles.avatar} src={currentUser.avatar} alt="avatar" />
82
+              <Avatar size="small" className={styles.avatar} src={currentUser.avatar === null ? currentUser.photo:currentUser.avatar} alt="avatar" />
83 83
               <span className={styles.name}>{currentUser.userName}</span>
84 84
             </span>
85 85
         </HeaderDropdown>

+ 45
- 0
src/components/SelectButton/WxDictSelect.jsx ファイルの表示

@@ -0,0 +1,45 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const WxDictSelect = props => {
15
+  const [data, setData] = useState([])
16
+  const [value, setValue] = useState([])
17
+  useEffect(() => {
18
+    getWxDictList();
19
+  }, [props.value])
20
+
21
+
22
+  const getWxDictList = e => {
23
+    request({ ...apis.wxDict.list, params: { pageNumber: 1, pageSize: 999 } }).then(data => {
24
+        setData(data.records)
25
+        // 默认选中第一个
26
+    })
27
+  }
28
+
29
+  return (
30
+      <Select
31
+      showSearch
32
+      value={props.value}
33
+      style={{ width: '250px' }}
34
+      placeholder="请选择用户来源"
35
+      onChange={props.onChange}
36
+      filterOption={(input, option) =>
37
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
38
+      }>
39
+          {data.map(wxDict => (
40
+            <Option key={wxDict.sceneType} value={wxDict.sceneType}>{wxDict.sceneAlias}</Option>
41
+          ))}
42
+      </Select>
43
+  )
44
+}
45
+export default WxDictSelect

+ 1
- 1
src/pages/activity/SignList.jsx ファイルの表示

@@ -121,7 +121,7 @@ const handleSubmit = (e, props) => {
121 121
         const link = document.createElement('a')
122 122
         link.style.display = 'none'
123 123
         link.href = url
124
-        link.setAttribute('download', '助力者记录.xlsx')
124
+        link.setAttribute('download', '报名列表.xlsx')
125 125
         document.body.append(link)
126 126
         link.click()
127 127
       }).catch(() => {

+ 23
- 0
src/pages/activity/drainage/DrainageList.jsx ファイルの表示

@@ -73,6 +73,23 @@ const header = (props) => {
73 73
     });
74 74
   }
75 75
 
76
+  const newQrcode = row => {
77
+    const x = new XMLHttpRequest();
78
+    const resourceUrl = row.qrCode
79
+    console.log(resourceUrl);
80
+    x.open('GET', resourceUrl, true);
81
+    x.responseType = 'blob';
82
+    x.onload = function (e) {
83
+      const url = window.URL.createObjectURL(x.response)
84
+      const a = document.createElement('a');
85
+      a.href = url;
86
+      a.style.display = 'none'
87
+      a.download = 'H5二维码.png';
88
+      a.click();
89
+    }
90
+    x.send();
91
+  }
92
+
76 93
   const exchangeDrainage = drainage => () => {
77 94
     if(drainage.status === 1){
78 95
       if(drainage.isMiniapp){
@@ -206,6 +223,12 @@ const header = (props) => {
206 223
               数据
207 224
             </span>
208 225
           </AuthButton>
226
+          <AuthButton name="admin.taDrainage.id.delete" noRight={null}>
227
+            <span>{datas.isMiniapp === false ? "" : <span style={{ right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer', marginLeft: 20 }} onClick={newQrcode.bind(this, datas)}>
228
+              下载二维码
229
+            </span>}</span>
230
+            
231
+          </AuthButton >
209 232
         </>
210 233
       ),
211 234
     },

+ 14
- 5
src/pages/building/list/add/components/base.jsx ファイルの表示

@@ -83,9 +83,9 @@ function AddBuilding(props) {
83 83
    // 获取详情信息
84 84
    function getById(currentId) {
85 85
     request({ ...apis.building.buildingGetById, urlData: { id: currentId } }).then(res => {
86
-      if (res.openingDate !== null) {
87
-        res.openingDate = moment(res.openingDate)
88
-      }
86
+      // if (res.openingDate !== null) {
87
+      //   res.openingDate = moment(res.openingDate)
88
+      // }
89 89
       if (res.receivedDate !== null) {
90 90
         res.receivedDate = moment(res.receivedDate)
91 91
       }
@@ -161,7 +161,7 @@ function AddBuilding(props) {
161 161
       data.mapJson = poi
162 162
     }
163 163
 
164
-    data.openingDate = moment(data.openingDate, 'yyyy-MM-dd HH:mm:ss')
164
+    // data.openingDate = moment(data.openingDate, 'yyyy-MM-dd HH:mm:ss')
165 165
     data.receivedDate = moment(data.receivedDate, 'yyyy-MM-dd HH:mm:ss')
166 166
     // 项目主图
167 167
     data.img = data.avatarImage && data.avatarImage.map((item, index) => ({ imgType: 'banner', url: item, orderNo: index + 1 }))
@@ -363,7 +363,7 @@ function AddBuilding(props) {
363 363
             {getFieldDecorator('price')(<Input type="number" style={{ width: '210px' }}/>)}元/m²
364 364
           </Form.Item>
365 365
           <Form.Item label="开盘时间" >
366
-            {getFieldDecorator('openingDate')(<DatePicker format="YYYY/MM/DD" />)}
366
+            {getFieldDecorator('openingDate')(<Input placeholder="预计xxxx年xx月开盘" maxLength = "15"/>)}
367 367
           </Form.Item>
368 368
           <Form.Item label="电话" >
369 369
             {getFieldDecorator('tel', {
@@ -549,6 +549,15 @@ function AddBuilding(props) {
549 549
           <Form.Item label="装修标准" >
550 550
             {getFieldDecorator('decoration')(<Input />)}
551 551
           </Form.Item>
552
+          <Form.Item label="开发商" >
553
+            {getFieldDecorator('propertyDeveloper')(<Input placeholder="不超过15个字" maxLength = "15"/>)}
554
+          </Form.Item>
555
+          <Form.Item label="备案名" >
556
+            {getFieldDecorator('recordName')(<Input placeholder="不超过15个字" maxLength = "15"/>)}
557
+          </Form.Item>
558
+          <Form.Item label="楼栋总数" >
559
+            {getFieldDecorator('buildingNum')(<Input min={0} type="number" style={{ width: 80}}/>)}
560
+          </Form.Item>
552 561
           {/* <Form.Item label="交房时间" >
553 562
             {getFieldDecorator('receivedDate')(<DatePicker />)}
554 563
           </Form.Item> */}

+ 1
- 1
src/pages/building/list/add/components/buildingImage.jsx ファイルの表示

@@ -123,7 +123,7 @@ function ModalEdi(props) {
123 123
             })(<Input />)}
124 124
           </Form.Item>
125 125
           {
126
-            !props.noImage && <Form.Item label="选择图片">
126
+            !props.noImage && <Form.Item label="选择图片" help="建议图片尺寸256px*252px,比例4:3,格式:jpg">
127 127
             {getFieldDecorator('img', {
128 128
               rules: [
129 129
                 {

+ 1
- 1
src/pages/building/list/add/components/buildingProjectType.jsx ファイルの表示

@@ -74,7 +74,7 @@ class TypeForm extends React.Component {
74 74
               {getFieldDecorator('status')(<Input disabled />)}
75 75
             </Form.Item>
76 76
             <Form.Item label="价格">
77
-              {getFieldDecorator('price')(<Input type="number" placeholder="元/㎡" onChange={e => this.onChange(e, 'price')} />)}
77
+              {getFieldDecorator('price')(<Input placeholder="元/㎡" maxLength="9" onChange={e => this.onChange(e, 'price')} />)}
78 78
             </Form.Item>
79 79
             <Form.Item label="装修标准">
80 80
               {getFieldDecorator('decoration')(<Input onChange={e => this.onChange(e, 'decoration')} />)}

+ 29
- 0
src/pages/building/list/add/components/imageSet.jsx ファイルの表示

@@ -25,6 +25,29 @@ const saleType = [
25 25
   },
26 26
 ]
27 27
 
28
+const houseType = [
29
+  {
30
+    id: 1,
31
+    name: '1室',
32
+  },
33
+  {
34
+    id: 2,
35
+    name: '2室',
36
+  },
37
+  {
38
+    id: 3,
39
+    name: '3室',
40
+  },
41
+  {
42
+    id: 4,
43
+    name: '4室',
44
+  },
45
+  {
46
+    id: 5,
47
+    name: '5室及以上',
48
+  },
49
+]
50
+
28 51
 /**
29 52
  *图片设置
30 53
  *
@@ -115,6 +138,12 @@ function imageSet(props) {
115 138
       key: 'marketStatus',
116 139
       render: (_, record) => <span>{ (saleType.filter(x => x.id == record.marketStatus)[0] || {}).name }</span>,
117 140
     },
141
+    {
142
+      title: '户型',
143
+      dataIndex: 'houseType',
144
+      key: 'houseType',
145
+      render: (_, record) => <span>{ (houseType.filter(x => x.id == record.houseType)[0] || {}).name }</span>,
146
+    },
118 147
     {
119 148
       title: '面积',
120 149
       dataIndex: 'buildingArea',

+ 35
- 1
src/pages/building/list/add/components/modalImage.jsx ファイルの表示

@@ -42,6 +42,29 @@ const saleType = [
42 42
   },
43 43
 ]
44 44
 
45
+const houseType = [
46
+  {
47
+    id: '1',
48
+    name: '1室',
49
+  },
50
+  {
51
+    id: '2',
52
+    name: '2室',
53
+  },
54
+  {
55
+    id: '3',
56
+    name: '3室',
57
+  },
58
+  {
59
+    id: '4',
60
+    name: '4室',
61
+  },
62
+  {
63
+    id: '5',
64
+    name: '5室及以上',
65
+  },
66
+]
67
+
45 68
 /**
46 69
  * 图片信息
47 70
  *
@@ -186,7 +209,7 @@ class ModalImage extends React.Component {
186 209
                   </Select>,
187 210
                 )}
188 211
               </Form.Item>
189
-              <Form.Item label="图片">
212
+              <Form.Item label="图片" help="建议图片尺寸336px*336px,比例1:1,格式:jpg">
190 213
               {getFieldDecorator('img', {
191 214
                   rules: [{ required: true, message: '请上传户型图片' }],
192 215
               })(
@@ -194,6 +217,17 @@ class ModalImage extends React.Component {
194 217
                 <ImageUpload />,
195 218
               )}
196 219
               </Form.Item>
220
+              <Form.Item label="户型">
221
+                {getFieldDecorator('houseType', {
222
+                  rules: [{ required: true, message: '请选择户型' }],
223
+                })(
224
+                  <Select placeholder="户型">
225
+                    {
226
+                      houseType.map((item, _) => <Option value={item.id}>{item.name}</Option>)
227
+                    }
228
+                  </Select>,
229
+                )}
230
+              </Form.Item>
197 231
               <Form.Item label="面积" help="单位 ㎡">
198 232
                 {getFieldDecorator('buildingArea')(<Input type="number" precision = '2' min='0.00' step='0.01'/>)}
199 233
               </Form.Item>

+ 10
- 1
src/pages/customer/customerlist/customerDetail.jsx ファイルの表示

@@ -5,6 +5,7 @@ import styles from './style.less';
5 5
 import apis from '../../../services/apis';
6 6
 import request from '../../../utils/request';
7 7
 import moment from 'moment';
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8 9
 
9 10
 import router from 'umi/router';
10 11
 
@@ -19,6 +20,7 @@ function header(props) {
19 20
   const [tableData, setTableDataData] = useState([{}])
20 21
   const [dataConsultant, setDataonsultant] = useState({})
21 22
   const [intentionData, setIntentionData] = useState([])
23
+  const [buildingIdValue, setBuildingIdData] = useState()
22 24
 
23 25
   // eslint-disable-next-line react-hooks/rules-of-hooks
24 26
   useEffect(() => {
@@ -71,6 +73,12 @@ function header(props) {
71 73
       setDataonsultant(res.geoInfo)
72 74
     })
73 75
   }
76
+
77
+  function changBuilding(buildingId) {
78
+    setBuildingIdData(buildingId)
79
+    getById({ pageNumber: 1, pageSize: 10, buildingId: buildingId })
80
+  }
81
+
74 82
   const columns = [
75 83
     {
76 84
       title: '访问事件',
@@ -190,7 +198,8 @@ function header(props) {
190 198
       </div>
191 199
       <div className={styles.recordBox}>
192 200
         <p className={styles.tableName}>访问记录</p>
193
-        <Table dataSource={tableData.records} columns={columns} pagination={{ pageSize: 10, total: tableData.total, onChange }} />
201
+        <BuildSelect onChange={changBuilding} value={buildingIdValue} />
202
+        <Table dataSource={tableData.records} columns={columns} style={{marginTop: '15px'}} pagination={{ pageSize: 10, total: tableData.total, onChange }} />
194 203
         {/* <Pagination showQuickJumper defaultCurrent={1} total={data.records} onChange={e => changePageNum(e)} current={data.visitRecords.total}/> */}
195 204
       </div>
196 205
 

+ 6
- 0
src/pages/customer/customerlist/index.jsx ファイルの表示

@@ -12,6 +12,7 @@ import ModalRecommendRecord from './components/recommend'
12 12
 import ChangeStatus from './components/changeStatus'
13 13
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
14 14
 import AuthButton from '@/components/AuthButton';
15
+import WxDictSelect from '@/components/SelectButton/WxDictSelect';
15 16
 
16 17
 
17 18
 const { Option } = Select;
@@ -425,6 +426,11 @@ function body(props) {
425 426
             <Input placeholder="置业顾问电话" />,
426 427
           )}
427 428
         </Form.Item>}
429
+        <Form.Item>
430
+          {getFieldDecorator('sceneType')(
431
+            <WxDictSelect />,
432
+          )}
433
+        </Form.Item>
428 434
         <Form.Item>
429 435
             <AuthButton name="admin.customer.recommend.search" noRight={null}>
430 436
               <Button type="primary" htmlType="submit" >

+ 10
- 1
src/pages/customer/customerlist/publicCustomerDetail.jsx ファイルの表示

@@ -5,6 +5,7 @@ import publicStyle from './publicStyle.less';
5 5
 import apis from '../../../services/apis';
6 6
 import request from '../../../utils/request';
7 7
 import moment from 'moment';
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8 9
 
9 10
 import router from 'umi/router';
10 11
 
@@ -19,6 +20,7 @@ function header(props) {
19 20
   const [tableData, setTableDataData] = useState([{ }])
20 21
   const [dataConsultant, setDataonsultant] = useState({})
21 22
   const [intentionData, setIntentionData] = useState([])
23
+  const [buildingIdValue, setBuildingIdData] = useState()
22 24
 
23 25
   // eslint-disable-next-line react-hooks/rules-of-hooks
24 26
   useEffect(() => {
@@ -72,6 +74,12 @@ function onChange(number) {
72 74
       setDataonsultant(res.geoInfo)
73 75
     })
74 76
   }
77
+
78
+  function changBuilding(buildingId) {
79
+    setBuildingIdData(buildingId)
80
+    getById({ pageNumber: 1, pageSize: 10, buildingId: buildingId })
81
+  }
82
+
75 83
   const columns = [
76 84
     {
77 85
       title: '访问事件',
@@ -158,7 +166,8 @@ function onChange(number) {
158 166
       </div>
159 167
       <div className={publicStyle.recordBox}>
160 168
         <p className={publicStyle.tableName}>访问记录</p>
161
-        <Table dataSource={tableData.records} columns={columns} pagination={{ pageSize: 10, total: tableData.total, onChange }} />
169
+        <BuildSelect onChange={changBuilding} value={buildingIdValue} />
170
+        <Table dataSource={tableData.records} columns={columns} style={{marginTop: '15px'}} pagination={{ pageSize: 10, total: tableData.total, onChange }} />
162 171
       </div>
163 172
     </>
164 173
   )

+ 52
- 5
src/pages/customer/drift/index.jsx ファイルの表示

@@ -1,11 +1,13 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Table, Avatar, Alert } from 'antd';
2
+import { Form, Table, Avatar, Alert, Select, Button } from 'antd';
3 3
 
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
6 6
 import Styles from './style.less'
7
+import WxDictSelect from '@/components/SelectButton/WxDictSelect';
7 8
 
8
-function costomerDrift() {
9
+function costomerDrift(props) {
10
+  const { getFieldDecorator } = props.form
9 11
   // eslint-disable-next-line react-hooks/rules-of-hooks
10 12
   const [dataSources, setDataSources] = useState({ records: [] })
11 13
 
@@ -37,6 +39,24 @@ function costomerDrift() {
37 39
     getList({ pageNumber: pageNum, pageSize: 10 })
38 40
   }
39 41
 
42
+  //重置搜索
43
+  function handleReset() {
44
+    props.form.resetFields();
45
+    getList({ pageNumber: '1', pageSize: '10' })
46
+  }
47
+
48
+  // 提交事件
49
+  function handleSubmit(e) {
50
+    e.preventDefault();
51
+    props.form.validateFields((err, values) => {
52
+      if (!err) {
53
+        console.log('提交数据: ', values)
54
+        const { startDate } = values
55
+        getList({ pageNum: 1, pageSize: 10, ...values })
56
+      }
57
+    });
58
+  }
59
+
40 60
   const columns = [
41 61
     {
42 62
       title: '头像',
@@ -56,12 +76,39 @@ function costomerDrift() {
56 76
       // eslint-disable-next-line no-nested-ternary
57 77
       render: (_, record) => <><span>{ record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知' }</span></>,
58 78
     },
79
+    {
80
+      title: '用户来源',
81
+      dataIndex: 'sceneAlias',
82
+      key: 'sceneAlias',
83
+    },
59 84
   ];
60
-
85
+  
61 86
   return (
87
+    <>
88
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
89
+        <Form.Item>
90
+          {getFieldDecorator('sceneType')(
91
+            <WxDictSelect />,
92
+          )}
93
+        </Form.Item>
94
+
95
+        <Form.Item>
96
+            {/* <AuthButton name="admin.customer.recommend.search" noRight={null}> */}
97
+            <Button type="primary" htmlType="submit" >
98
+              查询
99
+            </Button>
100
+            {/* </AuthButton> */}
101
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
102
+              重置
103
+            </Button>
104
+        </Form.Item>
105
+      </Form>
106
+      <Table dataSource={dataSources.records} rowKey="drift" columns={columns} pagination={{ total: dataSources.total, onChange }} />
107
+    </>
62 108
     // eslint-disable-next-line max-len
63
-    <Table dataSource={dataSources.records} rowKey="drift" columns={columns} pagination={{ total: dataSources.total, onChange }} />
109
+    
64 110
   )
65 111
 }
66 112
 
67
-export default costomerDrift
113
+const WrappedBody = Form.create()(costomerDrift);
114
+export default WrappedBody

+ 11
- 4
src/pages/indexEcharts/components/IntentionalCustomers.jsx ファイルの表示

@@ -10,19 +10,26 @@ const UserBehavior = (props) => {
10 10
   const [data, setData] = useState({ records: [] })
11 11
   const [buildingId, setBuildingId] = useState('')
12 12
   useEffect(() => {
13
-    IntentionUsers()
13
+    IntentionUsers({ pageNum: 1, pageSize: 5 })
14 14
     // getUserBehaviorProfile(formatDate(props.startDate, props.endDate))
15 15
 
16 16
   }, [])
17 17
   function IntentionUsers (params) {
18 18
     request({
19 19
       ...apis.indexEcharts.intentionUsers,
20
-      params: { pageSize: 9999, ...params }
20
+      params: { ...params }
21 21
     }).then((data) => {
22
+      console.log(data,"datadata")
22 23
       setData(data)
23 24
     })
24 25
   }
25 26
 
27
+  // 分页
28
+  function onChange(pageNum) {
29
+    // eslint-disable-next-line react-hooks/rules-of-hooks
30
+    IntentionUsers({ pageNum: pageNum, pageSize: 5, buildingId })
31
+  }
32
+
26 33
   // getIntentionUsers({ commit }, payload) {
27 34
   //   return new Promise((resolve, reject) => {
28 35
   //     request({
@@ -78,7 +85,7 @@ const UserBehavior = (props) => {
78 85
   ];
79 86
 
80 87
   function handleBuildingChange (e) {
81
-    IntentionUsers({ buildingId: e })
88
+    IntentionUsers({  pageNum: 1, pageSize: 5, buildingId: e })
82 89
     setBuildingId(e)
83 90
   }
84 91
   return (
@@ -88,7 +95,7 @@ const UserBehavior = (props) => {
88 95
 
89 96
         <BuildSelect slot='action' onChange={(e => handleBuildingChange(e))} value={buildingId}></BuildSelect>
90 97
 
91
-        <Table rowKey="IntentionalCustomers" dataSource={data.records} columns={columns} style={{marginTop:'15px'}} pagination={false} scroll={{ y: 500 }} />
98
+        <Table rowKey="IntentionalCustomers" dataSource={data.records} columns={columns} style={{marginTop:'15px'}} pagination={{ total: data.total, defaultPageSize: 5, onChange: e => onChange(e) }} scroll={{ y: 500 }} />
92 99
 
93 100
       </div>
94 101
 

+ 289
- 0
src/pages/indexEcharts/components/UserBehaviorIndex.jsx ファイルの表示

@@ -0,0 +1,289 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import EChart from '../../../components/EchartsTest/EChart';
3
+import request from '../../../utils/request';
4
+import apis from '../../../services/apis';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import 'echarts/lib/component/dataZoom'
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message, Modal } from 'antd';
9
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
10
+
11
+const { Option } = Select;
12
+
13
+
14
+const eventcolumns = [
15
+  {
16
+    title: '编号',
17
+    dataIndex: 'recordId',
18
+    key: 'recordId',
19
+    align: 'center',
20
+    width: '16%',
21
+  },
22
+  {
23
+    title: '访问时间',
24
+    dataIndex: 'visitTime',
25
+    key: 'visitTime',
26
+    align: 'center',
27
+    width: '18%',
28
+    render: (x, row) => (
29
+      <>
30
+        <span>{ moment(row.visitTime).format('YYYY-MM-DD hh:mm:ss') }</span>
31
+      </>
32
+    ),
33
+  },
34
+  {
35
+    title: '离开时间',
36
+    dataIndex: 'leaveTime',
37
+    key: 'leaveTime',
38
+    align: 'center',
39
+    width: '18%',
40
+    render: (x, row) => (
41
+      <>
42
+        <span>{ row.leaveTime && moment(row.leaveTime).format('YYYY-MM-DD hh:mm:ss') }</span>
43
+      </>
44
+    ),
45
+  },
46
+]
47
+
48
+
49
+class EventcoModal extends React.Component {
50
+  constructor(props) {
51
+    super(props)
52
+    this.state = {
53
+      eventList: [],
54
+      visibleData: { visible: false, row: {} },
55
+    }
56
+  }
57
+
58
+  componentDidUpdate(prevProps) {
59
+    if (this.props.visibleData.visible !== prevProps.visibleData.visible) {
60
+      // eslint-disable-next-line react/no-did-update-set-state
61
+      this.setState({ visibleData: this.props.visibleData }, () => {
62
+        this.showDetails(this.props.visibleData.row)
63
+      })
64
+    }
65
+  }
66
+
67
+  showDetails = row => {
68
+    request({
69
+      ...apis.indexEcharts.userBehavior.profile,
70
+      params: { event: row.event, personId: row.personId },
71
+    }).then(data => {
72
+        this.setState({ eventList: data })
73
+    })
74
+  }
75
+
76
+  handleOk = e => {
77
+    this.props.onSuccess()
78
+  };
79
+
80
+  handleCancel = e => {
81
+    this.props.onSuccess()
82
+  };
83
+
84
+  render() {
85
+    return (
86
+      <>
87
+        <Modal
88
+          title="访问详情"
89
+          visible={this.state.visibleData.visible}
90
+          onOk={() => this.handleOk()}
91
+          onCancel={() => this.handleCancel()}
92
+          footer={null}
93
+        >
94
+         <Table rowKey="UserBehavior" dataSource={this.state.eventList} columns={eventcolumns} pagination={false} rowKey="eventall" scroll={{ y: 400 }} />
95
+        </Modal>
96
+      </>
97
+    )
98
+  }
99
+}
100
+
101
+
102
+const formatDate = (start, end) => {
103
+  const startDate = `${moment(start).format('YYYY-MM-DDT00:00:00.000')}Z`
104
+  const endDate = `${moment(end).format('YYYY-MM-DDT23:59:59.999')}Z`
105
+  return { startDate, endDate }
106
+}
107
+const UserBehaviorIndex = props => {
108
+  const [data, setData] = useState({ records: [] })
109
+  const [visibleData, setVisibleData] = useState({ visible: false, row: {} })
110
+  const [buildingId, setBuildingId] = useState('')
111
+
112
+  // 柱图
113
+  useEffect(() => {
114
+    const date = formatDate(props.startDate, props.endDate)
115
+    getUserBehaviorSummary({
116
+      ...date,
117
+      activity: props.activity,
118
+      event: props.event,
119
+      eventType: props.eventType,
120
+      buildingId: props.buildingId,
121
+    })
122
+    // getUserBehaviorProfile(formatDate(props.startDate, props.endDate))
123
+  }, [props.startDate, props.endDate, props.activity, props.event, props.eventType, props.buildingId])
124
+
125
+  const [recordList, setList] = useState([])
126
+  function getUserBehaviorSummary(params) {
127
+    request({
128
+      ...apis.indexEcharts.userBehavior.tsUserBehavior,
129
+      params,
130
+    }).then(data => {
131
+      setData(data || {})
132
+      // setList((data.data.records || []).filter(e => e.activity !== '客户'))
133
+    })
134
+  }
135
+
136
+
137
+  const seriesMaker = (data.selectUserBehavior || []).filter(e => e.activity !== '客户' && e.activity !== '首页').reduce((series, item) => {
138
+    let { date, activityCount, activity } = item
139
+    date = moment(date).format('YYYY-MM-DD')
140
+    if (!activityCount) activityCount = 0
141
+
142
+    // 使用对象, 可以去重
143
+    series[`${activity}`] = (series[`${activity}`] || []).concat([[date, activityCount]])
144
+
145
+    return series;
146
+  }, {})
147
+
148
+
149
+  const dataZoom = props.dataZoom ? [
150
+    {
151
+      type: 'inside',
152
+      start: 0,
153
+      end: 100,
154
+    },
155
+    {
156
+      type: 'slider',
157
+      start: 0,
158
+      end: 100,
159
+    },
160
+  ] : undefined
161
+
162
+
163
+  const options = {
164
+    title: {},
165
+    icon: 'rect',
166
+    legend: {
167
+      show: true,
168
+      zlevel: 10,
169
+      itemGap: 100,
170
+    },
171
+    color: ['#F12B3E', '#FE929C', '#647CE1', '#A2B9FF', '#FF844F', '#FFBB9D'],
172
+    tooltip: {
173
+      trigger: 'axis',
174
+    },
175
+    xAxis: { type: 'category' },
176
+    yAxis: {},
177
+    dataZoom,
178
+    series: Object.keys(seriesMaker).map(x => ({
179
+        type: 'line',
180
+        smooth: true,
181
+        name: x,
182
+        data: seriesMaker[x],
183
+      })),
184
+  }
185
+  function handleBuildingChange(e) {
186
+    const date = formatDate(props.startDate, props.endDate)
187
+    getUserBehaviorSummary({
188
+      ...date,
189
+      activity: props.activity,
190
+      event: props.event,
191
+      eventType: props.eventType,
192
+      buildingId: e,
193
+    })
194
+    setBuildingId(e)
195
+  }
196
+
197
+  function showDetails(row) {
198
+    setVisibleData({ visible: true, row })
199
+  }
200
+
201
+  function onSuccess() {
202
+    setVisibleData({ visible: false, row: {} })
203
+  }
204
+
205
+
206
+  const style = {
207
+    width: '100%',
208
+    height: '400px',
209
+
210
+  }
211
+
212
+  const columns = [
213
+    {
214
+      title: '访问事件',
215
+      dataIndex: 'eventName',
216
+      key: 'eventName',
217
+      align: 'center',
218
+      width: '16%',
219
+
220
+    },
221
+    {
222
+      title: '访问用户',
223
+      dataIndex: 'userName',
224
+      key: 'userName',
225
+      align: 'center',
226
+      width: '15%',
227
+
228
+    },
229
+    {
230
+      title: '访问次数',
231
+      dataIndex: 'accessCount',
232
+      key: 'accessCount',
233
+      align: 'center',
234
+      width: '17%',
235
+
236
+      render: (x, row) => (
237
+        <>
238
+          <span style={{ color: '#EF273A', cursor: 'pointer' }} onClick={() => showDetails(row)}> {row.accessCount}</span>
239
+        </>
240
+      ),
241
+    },
242
+    {
243
+      title: '首次访问时间',
244
+      dataIndex: 'visitTime',
245
+      key: 'visitTime',
246
+      align: 'center',
247
+      width: '18%',
248
+      render: (x, row) => (
249
+        <>
250
+          <span>{ row.visitTime && moment(row.visitTime).format('YYYY-MM-DD hh:mm:ss') }</span>
251
+        </>
252
+      ),
253
+    },
254
+    {
255
+      title: '离开时间',
256
+      dataIndex: 'leaveTime',
257
+      key: 'leaveTime',
258
+      width: '18%',
259
+      align: 'center',
260
+      render: (x, row) => (
261
+        <>
262
+          <span>{ row.leaveTime && moment(row.leaveTime).format('YYYY-MM-DD hh:mm:ss') }</span>
263
+        </>
264
+      ),
265
+    },
266
+  ]
267
+
268
+
269
+  return (
270
+    <>
271
+      <div>
272
+        {/* <p onClick={() => router.push('/indexEcharts/userBehavior')} style={{cursor: 'pointer'}}> */}
273
+          <span style={{ borderBottom: '1px solid #f02d40', color: '#333', fontSize: '0.12rem', fontWeight: '600' }}>用户行为</span>
274
+          {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}
275
+        {/* </p> */}
276
+        <div style={{ float: 'right', marginTop: '-40px', marginBottom: '20px' }}>
277
+          {!props.BuildSelectHide && <BuildSelect slot="action" onChange={(e => handleBuildingChange(e))} value={buildingId}></BuildSelect>}
278
+        </div>
279
+        <EChart options={options} style={style} />
280
+        {false &&
281
+          <Table rowKey="UserBehaviorTwo" dataSource={recordList} columns={columns} pagination={false} rowKey="userbehavior" scroll={{ y: 500 }} />
282
+        }
283
+      </div>
284
+      <EventcoModal visibleData={visibleData} onSuccess={() => onSuccess()} />
285
+    </>
286
+  )
287
+}
288
+
289
+export default UserBehaviorIndex

+ 1
- 7
src/pages/indexEcharts/components/UserConversion.jsx ファイルの表示

@@ -79,13 +79,7 @@ const UserSource = props => {
79 79
       radius: ['34%', '52%'],
80 80
       avoidLabelOverlap: false,
81 81
       label: {
82
-        normal: {
83
-          show: false,
84
-          position: 'center',
85
-          color: '#666666',
86
-          fontSize: 22,
87
-          formatter: '{d}%'
88
-        },
82
+        formatter: '{b} {@value}',
89 83
         emphasis: {
90 84
           show: true,
91 85
           formatter: '{d}%',

+ 3
- 0
src/pages/indexEcharts/components/UserSex.jsx ファイルの表示

@@ -51,6 +51,9 @@ const UserSource = (props) => {
51 51
       name: '性别比例',
52 52
       center: ['44%', '65%'],
53 53
       radius: ['34%', '52%'],
54
+      label: {
55
+        formatter: '{b} {@value}',
56
+      },
54 57
       data:
55 58
         dataset,
56 59
     }

+ 20
- 12
src/pages/indexEcharts/components/UserSource.jsx ファイルの表示

@@ -16,7 +16,9 @@ const formatDate = (start, end) => {
16 16
 }
17 17
 
18 18
 const UserSource = (props) => {
19
-  const [data, setData] = useState({ records: [] })
19
+  const [xData, setxData] = useState([])
20
+  const [fromData, setFromData] = useState([])
21
+  const [registerData, setRegisterData] = useState([])
20 22
   //柱图
21 23
   useEffect(() => {
22 24
     userResource(formatDate(props.startDate, props.endDate))
@@ -24,21 +26,25 @@ const UserSource = (props) => {
24 26
 
25 27
   function userResource(params) {
26 28
     request({
27
-      ...apis.indexEcharts.userResource,
29
+      ...apis.indexEcharts.selectPersonFrom,
28 30
       params,
29 31
     }).then((data) => {
30
-      setData(data)
31
-      console.log(data,"datadatadatadatavvvdatadatav")
32
+      console.log(data,"222222")
33
+      setxData(data.tdWxDicts.map(x =>  x.sceneAlias))
34
+      setFromData(data.tdWxDicts.map(x => x.fromData))
35
+      setRegisterData(data.tdWxDicts.map(x => x.registerSum))
32 36
       props.onSuccess(data)
33 37
     })
34 38
   }
35 39
 
36
-  const dataset = data || {};
37
-  const source = dataset.columnar || [];
38 40
   const subtitle = '最近7天';
39 41
   const baroptions = {
40 42
     title: { },
41
-    xAxis: { type: 'category' },
43
+    xAxis: { 
44
+              type: 'category',
45
+              data: xData,
46
+              axisLabel: {rotate: 45}
47
+            },
42 48
     legend: {
43 49
       left: '20%',
44 50
       data: ['所有用户', '注册用户']
@@ -51,6 +57,7 @@ const UserSource = (props) => {
51 57
       {
52 58
         type: 'bar', name: '所有用户', datasetIndex: 0,
53 59
         barWidth: 20,
60
+        data: fromData,
54 61
         itemStyle: {
55 62
           normal: {
56 63
             barBorderRadius: [20, 20, 0, 0],
@@ -70,6 +77,7 @@ const UserSource = (props) => {
70 77
         type: 'bar',
71 78
         name: '注册用户',
72 79
         barWidth: 20,
80
+        data: registerData,
73 81
         itemStyle: {
74 82
           normal: {
75 83
             barBorderRadius: [20, 20, 0, 0],
@@ -87,11 +95,11 @@ const UserSource = (props) => {
87 95
 
88 96
       },
89 97
     ],
90
-    dataset: {
91
-      id: 'bar',
92
-      dimensions: ['fromName', 'userCount', 'registered'],
93
-      source: source,
94
-    },
98
+    // dataset: {
99
+    //   id: 'bar',
100
+    //   dimensions: ['fromName', 'userCount', 'registered'],
101
+    //   source: source,
102
+    // },
95 103
   }
96 104
 
97 105
 

+ 139
- 0
src/pages/indexEcharts/components/UserSourceDetail.jsx ファイルの表示

@@ -0,0 +1,139 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '../../../components/EchartsTest/EChart';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+
10
+import styles from '../styles.less'
11
+
12
+const formatDate = (start, end) => {
13
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
14
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
15
+  return { startDate, endDate }
16
+}
17
+
18
+const UserSourceDetail = (props) => {
19
+  const [xData, setxData] = useState([])
20
+  const [fromData, setFromData] = useState([])
21
+  const [registerData, setRegisterData] = useState([])
22
+  //柱图
23
+  useEffect(() => {
24
+    userResource(formatDate(props.startDate, props.endDate))
25
+  }, [props.startDate, props.endDate])
26
+
27
+  function userResource(params) {
28
+    request({
29
+      ...apis.indexEcharts.selectPersonFromGroupByDay,
30
+      params,
31
+    }).then((data) => {
32
+      setxData(data.map(x =>  x.createTime))
33
+      setFromData(data.map(x => x.fromNum))
34
+      setRegisterData(data.map(x => x.registeredNum))
35
+      props.onSuccess(data)
36
+    })
37
+  }
38
+
39
+  const subtitle = '最近7天';
40
+  const baroptions = {
41
+    title: {
42
+    },
43
+    tooltip: {
44
+        trigger: 'axis'
45
+    },
46
+    legend: {
47
+        data: ['新用户数', '授权注册']
48
+    },
49
+    toolbox: {
50
+        show: true,
51
+        feature: {
52
+            dataZoom: {
53
+                yAxisIndex: 'none'
54
+            },
55
+            dataView: {readOnly: false},
56
+            magicType: {type: ['line', 'bar']},
57
+            restore: {},
58
+            saveAsImage: {}
59
+        }
60
+    },
61
+    xAxis: {
62
+        type: 'category',
63
+        boundaryGap: false,
64
+        data: xData
65
+    },
66
+    yAxis: {
67
+        type: 'value',
68
+        axisLabel: {
69
+            formatter: '{value} °C'
70
+        }
71
+    },
72
+    series: [
73
+        {
74
+            name: '新用户数',
75
+            type: 'line',
76
+            data: fromData,
77
+            markPoint: {
78
+                data: [
79
+                    {type: 'max', name: '最大值'},
80
+                    {type: 'min', name: '最小值'}
81
+                ]
82
+            },
83
+            markLine: {
84
+                data: [
85
+                    {type: 'average', name: '平均值'}
86
+                ]
87
+            }
88
+        },
89
+        {
90
+            name: '授权注册',
91
+            type: 'line',
92
+            data: registerData,
93
+            markPoint: {
94
+                data: [
95
+                    {name: '周最低', value: -2, xAxis: 1, yAxis: -1.5}
96
+                ]
97
+            },
98
+            markLine: {
99
+                data: [
100
+                    {type: 'average', name: '平均值'},
101
+                    [{
102
+                        symbol: 'none',
103
+                        x: '90%',
104
+                        yAxis: 'max'
105
+                    }, {
106
+                        symbol: 'circle',
107
+                        label: {
108
+                            position: 'start',
109
+                            formatter: '最大值'
110
+                        },
111
+                        type: 'max',
112
+                        name: '最高点'
113
+                    }]
114
+                ]
115
+            }
116
+        }
117
+    ]
118
+}
119
+
120
+  const barstyle = {
121
+    width: '100%',
122
+    height: '480px',
123
+    minWidth: '400px'
124
+  }
125
+
126
+  return (
127
+    <>
128
+      <div>
129
+      <p onClick={()=>router.push('/indexEcharts/userSource')}><span style={{borderBottom:'1px solid #f02d40',cursor: 'pointer',color:'#333',fontSize:'0.12rem',fontWeight:'600'}}>用户来源</span> {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}</p>
130
+
131
+        <EChart options={baroptions} style={barstyle} />
132
+
133
+      </div>
134
+
135
+    </>
136
+  )
137
+}
138
+
139
+export default UserSourceDetail;

+ 9
- 14
src/pages/indexEcharts/components/UserSourcepie.jsx ファイルの表示

@@ -45,7 +45,7 @@ const UserSource = (props) => {
45 45
     legend: {
46 46
       orient: 'vertical',
47 47
       x: 'left',
48
-      data: ['来源置业顾问', '来源全民经纪人', '自主进入'],
48
+      data: ['来源置业', '来源客户', '其他'],
49 49
     },
50 50
     tooltip: {
51 51
       // trigger: 'item',
@@ -53,17 +53,12 @@ const UserSource = (props) => {
53 53
     },
54 54
     series: [
55 55
       {
56
+        name: '用户来源',
56 57
         type: 'pie',
57
-        center: ['40%', '65%'],
58
-        radius: ['34%', '52%'],
58
+        center: ['50%', '65%'],
59
+        radius: ['25%', '40%'],
59 60
         label: {
60
-          normal: {
61
-            show: false,
62
-            position: 'center',
63
-            color: '#666666',
64
-            fontSize: 22,
65
-            formatter: '{d}%'
66
-          },
61
+          formatter: '{b} {@value}',
67 62
           emphasis: {
68 63
             show: true,
69 64
             formatter: '{d}%',
@@ -71,7 +66,7 @@ const UserSource = (props) => {
71 66
               fontSize: '22',
72 67
               fontWeight: 'bold'
73 68
             }
74
-          }
69
+          },
75 70
         },
76 71
       },
77 72
 
@@ -80,9 +75,9 @@ const UserSource = (props) => {
80 75
     dataset: {
81 76
       id: 'pie',
82 77
       source: [
83
-        { '用户来源': '来源置业顾问', value: person_realty_consultant, },
84
-        { '用户来源': '来源全民经纪人', value: person_estate_agent },
85
-        { '用户来源': '自主进入', value: person_null },
78
+        { '用户来源': '来源置业', value: person_realty_consultant, },
79
+        { '用户来源': '来源客户', value: person_estate_agent },
80
+        { '用户来源': '其他', value: person_null },
86 81
       ]
87 82
     },
88 83
   }

+ 2
- 2
src/pages/indexEcharts/index.jsx ファイルの表示

@@ -6,7 +6,7 @@ import request from '../../utils/request'
6 6
 import apis from '../../services/apis';
7 7
 import UserSource from './components/UserSource.jsx';
8 8
 import UserSourcepie from './components/UserSourcepie.jsx';
9
-import UserBehavior from './components/UserBehavior.jsx';
9
+import UserBehaviorIndex from './components/UserBehaviorIndex.jsx';
10 10
 import UserActive from './components/UserActive';
11 11
 import UserSex from './components/UserSex';
12 12
 import NewUsers from './components/NewUsers'
@@ -56,7 +56,7 @@ const indexEcharts = props => {
56 56
       }
57 57
       {checkData.includes('user_behavior') &&
58 58
         <div className={styles.behavior}>
59
-          <UserBehavior tableShow={false} endDate={endDate} startDate={startDate} dataZoom={false}></UserBehavior>
59
+          <UserBehaviorIndex tableShow={false} endDate={endDate} startDate={startDate} dataZoom={false}></UserBehaviorIndex>
60 60
         </div>
61 61
       }
62 62
       <div style={{ display: 'flex' }}>

+ 55
- 38
src/pages/indexEcharts/userSource.jsx ファイルの表示

@@ -21,40 +21,44 @@ const { Option } = Select
21 21
 // }
22 22
 
23 23
 let daterange = []
24
-let tableTitle = ['日期']
24
+let tableTitle = ['类型']
25 25
 
26
-const columns = [
26
+let columns = [
27 27
   {
28 28
     title: '日期',
29
-    dataIndex: 'label',
30
-    key: 'label',
31
-    width:'20%'
29
+    dataIndex: 'createTime',
30
+    key: 'createTime',
32 31
   },
33
-  {
34
-    title: '名片分享',
35
-    dataIndex: '名片分享',
36
-    key: '名片分享',
37
-  },
38
-  {
39
-    title: '生成海报',
40
-    dataIndex: '生成海报',
41
-    key: '生成海报',
42
-  },
43
-  {
44
-    title: '小程序搜索',
45
-    dataIndex: '小程序搜索',
46
-    key: '小程序搜索',
47
-  },
48
-  {
49
-    title: '好友分享',
50
-    dataIndex: '好友分享',
51
-    key: '好友分享',
52
-
53
-  },
54
-
55
-
32
+  // {
33
+  //   title: '名片分享',
34
+  //   dataIndex: '名片分享',
35
+  //   key: '名片分享',
36
+  // },
37
+  // {
38
+  //   title: '生成海报',
39
+  //   dataIndex: '生成海报',
40
+  //   key: '生成海报',
41
+  // },
42
+  // {
43
+  //   title: '小程序搜索',
44
+  //   dataIndex: '小程序搜索',
45
+  //   key: '小程序搜索',
46
+  // },
47
+  // {
48
+  //   title: '好友分享',
49
+  //   dataIndex: '好友分享',
50
+  //   key: '好友分享',
51
+  // },
56 52
 ]
57 53
 
54
+// let columns = [
55
+//   {
56
+//     title: '类型',
57
+//     dataIndex: 'value',
58
+//     key: 'value',
59
+//   }
60
+// ]
61
+
58 62
 class Header extends React.Component {
59 63
 
60 64
   constructor(props) {
@@ -72,8 +76,6 @@ class Header extends React.Component {
72 76
     this.setState({ endDate: new Date(), startDate: moment().subtract(7, 'day').toDate() })
73 77
   }
74 78
 
75
-
76
-
77 79
   formatDate = (start, end) => {
78 80
     const tempStartDate = `${moment(start).format('YYYY-MM-DDT00:00:00.000')}Z`
79 81
     const tempEndDate = `${moment(end).format('YYYY-MM-DDT23:59:59.999')}Z`
@@ -111,17 +113,32 @@ class Header extends React.Component {
111 113
 
112 114
   onTabledatas = (e) => {
113 115
     console.log('this.state.userType: ', this.state.userType)
114
-    const data = (e.data || []).reduce((acc, item) => {
115
-      const { date, fromName, count, registered } = item
116
-      const num = this.state.userType === 'registered' ? registered : count
116
+    e.tdWxDicts.map(x => {
117
+        columns = columns.filter(y => y.key != x.sceneType).concat({
118
+          title: x.sceneAlias,
119
+          dataIndex: x.sceneType,
120
+          key: x.sceneType,
121
+        })
122
+    })
123
+    const data = (e.list || []).reduce((acc, item) => {
124
+      const { sceneType, fromNum, registeredNum, createTime } = item
125
+      const num = this.state.userType === 'registered' ? registeredNum : fromNum
126
+      acc[createTime] = { ...acc[createTime], ...item, [`${sceneType}`]: !num ? 0 : num }
127
+      return acc
128
+    }, {})
117 129
 
118
-      tableTitle = tableTitle.indexOf(fromName) > -1 ? tableTitle : tableTitle.concat(fromName) // eslint-disable-line
119
-      acc[date] = { ...acc[date], [`${fromName}`]: !num ? 0 : num }
130
+    const dictData =  e.tdWxDicts.reduce((acc,item,index) => {
131
+      const { sceneType } = item
132
+      acc[sceneType] = 0
133
+      return acc
134
+    },{})
120 135
 
136
+    const tableData = Object.keys(data).map(k => data[k]).reduce((acc,item,index) => {
137
+      acc[index] = { ...dictData, ...item }
121 138
       return acc
122
-    }, {})
139
+    },[])
123 140
 
124
-    this.setState({ tableData: Object.keys(data).map(x => ({ label: x, ...data[x] })) })
141
+    this.setState({ tableData })
125 142
 
126 143
   }
127 144
 
@@ -152,7 +169,7 @@ class Header extends React.Component {
152 169
             Today: [moment(), moment()],
153 170
             'This Month': [moment().startOf('month'), moment().endOf('month')],
154 171
           }}
155
-          showTime
172
+          // showTime
156 173
           // format="YYYY/MM/DD HH:mm:ss"
157 174
           onChange={(_dates, dateStrings) => this.onChangetime(_dates, dateStrings)}
158 175
         />

+ 1
- 1
src/pages/record/drainage/DrainageVisitRecordList.jsx ファイルの表示

@@ -83,7 +83,7 @@ const header = props => {
83 83
       dataIndex: 'personType',
84 84
       key: 'personType',
85 85
       align: 'center',
86
-      render: (text, record) => <span>{record.shareName ? record.consultantId === null || record.consultantId === '' ? '普通客户' : '置业顾问' : ''}</span>,
86
+      render: (text, record) => <span>{record.personType === 'Realty Consultant' ? '置业顾问' : '普通客户' }</span>,
87 87
     },
88 88
   ];
89 89
   

+ 22
- 0
src/services/apis.js ファイルの表示

@@ -320,6 +320,16 @@ export default {
320 320
       url: `${prefix}/selectUserResource`,
321 321
       action: 'userStatistics',
322 322
     },
323
+    selectPersonFrom: {
324
+      method: 'GET',
325
+      url: `${prefix}/selectPersonFrom`,
326
+      action: 'userStatistics',
327
+    },
328
+    selectPersonFromGroupByDay: {
329
+      method: 'GET',
330
+      url: `${prefix}/selectPersonFromGroupByDay`,
331
+      action: 'userStatistics',
332
+    },
323 333
     list:{
324 334
       method:'Get',
325 335
       url: `${prefix}/indexStatistical`,
@@ -336,6 +346,11 @@ export default {
336 346
         url: `${prefix}/selectEventAll`,
337 347
         action: 'behaviorIncident',
338 348
       },
349
+      tsUserBehavior: {
350
+        method: 'GET',
351
+        url: `${prefix}/tsUserBehavior`,
352
+        action: 'tsUserBehavior',
353
+      },
339 354
     },
340 355
     bizEvent: {
341 356
       dict: {
@@ -999,6 +1014,13 @@ export default {
999 1014
     action: 'admin.thirdPartyMiniapp.id.get',
1000 1015
   },
1001 1016
  },
1017
+ wxDict: {
1018
+  list: {
1019
+    url: `${prefix}/tdWxDict`,
1020
+    method: 'GET',
1021
+    action: 'admin.tdWxDict.get',
1022
+  },
1023
+ },
1002 1024
  poster: {
1003 1025
   posterTemplate: {
1004 1026
     url: `${prefix}/posterTemplate`,

+ 5
- 5
src/utils/request.js ファイルの表示

@@ -89,11 +89,11 @@ request.interceptors.response.use(async (response, options) => {
89 89
       const { code, data, message } = await response.clone().json();
90 90
       if (code != 1000) {
91 91
         if (code === 1001) {
92
-          notification.error({
93
-            message: `请登录系统`,
94
-            // description: '请登录系统',
95
-          });
96
-          throw new Error('请登录系统');
92
+          // notification.error({
93
+          //   message: `请登录系统`,
94
+          //   // description: '请登录系统',
95
+          // });
96
+          // throw new Error('请登录系统');
97 97
         } else {
98 98
           notification.error({
99 99
             message: message || '请求错误',