|
@@ -1,12 +1,12 @@
|
1
|
1
|
import React, { Component, useState, useEffect } from 'react';
|
2
|
|
-import { Radio, DatePicker, Form, Input, Button, Icon, Select, message,Table} from 'antd';
|
|
2
|
+import { Radio, DatePicker, Form, Input, Button, Icon, Select, message, Table } from 'antd';
|
3
|
3
|
import { Row, Col, Menu, Dropdown } from 'antd';
|
4
|
4
|
import UserBehavior from './components/UserBehavior'
|
5
|
5
|
import moment from 'moment';
|
6
|
6
|
import EChart from '../../components/EchartsTest/EChart';
|
7
|
7
|
import request from '../../utils/request';
|
8
|
8
|
import apis from '../../services/apis';
|
9
|
|
-
|
|
9
|
+import BuildSelect from '../../components/SelectButton/BuildSelect'
|
10
|
10
|
|
11
|
11
|
// const formatDate = (start, end) => {
|
12
|
12
|
// const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
|
|
@@ -20,7 +20,7 @@ const header = props => {
|
20
|
20
|
|
21
|
21
|
const [endDate, setEndDate] = useState({})
|
22
|
22
|
const [startDate, setStartDate] = useState({})
|
23
|
|
- let daterange= []
|
|
23
|
+ let daterange = []
|
24
|
24
|
|
25
|
25
|
useEffect(() => {
|
26
|
26
|
|
|
@@ -31,13 +31,13 @@ const header = props => {
|
31
|
31
|
|
32
|
32
|
const { RangePicker } = DatePicker;
|
33
|
33
|
|
34
|
|
- function onChangetime (dates, dateStrings) {
|
|
34
|
+ function onChangetime(dates, dateStrings) {
|
35
|
35
|
|
36
|
|
- daterange[1]=dateStrings[1]
|
37
|
|
- daterange[0]=dateStrings[0]
|
|
36
|
+ daterange[1] = dateStrings[1]
|
|
37
|
+ daterange[0] = dateStrings[0]
|
38
|
38
|
|
39
|
39
|
}
|
40
|
|
-
|
|
40
|
+
|
41
|
41
|
const getDataOf = (days) => () => {
|
42
|
42
|
|
43
|
43
|
setEndDate(new Date())
|
|
@@ -46,22 +46,22 @@ const header = props => {
|
46
|
46
|
}
|
47
|
47
|
|
48
|
48
|
|
49
|
|
- function datalist () {
|
|
49
|
+ function datalist() {
|
50
|
50
|
|
51
|
51
|
setEndDate(daterange[1])
|
52
|
52
|
setStartDate(daterange[0])
|
53
|
53
|
|
54
|
54
|
}
|
55
|
|
-
|
56
|
|
- function redata (e) {
|
57
|
|
-
|
58
|
55
|
|
59
|
|
- console.log('行为回调数据:' ,e)
|
60
|
|
- }
|
61
|
|
-
|
62
|
|
-
|
|
56
|
+ function redata(e) {
|
63
|
57
|
|
64
|
58
|
|
|
59
|
+ console.log('行为回调数据:', e)
|
|
60
|
+ }
|
|
61
|
+ function handleChange(value) {
|
|
62
|
+ console.log(`selected ${value}`);
|
|
63
|
+ }
|
|
64
|
+
|
65
|
65
|
const columns = [
|
66
|
66
|
{
|
67
|
67
|
title: '访问事件',
|
|
@@ -91,11 +91,11 @@ const header = props => {
|
91
|
91
|
title: '离开时间',
|
92
|
92
|
dataIndex: 'stion',
|
93
|
93
|
key: 'stion',
|
94
|
|
-
|
|
94
|
+
|
95
|
95
|
},
|
96
|
96
|
];
|
97
|
97
|
|
98
|
|
- const dataSource = []
|
|
98
|
+ const dataSource = []
|
99
|
99
|
|
100
|
100
|
return (<>
|
101
|
101
|
<div style={{
|
|
@@ -105,7 +105,8 @@ const header = props => {
|
105
|
105
|
borderRadius: '12px',
|
106
|
106
|
minHeight: '1000vh'
|
107
|
107
|
}}>
|
108
|
|
- <Radio.Group buttonStyle="solid" defaultValue="a">
|
|
108
|
+ <div>
|
|
109
|
+ <Radio.Group buttonStyle="solid" defaultValue="a">
|
109
|
110
|
<Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
|
110
|
111
|
<Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
|
111
|
112
|
</Radio.Group>
|
|
@@ -118,11 +119,33 @@ const header = props => {
|
118
|
119
|
showTime
|
119
|
120
|
onChange={onChangetime}
|
120
|
121
|
/>
|
121
|
|
- <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={datalist}>
|
|
122
|
+ <Button type="primary" htmlType="submit" style={{ marginLeft: '30px',float:'right' }} onClick={datalist}>
|
122
|
123
|
搜索
|
123
|
124
|
</Button>
|
124
|
|
- <div style={{margin:'24px 0'}}>
|
125
|
|
- <UserBehavior endDate={endDate} startDate={startDate} dataZoom={true} onReData={(e) => redata(e)}></UserBehavior>
|
|
125
|
+ </div>
|
|
126
|
+
|
|
127
|
+ <div style={{ display: 'flex', margin: '24px 0' }}>
|
|
128
|
+ <BuildSelect slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
|
|
129
|
+ <Select placeholder="所有事件组" style={{ width: '14%',minWidth:'160px',marginRight:'2%' }} onChange={handleChange}>
|
|
130
|
+ <Option value="jack">Jack</Option>
|
|
131
|
+ <Option value="lucy">Lucy</Option>
|
|
132
|
+ <Option value="Yiminghe">yiminghe</Option>
|
|
133
|
+ </Select>
|
|
134
|
+ <Select placeholder="请选择事件" style={{ width: '14%',minWidth:'160px',marginRight:'2%' }} onChange={handleChange}>
|
|
135
|
+ <Option value="jack">Jack</Option>
|
|
136
|
+ <Option value="lucy">Lucy</Option>
|
|
137
|
+ <Option value="Yiminghe">yiminghe</Option>
|
|
138
|
+ </Select>
|
|
139
|
+ <Select placeholder="请选择属性" style={{ width: '14%',minWidth:'160px' }} onChange={handleChange}>
|
|
140
|
+ <Option value="jack">Jack</Option>
|
|
141
|
+ <Option value="lucy">Lucy</Option>
|
|
142
|
+ <Option value="Yiminghe">yiminghe</Option>
|
|
143
|
+ </Select>
|
|
144
|
+ </div>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+ <div style={{ margin: '24px 0' }}>
|
|
148
|
+ <UserBehavior BuildSelectHide={true} endDate={endDate} startDate={startDate} dataZoom={true} onReData={(e) => redata(e)}></UserBehavior>
|
126
|
149
|
</div>
|
127
|
150
|
|
128
|
151
|
<Table dataSource={dataSource} columns={columns} pagination={false} scroll={{ y: 500 }} />
|