zhoulisen 5 years ago
parent
commit
c90d049617

+ 5
- 0
config/routes.js View File

550
                 name: '活动统计',
550
                 name: '活动统计',
551
                 component: './statistical/activity'
551
                 component: './statistical/activity'
552
               },
552
               },
553
+              {
554
+                path: '/statistical/activity/detail',
555
+                name: '查看详情',
556
+                component: './statistical/activity/detail'
557
+              },
553
               {
558
               {
554
                 path: '/statistical/activity/sharePersonNum',
559
                 path: '/statistical/activity/sharePersonNum',
555
                 name: '分享统计',
560
                 name: '分享统计',

BIN
src/assets/picture.png View File


+ 5
- 5
src/pages/Index.jsx View File

29
         {
29
         {
30
             title: '客户列表',
30
             title: '客户列表',
31
             img: customerImg,
31
             img: customerImg,
32
-            path: '',
32
+            path: '/customer/customerlist/list',
33
             value: '2',
33
             value: '2',
34
         },
34
         },
35
         {
35
         {
36
             title: '数据报表',
36
             title: '数据报表',
37
             img: reportImg,
37
             img: reportImg,
38
-            path: '',
38
+            path: '/statistical/monitor',
39
             value: '3',
39
             value: '3',
40
         },
40
         },
41
 
41
 
42
         {
42
         {
43
             title: '项目统计',
43
             title: '项目统计',
44
             img: projectImg,
44
             img: projectImg,
45
-            path: '',
45
+            path: '/statistical/building',
46
             value: '4',
46
             value: '4',
47
         },
47
         },
48
         {
48
         {
49
             title: '活动统计',
49
             title: '活动统计',
50
             img: statisticsImg,
50
             img: statisticsImg,
51
-            path: '',
51
+            path: '/statistical/activity',
52
             value: '5',
52
             value: '5',
53
         },
53
         },
54
         {
54
         {
55
             title: '置业顾问KPI',
55
             title: '置业顾问KPI',
56
             img: consultantImg,
56
             img: consultantImg,
57
-            path: '',
57
+            path: '/statistical/consultant',
58
             value: '6',
58
             value: '6',
59
         },
59
         },
60
 
60
 

+ 1
- 0
src/pages/carouselFigure/advertisingList.jsx View File

210
    //重置搜索
210
    //重置搜索
211
    function handleReset() {
211
    function handleReset() {
212
     props.form.resetFields();
212
     props.form.resetFields();
213
+    getList({ pageNum: 1, pageSize: 10, showType: 'screen' });
213
   }
214
   }
214
 
215
 
215
 
216
 

+ 1
- 0
src/pages/carouselFigure/carouselFigureList.jsx View File

208
    //重置搜索
208
    //重置搜索
209
    function handleReset() {
209
    function handleReset() {
210
     props.form.resetFields();
210
     props.form.resetFields();
211
+    getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
211
   }
212
   }
212
 
213
 
213
   const { getFieldDecorator } = props.form
214
   const { getFieldDecorator } = props.form

+ 1
- 0
src/pages/carouselFigure/propagandaList.jsx View File

210
    //重置搜索
210
    //重置搜索
211
    function handleReset() {
211
    function handleReset() {
212
     props.form.resetFields();
212
     props.form.resetFields();
213
+    getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' });
213
   }
214
   }
214
 
215
 
215
 
216
 

+ 1
- 1
src/pages/charts/CityNums.jsx View File

40
   },
40
   },
41
 }
41
 }
42
 
42
 
43
-const getCityData = fetch(apis.indexEcharts.userCity)
43
+const getCityData = fetch(apis.indexEcharts.personCity)
44
 
44
 
45
 const mapDataRange = x => {
45
 const mapDataRange = x => {
46
   // 映射区间 [1, 100000] => [rangeStart, rangeEnd]
46
   // 映射区间 [1, 100000] => [rangeStart, rangeEnd]

+ 1
- 1
src/pages/news/list/NewsList.jsx View File

270
   function handleReset() {
270
   function handleReset() {
271
     props.form.resetFields();
271
     props.form.resetFields();
272
     localStorage.setItem("newsPageParams",JSON.stringify({ pageNum: 1, pageSize: 6 }));
272
     localStorage.setItem("newsPageParams",JSON.stringify({ pageNum: 1, pageSize: 6 }));
273
-    // getList({ pageNum: 1, pageSize: 6 })
273
+    getList({ pageNum: 1, pageSize: 6 })
274
   }
274
   }
275
 
275
 
276
   function getDate(value, dateString) {
276
   function getDate(value, dateString) {

+ 5
- 3
src/pages/statistical/activity/addRegistNum.jsx View File

97
       dataSoures: [],
97
       dataSoures: [],
98
       tableData: [],
98
       tableData: [],
99
       userType: 'all',
99
       userType: 'all',
100
-      buildingId: [],
101
-      targetType: []
100
+      activityName:  props.location.query.activityName
102
     }
101
     }
103
   }
102
   }
104
 
103
 
169
 
168
 
170
     return (
169
     return (
171
     <>
170
     <>
171
+        <div>
172
+          <span style={{marginLeft:'20px'}}>分享内容:{this.state.activityName}</span>
173
+        </div>
172
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
174
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
173
         <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
175
         <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
174
           {getFieldDecorator('personFrom')(
176
           {getFieldDecorator('personFrom')(
183
           </Form.Item>
185
           </Form.Item>
184
           </Form>     
186
           </Form>     
185
         <div>
187
         <div>
186
-        <AuthButton name="admin.customer.import" noRight={null}>
188
+        <AuthButton name="admin.statistical.activity.export" noRight={null}>
187
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
189
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
188
                 导出
190
                 导出
189
             </Button>
191
             </Button>

+ 89
- 68
src/pages/statistical/activity/compenents/Content.jsx View File

15
 const { Option } = Select
15
 const { Option } = Select
16
 
16
 
17
 const formItemLayout = {
17
 const formItemLayout = {
18
-    labelCol: { span: 10},
19
-    wrapperCol: { span: 14 },
20
-  };
21
-  
18
+  labelCol: { span: 10 },
19
+  wrapperCol: { span: 14 },
20
+};
21
+
22
 let daterange = []
22
 let daterange = []
23
 let tableTitle = ['类型']
23
 let tableTitle = ['类型']
24
 let dateType = ''
24
 let dateType = ''
27
   const startDate = moment().subtract(dateType, 'day').toDate()
27
   const startDate = moment().subtract(dateType, 'day').toDate()
28
   const endDate = new Date()
28
   const endDate = new Date()
29
 
29
 
30
-  if(rowData) {
30
+  if (rowData) {
31
     router.push({
31
     router.push({
32
     pathname: '/statistical/activity/sharePersonNum',
32
     pathname: '/statistical/activity/sharePersonNum',
33
     query: {
33
     query: {
35
       endDate: endDate,
35
       endDate: endDate,
36
       activityId: rowData.activityId,
36
       activityId: rowData.activityId,
37
       activityType: rowData.activityType,
37
       activityType: rowData.activityType,
38
+      activityName: rowData.activityName
38
     },
39
     },
39
   });
40
   });
40
     return
41
     return
44
 const toShareNum = rowData => () => {
45
 const toShareNum = rowData => () => {
45
   const startDate = moment().subtract(dateType, 'day').toDate()
46
   const startDate = moment().subtract(dateType, 'day').toDate()
46
   const endDate = new Date()
47
   const endDate = new Date()
47
-  if(rowData) {
48
+  if (rowData) {
48
     router.push({
49
     router.push({
49
     pathname: '/statistical/activity/shareNum',
50
     pathname: '/statistical/activity/shareNum',
50
     query: {
51
     query: {
52
       endDate: endDate,
53
       endDate: endDate,
53
       activityId: rowData.activityId,
54
       activityId: rowData.activityId,
54
       activityType: rowData.activityType,
55
       activityType: rowData.activityType,
56
+      activityName: rowData.activityName
55
     },
57
     },
56
   });
58
   });
57
     return
59
     return
58
   }
60
   }
59
-} 
61
+}
60
 
62
 
61
 const toAddRegistNum = rowData => () => {
63
 const toAddRegistNum = rowData => () => {
62
   const startDate = moment().subtract(dateType, 'day').toDate()
64
   const startDate = moment().subtract(dateType, 'day').toDate()
63
   const endDate = new Date()
65
   const endDate = new Date()
64
   console.log(rowData, 'rowData')
66
   console.log(rowData, 'rowData')
65
-  if(rowData) {
67
+  if (rowData) {
66
     router.push({
68
     router.push({
67
     pathname: '/statistical/activity/addRegistNum',
69
     pathname: '/statistical/activity/addRegistNum',
68
     query: {
70
     query: {
70
       endDate: endDate,
72
       endDate: endDate,
71
       activityId: rowData.activityId,
73
       activityId: rowData.activityId,
72
       activityType: rowData.activityType,
74
       activityType: rowData.activityType,
75
+      activityName: rowData.activityName
73
     },
76
     },
74
   });
77
   });
75
     return
78
     return
76
   }
79
   }
77
-} 
80
+}
78
 
81
 
79
 const toAddVisitNum = rowData => () => {
82
 const toAddVisitNum = rowData => () => {
80
   const startDate = moment().subtract(dateType, 'day').toDate()
83
   const startDate = moment().subtract(dateType, 'day').toDate()
81
   const endDate = new Date()
84
   const endDate = new Date()
82
   console.log(rowData, 'rowData')
85
   console.log(rowData, 'rowData')
83
-  if(rowData) {
86
+  if (rowData) {
84
     router.push({
87
     router.push({
85
     pathname: '/statistical/activity/visitNum',
88
     pathname: '/statistical/activity/visitNum',
86
     query: {
89
     query: {
88
       endDate: endDate,
91
       endDate: endDate,
89
       activityId: rowData.activityId,
92
       activityId: rowData.activityId,
90
       activityType: rowData.activityType,
93
       activityType: rowData.activityType,
94
+      activityName: rowData.activityName
91
     },
95
     },
92
   });
96
   });
93
     return
97
     return
94
   }
98
   }
95
-} 
99
+}
96
 
100
 
97
 const toAddVisitPersonNum = rowData => () => {
101
 const toAddVisitPersonNum = rowData => () => {
98
   const startDate = moment().subtract(dateType, 'day').toDate()
102
   const startDate = moment().subtract(dateType, 'day').toDate()
99
   const endDate = new Date()
103
   const endDate = new Date()
100
-  if(rowData) {
104
+  if (rowData) {
101
     router.push({
105
     router.push({
102
     pathname: '/statistical/activity/visitPersonNum',
106
     pathname: '/statistical/activity/visitPersonNum',
103
     query: {
107
     query: {
105
       endDate: endDate,
109
       endDate: endDate,
106
       activityId: rowData.activityId,
110
       activityId: rowData.activityId,
107
       activityType: rowData.activityType,
111
       activityType: rowData.activityType,
112
+      activityName: rowData.activityName
108
     },
113
     },
109
   });
114
   });
110
     return
115
     return
111
   }
116
   }
112
 }
117
 }
113
 
118
 
119
+const toDetail = rowData => {
120
+  const startDate = moment().subtract(dateType, 'day').format('YYYY-MM-DD')
121
+  const endDate = moment().format('YYYY-MM-DD')
122
+  // const { formData } = this.state
123
+  if (rowData) {
124
+    router.push({
125
+      pathname: '/statistical/activity/detail',
126
+      query: {
127
+        startDate: startDate,
128
+        endDate: endDate,
129
+        targetId: rowData.activityId,
130
+        targetType: rowData.activityType,
131
+        targetName: rowData.activityName,
132
+        buildingId: '',
133
+      },
134
+    });
135
+  
136
+    return
137
+  }
138
+}
139
+
114
 let columns = [
140
 let columns = [
115
   {
141
   {
116
     title: '活动类型',
142
     title: '活动类型',
178
     title: '详情',
204
     title: '详情',
179
     align: 'center',
205
     align: 'center',
180
     render: (text, record) => (
206
     render: (text, record) => (
181
-        <a style={{ color: '#66B3FF' }}>查看</a>
207
+      <a style={{ color: '#66B3FF' }} onClick={() => toDetail(record)}>查看</a>
182
     ),
208
     ),
183
   },
209
   },
184
 ]
210
 ]
205
     this.state = {
231
     this.state = {
206
       radioVal: defaultDays,
232
       radioVal: defaultDays,
207
       formData: {
233
       formData: {
208
-        
234
+
209
         startDate: moment().subtract(7, 'day').toDate(),
235
         startDate: moment().subtract(7, 'day').toDate(),
210
         endDate: new Date,
236
         endDate: new Date,
211
         buildingId: '',
237
         buildingId: '',
212
         targetType: '',
238
         targetType: '',
213
-        pageNum:'',
214
-        pageSize:'',
215
-        activityName:'',
216
-        sort:null,
217
-        colKey:null
239
+        pageNum: '',
240
+        pageSize: '',
241
+        activityName: '',
242
+        sort: null,
243
+        colKey: null
218
       },
244
       },
219
-      personData: [],  
245
+      personData: [],
220
       dataSoures: [],
246
       dataSoures: [],
221
       tableData: [],
247
       tableData: [],
222
       barData: {},
248
       barData: {},
232
     this.getTableList()
258
     this.getTableList()
233
   }
259
   }
234
 
260
 
235
-  getTableList () {
261
+  getTableList() {
236
     const { formData } = this.state
262
     const { formData } = this.state
237
     request({ ...apis.activityDataStatis.activityDetailTableData, params: formData }).then(data => {
263
     request({ ...apis.activityDataStatis.activityDetailTableData, params: formData }).then(data => {
238
       console.log(data)
264
       console.log(data)
239
-      this.setState({ tableData: data.records, total: data.total})
265
+      this.setState({ tableData: data.records, total: data.total })
240
     }).catch()
266
     }).catch()
241
   }
267
   }
242
 
268
 
252
     const buildingId = this.props.form.getFieldValue("buildingId");
278
     const buildingId = this.props.form.getFieldValue("buildingId");
253
     const targetType = this.props.form.getFieldValue("targetType");
279
     const targetType = this.props.form.getFieldValue("targetType");
254
     const activityName = this.props.form.getFieldValue("activityName");
280
     const activityName = this.props.form.getFieldValue("activityName");
255
-    if (this.props.form.getFieldValue("startDate") != undefined){
281
+    if (this.props.form.getFieldValue("startDate") != undefined) {
256
       startDate = this.props.form.getFieldValue("startDate").toDate()
282
       startDate = this.props.form.getFieldValue("startDate").toDate()
257
     }
283
     }
258
-    if (this.props.form.getFieldValue("endDate") != undefined){
284
+    if (this.props.form.getFieldValue("endDate") != undefined) {
259
       endDate = this.props.form.getFieldValue("endDate").toDate()
285
       endDate = this.props.form.getFieldValue("endDate").toDate()
260
     }
286
     }
261
     const { formData } = this.state
287
     const { formData } = this.state
284
         return
310
         return
285
       }
311
       }
286
       const url = window.URL.createObjectURL(new Blob([data]))
312
       const url = window.URL.createObjectURL(new Blob([data]))
287
-        const link = document.createElement('a')
288
-        link.style.display = 'none'
289
-        link.href = url
290
-        link.setAttribute('download', '活动统计.xlsx')
291
-        document.body.append(link)
292
-        link.click()
313
+      const link = document.createElement('a')
314
+      link.style.display = 'none'
315
+      link.href = url
316
+      link.setAttribute('download', '活动统计.xlsx')
317
+      document.body.append(link)
318
+      link.click()
293
     }).catch()
319
     }).catch()
294
   }
320
   }
295
 
321
 
299
   }
325
   }
300
 
326
 
301
   datalist = () => {
327
   datalist = () => {
302
-    this.setState({ 
328
+    this.setState({
303
       endDate: daterange[1] === '' ? new Date() : daterange[1],
329
       endDate: daterange[1] === '' ? new Date() : daterange[1],
304
       startDate: daterange[0] === '' ? moment().subtract(7, 'day').toDate() : daterange[0],
330
       startDate: daterange[0] === '' ? moment().subtract(7, 'day').toDate() : daterange[0],
305
     })
331
     })
342
   render() {
368
   render() {
343
     const { radioVal } = this.state
369
     const { radioVal } = this.state
344
     const { getFieldDecorator } = this.props.form;
370
     const { getFieldDecorator } = this.props.form;
345
-    console.log(this.state.formData,'this.state.formData')
371
+    console.log(this.state.formData, 'this.state.formData')
346
     const startDate = this.state.formData.startDate
372
     const startDate = this.state.formData.startDate
347
     const endDate = this.state.formData.endDate
373
     const endDate = this.state.formData.endDate
348
 
374
 
349
     return (
375
     return (
350
     <>
376
     <>
351
-      <div style={{
352
-        backgroundColor: '#fff',
353
-        padding: '32PX 28px',
354
-        boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)',
355
-        borderRadius: '12px',
356
-        minHeight: '60vh'
357
-      }}>
377
+      <div >
358
         <Radio.Group buttonStyle="solid" value={radioVal} onChange={this.handleRadioChange}>
378
         <Radio.Group buttonStyle="solid" value={radioVal} onChange={this.handleRadioChange}>
359
           <Radio.Button value={0}>今日</Radio.Button>
379
           <Radio.Button value={0}>今日</Radio.Button>
360
           <Radio.Button value={7}>最近7天</Radio.Button>
380
           <Radio.Button value={7}>最近7天</Radio.Button>
368
                 <DatePicker placeholder="开始日期"/>,
388
                 <DatePicker placeholder="开始日期"/>,
369
             )}
389
             )}
370
             </Form.Item>
390
             </Form.Item>
371
-            <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
372
-            {getFieldDecorator('endDate', {initialValue: moment(endDate)
373
-              
374
-            })(
375
-                <DatePicker placeholder="结束日期"/>,
376
-            )}
391
+            <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
392
+              {getFieldDecorator('endDate', {
393
+                initialValue: moment(endDate)
394
+
395
+              })(
396
+                <DatePicker placeholder="结束日期" />,
397
+              )}
377
             </Form.Item>
398
             </Form.Item>
378
-          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
399
+            <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
379
               {getFieldDecorator('buildingId')(<BuildingSelect />)}
400
               {getFieldDecorator('buildingId')(<BuildingSelect />)}
380
-          </Form.Item>
381
-          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
382
-            {getFieldDecorator('targetType')(
383
-                <Select placeholder="活动类型" style={{ width: 150, marginLeft:'20px'  }}>
384
-                <Option value="activity">报名活动</Option>
385
-                <Option value="help">助力活动</Option>
386
-                <Option value="group">拼团活动</Option>
387
-                <Option value="h5">H5活动</Option>
388
-                <Option value="live">直播</Option>
389
-            </Select>
390
-            )}
391
-          </Form.Item>
392
-          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
393
-              {getFieldDecorator('activityName')(<Input placeholder="请输入活动名称"/>)}
394
-          </Form.Item>
395
-          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
396
-            <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}>
401
+            </Form.Item>
402
+            <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
403
+              {getFieldDecorator('targetType')(
404
+                <Select placeholder="活动类型" style={{ width: 150, marginLeft: '20px' }}>
405
+                  <Option value="activity">报名活动</Option>
406
+                  <Option value="help">助力活动</Option>
407
+                  <Option value="group">拼团活动</Option>
408
+                  <Option value="h5">H5活动</Option>
409
+                  <Option value="live">直播</Option>
410
+                </Select>
411
+              )}
412
+            </Form.Item>
413
+            <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
414
+              {getFieldDecorator('activityName')(<Input placeholder="请输入活动名称" />)}
415
+            </Form.Item>
416
+            <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
417
+              <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}>
397
                 查询
418
                 查询
398
             </Button>
419
             </Button>
399
             <Button onClick={e => this.handleReset()} style={{ marginLeft: '30px' }}>重置</Button>
420
             <Button onClick={e => this.handleReset()} style={{ marginLeft: '30px' }}>重置</Button>
400
           </Form.Item>
421
           </Form.Item>
401
           </Form>     
422
           </Form>     
402
         <div>
423
         <div>
403
-            <AuthButton name="admin.customer.import" noRight={null}>
424
+            <AuthButton name="admin.statistical.activity.export" noRight={null}>
404
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
425
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
405
                 导出
426
                 导出
406
             </Button>
427
             </Button>
407
             </AuthButton>
428
             </AuthButton>
408
-          <Table style={{marginTop:'20px'}} dataSource={this.state.tableData} columns={columns} pagination={{ total: this.state.total}} onChange={this.handleTableChange} scroll={{ y: 500 }}></Table>
429
+            <Table style={{ marginTop: '20px' }} dataSource={this.state.tableData} columns={columns} pagination={{ total: this.state.total }} onChange={this.handleTableChange} scroll={{ y: 500 }}></Table>
430
+          </div>
409
         </div>
431
         </div>
410
-      </div>
411
-    </>
432
+      </>
412
     )
433
     )
413
-    
434
+
414
   }
435
   }
415
 }
436
 }
416
 const WrappedTypeForm = Form.create()(OverView);
437
 const WrappedTypeForm = Form.create()(OverView);

+ 29
- 23
src/pages/statistical/activity/compenents/OverView.jsx View File

22
 let daterange = []
22
 let daterange = []
23
 let tableTitle = ['类型']
23
 let tableTitle = ['类型']
24
 
24
 
25
+let buildingId = ''
26
+let activityType = ''
27
+
25
 const toSharePersonNum = rowData => () => {
28
 const toSharePersonNum = rowData => () => {
26
   console.log(rowData, 'rowData')
29
   console.log(rowData, 'rowData')
27
   if(rowData) {
30
   if(rowData) {
29
     pathname: '/statistical/activity/sharePersonNum',
32
     pathname: '/statistical/activity/sharePersonNum',
30
     query: {
33
     query: {
31
       queryDate: rowData.date,
34
       queryDate: rowData.date,
35
+      buildingId: buildingId, 
36
+      acticvityType: activityType
32
     },
37
     },
33
   });
38
   });
34
     return
39
     return
42
     pathname: '/statistical/activity/shareNum',
47
     pathname: '/statistical/activity/shareNum',
43
     query: {
48
     query: {
44
       queryDate: rowData.date,
49
       queryDate: rowData.date,
50
+      buildingId: buildingId, 
51
+      acticvityType: activityType
45
     },
52
     },
46
   });
53
   });
47
     return
54
     return
55
     pathname: '/statistical/activity/addRegistNum',
62
     pathname: '/statistical/activity/addRegistNum',
56
     query: {
63
     query: {
57
       queryDate: rowData.date,
64
       queryDate: rowData.date,
65
+      buildingId: buildingId, 
66
+      acticvityType: activityType
58
     },
67
     },
59
   });
68
   });
60
     return
69
     return
68
     pathname: '/statistical/activity/visitNum',
77
     pathname: '/statistical/activity/visitNum',
69
     query: {
78
     query: {
70
       queryDate: rowData.date,
79
       queryDate: rowData.date,
80
+      buildingId: buildingId, 
81
+      acticvityType: activityType
71
     },
82
     },
72
   });
83
   });
73
     return
84
     return
81
     pathname: '/statistical/activity/visitPersonNum',
92
     pathname: '/statistical/activity/visitPersonNum',
82
     query: {
93
     query: {
83
       queryDate: rowData.date,
94
       queryDate: rowData.date,
95
+      buildingId: buildingId, 
96
+      acticvityType: activityType
84
     },
97
     },
85
   });
98
   });
86
     return
99
     return
221
   handleSubmit = (e, props) => {
234
   handleSubmit = (e, props) => {
222
     let startDate = null
235
     let startDate = null
223
     let endDate = null
236
     let endDate = null
224
-    const buildingId = this.props.form.getFieldValue("buildingId");
237
+    buildingId = this.props.form.getFieldValue("buildingId");
238
+    activityType = this.props.form.getFieldValue("targetType");
239
+
240
+    const buildingIdSearch = this.props.form.getFieldValue("buildingId");
225
     const targetType = this.props.form.getFieldValue("targetType");
241
     const targetType = this.props.form.getFieldValue("targetType");
226
     if (this.props.form.getFieldValue("startDate") != undefined){
242
     if (this.props.form.getFieldValue("startDate") != undefined){
227
       startDate = this.props.form.getFieldValue("startDate").toDate()
243
       startDate = this.props.form.getFieldValue("startDate").toDate()
235
         ...formData,
251
         ...formData,
236
         startDate: startDate,
252
         startDate: startDate,
237
         endDate: endDate,
253
         endDate: endDate,
238
-        buildingId: buildingId,
254
+        buildingId: buildingIdSearch,
239
         targetType: targetType
255
         targetType: targetType
240
       }
256
       }
241
     }, this.getAllList)
257
     }, this.getAllList)
321
 
337
 
322
     return (
338
     return (
323
     <>
339
     <>
324
-      <div style={{
325
-        backgroundColor: '#fff',
326
-        padding: '32PX 28px',
327
-        boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)',
328
-        borderRadius: '12px',
329
-        minHeight: '60vh'
330
-      }}>
340
+      <div >
331
         <Radio.Group buttonStyle="solid" value={radioVal} onChange={this.handleRadioChange}>
341
         <Radio.Group buttonStyle="solid" value={radioVal} onChange={this.handleRadioChange}>
332
           <Radio.Button value={0}>今日</Radio.Button>
342
           <Radio.Button value={0}>今日</Radio.Button>
333
           <Radio.Button value={7}>最近7天</Radio.Button>
343
           <Radio.Button value={7}>最近7天</Radio.Button>
364
           </Form.Item>
374
           </Form.Item>
365
           <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
375
           <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
366
             <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}>
376
             <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}>
367
-                查询
377
+                搜索
368
             </Button>
378
             </Button>
369
             <Button onClick={e => this.handleReset()} style={{ marginLeft: '30px' }}>重置</Button>
379
             <Button onClick={e => this.handleReset()} style={{ marginLeft: '30px' }}>重置</Button>
370
           </Form.Item>
380
           </Form.Item>
373
 
383
 
374
             <div style={{ display: 'flex', marginBottom: '33px' }}>
384
             <div style={{ display: 'flex', marginBottom: '33px' }}>
375
             <div style={{
385
             <div style={{
376
-                textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)', height: '100px',
377
-                boxShadow: '0px  0.106rem 14px -15px rgba(255,126,74,1)',
386
+                textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(241,43,62,1) 0%,rgba(254,144,155,1) 100%)', height: '100px',
378
                 borderRadius: '12px', width: '32%', marginRight: '2%'
387
                 borderRadius: '12px', width: '32%', marginRight: '2%'
379
             }}>
388
             }}>
380
                 <span style={{ fontSize: '24px', color: '#fff' }}>分享总次数 </span>
389
                 <span style={{ fontSize: '24px', color: '#fff' }}>分享总次数 </span>
381
-                <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{ this.state.personData.sharePersonNum || '0'}</span>
390
+                <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{ this.state.personData.shareNum || '0'}</span>
382
             </div>
391
             </div>
383
             <div style={{
392
             <div style={{
384
-                textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)', height: '100px',
385
-                boxShadow: '0px  0.106rem 14px -15px rgba(255,126,74,1)',
393
+                textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: '#FFC6AA', height: '100px',
386
                 borderRadius: '12px', width: '32%', marginRight: '2%'
394
                 borderRadius: '12px', width: '32%', marginRight: '2%'
387
             }}>
395
             }}>
388
                 <span style={{ fontSize: '24px', color: '#fff' }}>分享总人数 </span>
396
                 <span style={{ fontSize: '24px', color: '#fff' }}>分享总人数 </span>
389
-                <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{ this.state.personData.shareNum || '0'}</span>
397
+                <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{ this.state.personData.sharePersonNum || '0'}</span>
390
             </div>
398
             </div>
391
             <div style={{
399
             <div style={{
392
-                textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)', height: '100px',
393
-                boxShadow: '0px  0.106rem 14px -15px rgba(255,126,74,1)',
400
+                textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
394
                 borderRadius: '12px', width: '32%', marginRight: '2%'
401
                 borderRadius: '12px', width: '32%', marginRight: '2%'
395
             }}>
402
             }}>
396
                 <span style={{ fontSize: '24px', color: '#fff' }}>访问总次数 </span>
403
                 <span style={{ fontSize: '24px', color: '#fff' }}>访问总次数 </span>
397
-                <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{ this.state.personData.visitPersonNum || '0'}</span>
404
+                <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{ this.state.personData.visitNum || '0'}</span>
398
             </div>
405
             </div>
399
             <div style={{
406
             <div style={{
400
-                textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)', height: '100px',
401
-                boxShadow: '0px  0.106rem 14px -15px rgba(255,126,74,1)',
407
+                textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(137deg,rgba(150,83,215,1) 0%,rgba(208,160,255,1) 100%)', height: '100px',
402
                 borderRadius: '12px', width: '32%', marginRight: '2%'
408
                 borderRadius: '12px', width: '32%', marginRight: '2%'
403
             }}>
409
             }}>
404
                 <span style={{ fontSize: '24px', color: '#fff' }}>访问总人数 </span>
410
                 <span style={{ fontSize: '24px', color: '#fff' }}>访问总人数 </span>
405
-                <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{ this.state.personData.visitNum || '0'}</span>
411
+                <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{ this.state.personData.visitPersonNum || '0'}</span>
406
             </div>
412
             </div>
407
             </div>
413
             </div>
408
           
414
           
411
                     <NewUsers startDate={this.state.formData.startDate} endDate={this.state.formData.endDate} buildingId={this.state.buildingId} targetType={this.state.targetType} dataZoom={false}></NewUsers>
417
                     <NewUsers startDate={this.state.formData.startDate} endDate={this.state.formData.endDate} buildingId={this.state.buildingId} targetType={this.state.targetType} dataZoom={false}></NewUsers>
412
                 </div>
418
                 </div>
413
             </div >
419
             </div >
414
-            <AuthButton name="admin.customer.import" noRight={null}>
420
+            <AuthButton name="admin.statistical.activity.export" noRight={null}>
415
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
421
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
416
                 导出
422
                 导出
417
             </Button>
423
             </Button>

+ 1
- 1
src/pages/statistical/activity/compenents/style.less View File

1
 .bar {
1
 .bar {
2
-    width: 70%;
2
+    width: 100%;
3
     min-width: 400px;
3
     min-width: 400px;
4
     min-height: 560px;
4
     min-height: 560px;
5
     background: rgba(255, 255, 255, 1);
5
     background: rgba(255, 255, 255, 1);

+ 377
- 0
src/pages/statistical/activity/detail.jsx View File

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Button, DatePicker, Table, Pagination, Radio, Typography } from 'antd';
3
+import sortBy from 'lodash/sortBy';
4
+import router from 'umi/router';
5
+import moment from 'moment';
6
+import apis from '../../../services/apis';
7
+import request from '../../../utils/request'
8
+import AuthButton from '../../../components/AuthButton';
9
+import echarts from 'echarts/lib/echarts';
10
+import EChart from '../../../components/EchartsTest/EChart';
11
+
12
+/**
13
+  @param {*} props
14
+  @returns
15
+ */
16
+const { RangePicker } = DatePicker;
17
+const { Text } = Typography;
18
+
19
+function record(props) {
20
+    const [radioVal, updateRadioVal] = useState(7)
21
+    const [formData, updateFormData] = useState({
22
+        pageNum: 1,
23
+        pageSize: 10,
24
+        ...props.location.query,
25
+    })
26
+
27
+    // 获取初始化数据
28
+    const [data, setData] = useState([])
29
+    const [chartsData, setChartsData] = useState([])
30
+    const [loading, updataLoading] = useState(true)
31
+    const [btnloading, updataBtnloading] = useState(false)
32
+
33
+    useEffect(() => {
34
+        getList(formData);
35
+    }, [])
36
+
37
+    // 查询列表
38
+    const getList = (params) => {
39
+        request({ ...apis.stats.activityDetail, params: { ...params }, }).then((data) => {
40
+            setData(data)
41
+            setChartsData(data)
42
+            updataLoading(false)
43
+        }).catch(err => {
44
+            updataLoading(false)
45
+        })
46
+    }
47
+
48
+    //重置搜索
49
+    function handleReset() {
50
+        props.form.resetFields();
51
+    }
52
+
53
+    // 提交事件
54
+    const handleSubmit = (e) => {
55
+        e.preventDefault();
56
+        getList(formData);
57
+    }
58
+    // 更新页码
59
+    const changePageNum = (pageNumber) => {
60
+        props.form.validateFields((err, values) => {
61
+            if (!err) {
62
+                getList({ ...formData, pageNum: pageNumber });
63
+            }
64
+        });
65
+    }
66
+    // 切换日期 与picker联动
67
+    function setFormData(e) {
68
+        updateRadioVal(e.target.value)
69
+        updateFormData({
70
+            ...formData,
71
+            startDate: moment().subtract(e.target.value, 'day').format('YYYY-MM-DD'),
72
+            endDate: moment().format('YYYY-MM-DD'),
73
+        })
74
+        getList({
75
+            ...formData, startDate: moment().subtract(e.target.value, 'day').format('YYYY-MM-DD'),
76
+            endDate: moment().format('YYYY-MM-DD'),
77
+        });
78
+
79
+    }
80
+    // 选择日期
81
+    const handleDateChange = (val) => {
82
+        updateFormData({
83
+            ...formData,
84
+            startDate: val[0].format('YYYY-MM-DD'),
85
+            endDate: val[1].format('YYYY-MM-DD'),
86
+        })
87
+    }
88
+    const clickCon = (val, record, type) => {
89
+        if (val == 0) {
90
+            return <><span>{val}</span></>
91
+        }
92
+        return <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => toDetail(record, type)} >{val}</span></>
93
+    }
94
+
95
+    //排序
96
+    const handleChange = (pagination, filters, sorter) => {
97
+        const keyValue = sorter.columnKey
98
+
99
+        if (sorter.order == 'ascend') {
100
+            setData(sortBy(data, function (item) {
101
+                return item[keyValue];
102
+            }))
103
+
104
+        } else if (sorter.order == 'descend') {
105
+
106
+            setData(sortBy(data, function (item) {
107
+                return -item[keyValue];
108
+            }))
109
+
110
+        } else {
111
+            setData(sortBy(data, function (item) {
112
+                return item.statisDate;
113
+            }))
114
+        }
115
+    };
116
+
117
+    const toSharePersons = rowData => () => {
118
+        console.log(rowData, 'rowData')
119
+        if (rowData) {
120
+            router.push({
121
+                pathname: '/statistical/activity/sharePersonNum',
122
+                query: {
123
+                    queryDate: rowData.statisDate,
124
+                },
125
+            });
126
+            return
127
+        }
128
+    }
129
+
130
+    const toShareNum = rowData => () => {
131
+        console.log(rowData, 'rowData')
132
+        if (rowData) {
133
+            router.push({
134
+                pathname: '/statistical/activity/shareNum',
135
+                query: {
136
+                    queryDate: rowData.statisDate,
137
+                },
138
+            });
139
+            return
140
+        }
141
+    }
142
+
143
+    const toAddVisitNum = rowData => () => {
144
+        console.log(rowData, 'statisDate')
145
+        if (rowData) {
146
+            router.push({
147
+                pathname: '/statistical/activity/visitNum',
148
+                query: {
149
+                    queryDate: rowData.date,
150
+                },
151
+            });
152
+            return
153
+        }
154
+    }
155
+
156
+    const toAddVisitPersonNum = rowData => () => {
157
+        console.log(rowData, 'rowData')
158
+        if (rowData) {
159
+            router.push({
160
+                pathname: '/statistical/activity/visitPersonNum',
161
+                query: {
162
+                    queryDate: rowData.statisDate,
163
+                },
164
+            });
165
+            return
166
+        }
167
+    }
168
+
169
+    const toAddRegistNum = rowData => () => {
170
+        console.log(rowData, 'rowData')
171
+        if (rowData) {
172
+            router.push({
173
+                pathname: '/statistical/activity/addRegistNum',
174
+                query: {
175
+                    queryDate: rowData.statisDate,
176
+                },
177
+            });
178
+            return
179
+        }
180
+    }
181
+
182
+    // 表格数据
183
+    const columns = [
184
+        {
185
+            title: '日期',
186
+            dataIndex: 'statisDate',
187
+            key: 'statisDate',
188
+            align: 'center',
189
+        },
190
+        {
191
+            title: '分享人数',
192
+            dataIndex: 'sharePersons',
193
+            key: 'sharePersons',
194
+            sorter: true,
195
+            render: (text, record) => (
196
+                <a style={{ color: '#66B3FF' }} onClick={toSharePersons(record)}><span>{record.sharePersons}</span></a>
197
+            ),
198
+        },
199
+        {
200
+            title: '分享次数',
201
+            dataIndex: 'shareNum',
202
+            key: 'shareNum',
203
+            sorter: true,
204
+            render: (text, record) => (
205
+                <a style={{ color: '#66B3FF' }} onClick={toShareNum(record)}><span>{record.shareNum}</span></a>
206
+            ),
207
+        },
208
+        {
209
+            title: '访问人数',
210
+            dataIndex: 'visitPersons',
211
+            key: 'visitPersons',
212
+            sorter: true,
213
+            render: (text, record) => (
214
+                <a style={{ color: '#66B3FF' }} onClick={toAddVisitPersonNum(record)}><span>{record.visitPersons}</span></a>
215
+            ),
216
+        },
217
+        {
218
+            title: '访问次数',
219
+            dataIndex: 'visitNum',
220
+            key: 'visitNum',
221
+            sorter: true,
222
+            render: (text, record) => (
223
+                <a style={{ color: '#66B3FF' }} onClick={toAddVisitNum(record)}><span>{record.visitNum}</span></a>
224
+            ),
225
+        },
226
+        {
227
+            title: '新增注册用户',
228
+            dataIndex: 'newCustomers',
229
+            key: 'newCustomers',
230
+            sorter: true,
231
+            render: (text, record) => (
232
+                <a style={{ color: '#66B3FF' }} onClick={toAddRegistNum(record)}><span>{record.newCustomers}</span></a>
233
+            ),
234
+        },
235
+    ];
236
+    // 下载文档
237
+    function download(data) {
238
+        if (!data) {
239
+            return
240
+        }
241
+        const url = window.URL.createObjectURL(new Blob([data]))
242
+        const link = document.createElement('a')
243
+        link.style.display = 'none'
244
+        link.href = url
245
+        link.setAttribute('download', `${props.location.query.targetName}.xlsx`)
246
+        document.body.append(link)
247
+        link.click()
248
+    }
249
+    // 导出
250
+    function exportRecord() {
251
+        updataBtnloading(true)
252
+        request({ ...apis.stats.exportActivityDetail, responseType: 'blob', params: { ...props.location.query, startDate: formData.startDate, endDate: formData.endDate, } })
253
+            .then(response => {
254
+                download(response)
255
+                updataBtnloading(false)
256
+            }).catch(error => {
257
+                updataBtnloading(false)
258
+            })
259
+    }
260
+    // 默认日期
261
+    const dateRange = [
262
+        moment(formData.startDate),
263
+        moment(formData.endDate),
264
+    ]
265
+
266
+    const dataZoom = props.dataZoom ? [
267
+        {
268
+            type: 'inside',
269
+            start: 0,
270
+            end: 100
271
+        },
272
+        {
273
+            type: 'slider',
274
+            start: 0,
275
+            end: 100
276
+        },
277
+    ] : undefined
278
+    const dataset = chartsData || []
279
+    const options = {
280
+
281
+        color: ["#FF814C", "#F02B3E", "#FD9FFF", "#7BFF82", "#95CCFF", "#8C4FFF"],
282
+        tooltip: {
283
+            trigger: "axis"
284
+        },
285
+        icon: "rect",
286
+        legend: {
287
+            data: ["分享次数", "分享人数", "访问次数", "访问人数", "新增注册用户"]
288
+        },
289
+        toolbox: {},
290
+        xAxis: {
291
+            type: "category",
292
+        },
293
+        yAxis: {},
294
+        dataZoom,
295
+        series: [
296
+            {
297
+                name: "分享次数",
298
+                type: "line",
299
+            },
300
+            {
301
+                name: "分享人数",
302
+                type: "line",
303
+            },
304
+            {
305
+                name: "访问次数",
306
+                type: "line",
307
+            },
308
+            {
309
+                name: "访问人数",
310
+                type: "line",
311
+            },
312
+            {
313
+                name: "新增注册用户",
314
+                type: "line",
315
+            }
316
+        ],
317
+        dataset: {
318
+            dimensions: ['statisDate', 'shareNum', 'sharePersons', 'visitNum', 'visitPersons', 'newCustomers'],
319
+            source: dataset
320
+        }
321
+    }
322
+
323
+
324
+    const piestyles = {
325
+        width: '100%',
326
+        height: '400px',
327
+    }
328
+    return (
329
+
330
+        <>
331
+            <Button type="danger" style={{ marginBottom: '18px' }} onClick={() => router.go(-1)}>返回</Button>
332
+            <Form layout="inline">
333
+                <div style={{ display: 'flex', alignItems: 'center' }}>
334
+                    <Radio.Group buttonStyle="solid" value={radioVal} onChange={setFormData} style={{ marginRight: '16px', }}>
335
+                        <Radio.Button value={7}>最近7天</Radio.Button>
336
+                        <Radio.Button value={30}>最近1月</Radio.Button>
337
+                    </Radio.Group>
338
+                    <Form.Item>
339
+                        <RangePicker value={dateRange} onChange={handleDateChange} placeholder={['开始日期', '结束日期']} />
340
+                    </Form.Item>
341
+                    <Form.Item style={{ position: 'absolute', right: '38px' }}>
342
+                        <Button type="primary" onClick={handleSubmit}>查询</Button>
343
+                        <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
344
+                    </Form.Item>
345
+                </div>
346
+            </Form>
347
+            <div style={{ fontSize: '0.12rem', lineHeight: '2.6', fontWeight: '600' }}>趋势图:{props.location.query.targetName}</div>
348
+            <div>
349
+                <EChart options={options} style={piestyles} />
350
+            </div>
351
+
352
+            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
353
+                <h4 style={{ fontSize: '0.12rem', fontWeight: '600' }}>详细数据</h4>
354
+                <AuthButton name="admin.statistical.consultant.export" noRight={null}>
355
+                    <Button type="primary" onClick={exportRecord} loading={btnloading} style={{ zIndex: 1 }}>
356
+                        导出
357
+                </Button>
358
+                </AuthButton>
359
+            </div>
360
+
361
+            <Table rowKey={(index => { index })}
362
+                style={{ marginTop: '30px' }}
363
+                dataSource={data}
364
+                columns={columns}
365
+                pagination={{ pageSize: 10 }}
366
+                onChange={handleChange}
367
+                loading={loading}
368
+            />
369
+            {/* < div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
370
+                <Pagination size={2} showQuickJumper defaultCurrent={1}  total={data.total} onChange={changePageNum} current={data.current} />
371
+            </div> */}
372
+        </>
373
+    )
374
+}
375
+const WrappedHeader = Form.create({ name: 'record' })(record);
376
+
377
+export default WrappedHeader

+ 1
- 0
src/pages/statistical/activity/index.jsx View File

51
       <Tabs type="card" value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
51
       <Tabs type="card" value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
52
         <TabPane tab="统计总况" key="overView" ></TabPane>
52
         <TabPane tab="统计总况" key="overView" ></TabPane>
53
         <TabPane tab="统计内容" key="content" ></TabPane>
53
         <TabPane tab="统计内容" key="content" ></TabPane>
54
+        {/* <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft:'30px'}} /> */}
54
       </Tabs>
55
       </Tabs>
55
       <div style={{ marginTop: '20px' }}>
56
       <div style={{ marginTop: '20px' }}>
56
         { (tab === 'overView' && <OverView />)}
57
         { (tab === 'overView' && <OverView />)}

+ 9
- 4
src/pages/statistical/activity/shareNum.jsx View File

19
   
19
   
20
 let daterange = []
20
 let daterange = []
21
 let tableTitle = ['类型']
21
 let tableTitle = ['类型']
22
+let queryDate = ''
22
 
23
 
23
 let columns = [
24
 let columns = [
24
   {
25
   {
60
   constructor(props) {
61
   constructor(props) {
61
     super(props)
62
     super(props)
62
     console.log(props)
63
     console.log(props)
64
+    queryDate = props.location.query.queryDate
63
     let startDate;
65
     let startDate;
64
     let endDate;
66
     let endDate;
65
     if (props.location.query.queryDate){
67
     if (props.location.query.queryDate){
81
         startDate: startDate,
83
         startDate: startDate,
82
         endDate: endDate,
84
         endDate: endDate,
83
         activityId: props.location.query.activityId,
85
         activityId: props.location.query.activityId,
84
-        activityType:props.location.query.activityType   
86
+        activityType:props.location.query.activityType,
87
+        personId: props.location.query.personId   
85
       },
88
       },
86
       personData: [],  
89
       personData: [],  
87
       dataSoures: [],
90
       dataSoures: [],
88
       tableData: [],
91
       tableData: [],
89
       userType: 'all',
92
       userType: 'all',
90
-      buildingId: [],
91
-      targetType: []
93
+      activityName:  props.location.query.activityName
92
     }
94
     }
93
   }
95
   }
94
 
96
 
167
 
169
 
168
     return (
170
     return (
169
     <>
171
     <>
172
+        <div>
173
+          <span style={{marginLeft:'20px'}}>分享内容:{this.state.activityName}</span>
174
+        </div>
170
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
175
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
171
           <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
176
           <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
172
             {getFieldDecorator('sharePersonType')(
177
             {getFieldDecorator('sharePersonType')(
191
           </Form.Item>
196
           </Form.Item>
192
           </Form>     
197
           </Form>     
193
         <div>
198
         <div>
194
-        <AuthButton name="admin.customer.import" noRight={null}>
199
+        <AuthButton name="admin.statistical.activity.export" noRight={null}>
195
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
200
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
196
                 导出
201
                 导出
197
             </Button>
202
             </Button>

+ 75
- 6
src/pages/statistical/activity/sharePersonNum.jsx View File

20
 let daterange = []
20
 let daterange = []
21
 let tableTitle = ['类型']
21
 let tableTitle = ['类型']
22
 
22
 
23
+let staticStartDate = ''
24
+let staticEndDate = ''
25
+let queryDate = ''
26
+let activityName = ''
27
+
28
+const toShareNum = rowData => () => {
29
+  if(rowData) {
30
+    router.push({
31
+    pathname: '/statistical/activity/shareNum',
32
+    query: {
33
+      queryDate: queryDate,
34
+      personId: rowData.personId,
35
+      startDate: staticStartDate,
36
+      endDate: staticEndDate,
37
+      activityName: activityName
38
+    },
39
+  });
40
+    return
41
+  }
42
+}
43
+
44
+const toVisitPersonNum = rowData => () => {
45
+  if(rowData) {
46
+    router.push({
47
+    pathname: '/statistical/activity/visitPersonNum',
48
+    query: {
49
+      queryDate: queryDate,
50
+      personId: rowData.personId,
51
+      startDate: staticStartDate,
52
+      endDate: staticEndDate,
53
+      activityName: activityName
54
+    },
55
+  });
56
+    return
57
+  }
58
+} 
59
+
60
+const toVisitNum = rowData => () => {
61
+  if(rowData) {
62
+    router.push({
63
+    pathname: '/statistical/activity/visitNum',
64
+    query: {
65
+      queryDate: queryDate,
66
+      personId: rowData.personId,
67
+      startDate: staticStartDate,
68
+      endDate: staticEndDate,
69
+      activityName: activityName
70
+    },
71
+  });
72
+    return
73
+  }
74
+} 
75
+
23
 let columns = [
76
 let columns = [
24
   {
77
   {
25
     title: '分享者姓名',
78
     title: '分享者姓名',
46
     dataIndex: 'shareNum',
99
     dataIndex: 'shareNum',
47
     key: 'shareNum',
100
     key: 'shareNum',
48
     sorter: true,
101
     sorter: true,
49
-  },
102
+    render: (text, record) => (
103
+      <a style={{ color: '#66B3FF' }} onClick={toShareNum(record)}><span>{record.shareNum}</span></a>
104
+      ),
105
+    },
50
   {
106
   {
51
     title: '访问人数',
107
     title: '访问人数',
52
     dataIndex: 'visitPersonNum',
108
     dataIndex: 'visitPersonNum',
53
     key: 'visitPersonNum',
109
     key: 'visitPersonNum',
54
     sorter: true,
110
     sorter: true,
111
+    render: (text, record) => (
112
+      <a style={{ color: '#66B3FF' }} onClick={toVisitPersonNum(record)}><span>{record.visitPersonNum}</span></a>
113
+      ),
55
   },
114
   },
56
   {
115
   {
57
     title: '访问次数',
116
     title: '访问次数',
58
     dataIndex: 'visitNum',
117
     dataIndex: 'visitNum',
59
     key: 'visitNum',
118
     key: 'visitNum',
60
     sorter: true,
119
     sorter: true,
120
+    render: (text, record) => (
121
+      <a style={{ color: '#66B3FF' }} onClick={toVisitNum(record)}><span>{record.visitNum}</span></a>
122
+      ),
61
   },
123
   },
62
 ]
124
 ]
63
 
125
 
67
     super(props)
129
     super(props)
68
     let startDate;
130
     let startDate;
69
     let endDate;
131
     let endDate;
70
-    console.log(props)
132
+    queryDate = props.location.query.queryDate
133
+    activityName = props.location.query.activityName
134
+    staticStartDate = props.location.query.startDate;
135
+    staticEndDate = props.location.query.endDate;
136
+    
71
     if (props.location.query.queryDate){
137
     if (props.location.query.queryDate){
72
       startDate = moment(props.location.query.queryDate).hours(0).minutes(0).seconds(0).milliseconds(0).toDate();
138
       startDate = moment(props.location.query.queryDate).hours(0).minutes(0).seconds(0).milliseconds(0).toDate();
73
       endDate = moment(props.location.query.queryDate).hours(23).minutes(59).seconds(59).milliseconds(999).toDate();
139
       endDate = moment(props.location.query.queryDate).hours(23).minutes(59).seconds(59).milliseconds(999).toDate();
89
         startDate: startDate,
155
         startDate: startDate,
90
         endDate: endDate,
156
         endDate: endDate,
91
         activityId: props.location.query.activityId,
157
         activityId: props.location.query.activityId,
92
-        activityType:props.location.query.activityType        
158
+        activityType: props.location.query.activityType,
159
+        buildingId: props.location.query.buildingId,         
93
       },
160
       },
94
       personData: [],  
161
       personData: [],  
95
       dataSoures: [],
162
       dataSoures: [],
96
       tableData: [],
163
       tableData: [],
97
       userType: 'all',
164
       userType: 'all',
98
-      buildingId: [],
99
-      targetType: []
165
+      activityName:  props.location.query.activityName
100
     }
166
     }
101
   }
167
   }
102
 
168
 
175
 
241
 
176
     return (
242
     return (
177
     <>
243
     <>
244
+        <div>
245
+          <span style={{marginLeft:'20px'}}>分享内容:{this.state.activityName}</span>
246
+        </div>
178
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
247
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
179
           <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
248
           <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
180
             {getFieldDecorator('sharePersonType')(
249
             {getFieldDecorator('sharePersonType')(
199
           </Form.Item>
268
           </Form.Item>
200
           </Form>     
269
           </Form>     
201
         <div>
270
         <div>
202
-        <AuthButton name="admin.customer.import" noRight={null}>
271
+        <AuthButton name="admin.statistical.activity.export" noRight={null}>
203
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
272
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
204
                 导出
273
                 导出
205
             </Button>
274
             </Button>

+ 10
- 4
src/pages/statistical/activity/visitNum.jsx View File

20
   
20
   
21
 let daterange = []
21
 let daterange = []
22
 let tableTitle = ['类型']
22
 let tableTitle = ['类型']
23
+let queryDate = ''
23
 
24
 
24
 let columns = [
25
 let columns = [
25
   {
26
   {
79
 
80
 
80
   constructor(props) {
81
   constructor(props) {
81
     super(props)
82
     super(props)
83
+    queryDate = props.location.query.queryDate
84
+
82
     let startDate;
85
     let startDate;
83
     let endDate;
86
     let endDate;
84
     if (props.location.query.queryDate){
87
     if (props.location.query.queryDate){
100
         realtyConsultant:'',
103
         realtyConsultant:'',
101
         realtyConsultantPhone:'',
104
         realtyConsultantPhone:'',
102
         activityId: props.location.query.activityId,
105
         activityId: props.location.query.activityId,
103
-        activityType:props.location.query.activityType  
106
+        activityType: props.location.query.activityType,
107
+        personId: props.location.query.personId,
104
       },
108
       },
105
       personData: [],  
109
       personData: [],  
106
       dataSoures: [],
110
       dataSoures: [],
107
       tableData: [],
111
       tableData: [],
108
       userType: 'all',
112
       userType: 'all',
109
-      buildingId: [],
110
-      targetType: []
113
+      activityName:  props.location.query.activityName
111
     }
114
     }
112
   }
115
   }
113
 
116
 
185
 
188
 
186
     return (
189
     return (
187
     <>
190
     <>
191
+        <div>
192
+          <span style={{marginLeft:'20px'}}>分享内容:{this.state.activityName}</span>
193
+        </div>
188
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
194
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
189
         <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
195
         <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
190
           {getFieldDecorator('personFrom')(
196
           {getFieldDecorator('personFrom')(
208
           </Form.Item>
214
           </Form.Item>
209
           </Form>     
215
           </Form>     
210
         <div>
216
         <div>
211
-        <AuthButton name="admin.customer.import" noRight={null}>
217
+        <AuthButton name="admin.statistical.activity.export" noRight={null}>
212
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
218
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
213
                 导出
219
                 导出
214
             </Button>
220
             </Button>

+ 11
- 4
src/pages/statistical/activity/visitPersonNum.jsx View File

20
   
20
   
21
 let daterange = []
21
 let daterange = []
22
 let tableTitle = ['类型']
22
 let tableTitle = ['类型']
23
+let queryDate = ''
23
 
24
 
24
 let columns = [
25
 let columns = [
25
   {
26
   {
78
 
79
 
79
   constructor(props) {
80
   constructor(props) {
80
     super(props)
81
     super(props)
82
+    queryDate = props.location.query.queryDate
83
+
81
     let startDate;
84
     let startDate;
82
     let endDate;
85
     let endDate;
86
+    
83
     if (props.location.query.queryDate){
87
     if (props.location.query.queryDate){
84
       startDate = moment(props.location.query.queryDate).hours(0).minutes(0).seconds(0).milliseconds(0).toDate();
88
       startDate = moment(props.location.query.queryDate).hours(0).minutes(0).seconds(0).milliseconds(0).toDate();
85
       endDate = moment(props.location.query.queryDate).hours(23).minutes(59).seconds(59).milliseconds(999).toDate();
89
       endDate = moment(props.location.query.queryDate).hours(23).minutes(59).seconds(59).milliseconds(999).toDate();
99
         realtyConsultant:'',
103
         realtyConsultant:'',
100
         realtyConsultantPhone:'',
104
         realtyConsultantPhone:'',
101
         activityId: props.location.query.activityId,
105
         activityId: props.location.query.activityId,
102
-        activityType:props.location.query.activityType  
106
+        activityType:props.location.query.activityType ,
107
+        personId:  props.location.query.personId
103
       },
108
       },
104
       personData: [],  
109
       personData: [],  
105
       dataSoures: [],
110
       dataSoures: [],
106
       tableData: [],
111
       tableData: [],
107
       userType: 'all',
112
       userType: 'all',
108
-      buildingId: [],
109
-      targetType: []
113
+      activityName:  props.location.query.activityName
110
     }
114
     }
111
   }
115
   }
112
 
116
 
184
 
188
 
185
     return (
189
     return (
186
     <>
190
     <>
191
+        <div>
192
+          <span style={{marginLeft:'20px'}}>分享内容:{this.state.activityName}</span>
193
+        </div>
187
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
194
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
188
         <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
195
         <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
189
           {getFieldDecorator('personFrom')(
196
           {getFieldDecorator('personFrom')(
207
           </Form.Item>
214
           </Form.Item>
208
           </Form>     
215
           </Form>     
209
         <div>
216
         <div>
210
-        <AuthButton name="admin.customer.import" noRight={null}>
217
+        <AuthButton name="admin.statistical.activity.export" noRight={null}>
211
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
218
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
212
                 导出
219
                 导出
213
             </Button>
220
             </Button>

+ 15
- 0
src/services/apis.js View File

424
       url: `${prefix}/selectCityUser`,
424
       url: `${prefix}/selectCityUser`,
425
       action: 'admin.selectCityUser.get',
425
       action: 'admin.selectCityUser.get',
426
     },
426
     },
427
+    personCity: {
428
+      method: 'get',
429
+      url: `${prefix}/selectCityPerson`,
430
+      action: 'admin.selectCityPerson.get',
431
+    },
427
     indexBanner: {
432
     indexBanner: {
428
       method: 'get',
433
       method: 'get',
429
       url: `${prefix}/listNoticeByCondition`,
434
       url: `${prefix}/listNoticeByCondition`,
1687
       url: `${prefix}/stats/tableList`,
1692
       url: `${prefix}/stats/tableList`,
1688
       action: 'admin.contract.list.get',
1693
       action: 'admin.contract.list.get',
1689
     },
1694
     },
1695
+    activityDetail: {
1696
+      method: 'GET',
1697
+      url: `${prefix}/stats/activity/detail`,
1698
+      action: 'admin.contract.list.get',
1699
+    },
1700
+    exportActivityDetail: {
1701
+      method: 'POST',
1702
+      url: `${prefix}/stats/activity/detail`,
1703
+      action: 'admin.contract.list.post',
1704
+    },
1690
     consultantKPI: {
1705
     consultantKPI: {
1691
       method: 'GET',
1706
       method: 'GET',
1692
       url: `${prefix}/stats/consultant/kpi`,
1707
       url: `${prefix}/stats/consultant/kpi`,