|
@@ -4,7 +4,6 @@ import UserSource from './components/UserSource.jsx';
|
4
|
4
|
import UserSourcepie from './components/UserSourcepie.jsx';
|
5
|
5
|
// import XForm, { FieldTypes } from '../../components/XForm';
|
6
|
6
|
import moment from 'moment';
|
7
|
|
-
|
8
|
7
|
import EChart from '../../components/EchartsTest/EChart';
|
9
|
8
|
import request from '../../utils/request';
|
10
|
9
|
import apis from '../../services/apis';
|
|
@@ -21,13 +20,11 @@ const header = props => {
|
21
|
20
|
|
22
|
21
|
const [tableData, setTableData] = useState([])
|
23
|
22
|
const [userType, setuserType] = useState([])
|
24
|
|
-
|
25
|
23
|
const [endDate, setEndDate] = useState({})
|
26
|
24
|
const [startDate, setStartDate] = useState({})
|
27
|
25
|
let daterange = []
|
28
|
26
|
|
29
|
27
|
useEffect(() => {
|
30
|
|
-
|
31
|
28
|
setEndDate(new Date())
|
32
|
29
|
setStartDate(moment().subtract(7, 'day').toDate())
|
33
|
30
|
setuserType('all')
|
|
@@ -50,18 +47,11 @@ const header = props => {
|
50
|
47
|
|
51
|
48
|
const getDataOf = (days) => () => {
|
52
|
49
|
|
53
|
|
-
|
54
|
50
|
setEndDate(new Date())
|
55
|
51
|
setStartDate(moment().subtract(days, 'day').toDate())
|
56
|
52
|
|
57
|
53
|
}
|
58
|
54
|
|
59
|
|
- function onChange(e) {
|
60
|
|
-
|
61
|
|
- // console.log(`radio checked:${e.target.value}`);
|
62
|
|
-
|
63
|
|
- }
|
64
|
|
-
|
65
|
55
|
function datalist() {
|
66
|
56
|
|
67
|
57
|
setEndDate(daterange[1])
|
|
@@ -70,26 +60,8 @@ const header = props => {
|
70
|
60
|
}
|
71
|
61
|
|
72
|
62
|
|
73
|
|
-
|
74
|
|
- // const userType = 'all'
|
75
|
63
|
let tableTitle = ['日期']
|
76
|
|
- // const dataset = data || {}
|
77
|
|
-
|
78
|
|
- // function tableData () {
|
79
|
|
-
|
80
|
|
- // const data = (dataset.data || []).reduce((acc, item, index) => {
|
81
|
|
- // const { date, fromName, count, registered } = item
|
82
|
|
- // const num = userType === 'registered' ? registered : count
|
83
|
|
-
|
84
|
|
- // tableTitle = tableTitle.indexOf(fromName) > -1 ? tableTitle : tableTitle.concat(fromName) // eslint-disable-line
|
85
|
|
- // acc[date] = { ...acc[date], [`${fromName}`]: !num ? 0 : num }
|
86
|
|
-
|
87
|
|
- // return acc
|
88
|
|
- // }, {})
|
89
|
|
-
|
90
|
|
- // return Object.keys(data).map(x => ({ label: x, ...data[x] }))
|
91
|
64
|
|
92
|
|
- // }
|
93
|
65
|
|
94
|
66
|
function onTabledatas(e) {
|
95
|
67
|
const data = (e.data || []).reduce((acc, item, index) => {
|