|
@@ -1,76 +1,60 @@
|
1
|
|
-import React, { useEffect, useState } from 'react';
|
|
1
|
+import React, { Component, useState, useEffect } from 'react';
|
2
|
2
|
import { Card, Typography, Alert, Row, Col } from 'antd';
|
3
|
3
|
import { FormattedMessage } from 'umi-plugin-react/locale';
|
4
|
4
|
import EchartsTest from '../components/EchartsTest';
|
5
|
5
|
import IndexEcharts from './indexEcharts/index';
|
6
|
6
|
import router from 'umi/router';
|
|
7
|
+import request from '../utils/request';
|
7
|
8
|
import apis from '../services/apis';
|
8
|
|
-import request from '../utils/request'
|
9
|
|
-const Welcome = (props) => {
|
10
|
9
|
|
11
|
|
- const option = {
|
12
|
|
- xAxis: {
|
13
|
|
- type: 'category',
|
14
|
|
- data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
15
|
|
- },
|
16
|
|
- yAxis: {
|
17
|
|
- type: 'value'
|
18
|
|
- },
|
19
|
|
- series: [{
|
20
|
|
- data: [820, 932, 901, 934, 1290, 1330, 1320],
|
21
|
|
- type: 'line'
|
22
|
|
- }]
|
23
|
|
- };
|
|
10
|
+const welcome = (props) => {
|
|
11
|
+
|
|
12
|
+ const [data, setData] = useState([])
|
|
13
|
+
|
24
|
14
|
useEffect(() => {
|
25
|
|
- echratsInfo();
|
|
15
|
+ getIndexEcharts()
|
26
|
16
|
}, [])
|
27
|
|
- const [data, setData] = useState({ records: [] })
|
28
|
|
- function echratsInfo(params) {
|
|
17
|
+
|
|
18
|
+ function getIndexEcharts(params) {
|
29
|
19
|
request({
|
30
|
20
|
...apis.indexEcharts.list,
|
31
|
|
- params,
|
|
21
|
+ params
|
32
|
22
|
}).then((data) => {
|
33
|
23
|
setData(data)
|
34
|
|
- console.log(data, "666666666666666666666666666666")
|
35
|
|
-
|
|
24
|
+ console.log(data, '11111')
|
36
|
25
|
})
|
37
|
26
|
}
|
38
|
|
-
|
39
|
27
|
return (
|
40
|
|
- <>
|
41
|
|
- <div style={{ display: 'flex', marginBottom: '33px' }}>
|
42
|
|
- <div style={{
|
43
|
|
- 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',
|
44
|
|
- boxShadow: '0px 0.11rem 14px -15px rgba(241,43,62,1)',
|
45
|
|
- borderRadius: '12px', width: '32%', marginRight: '2%'
|
46
|
|
- }}>
|
47
|
|
- <span style={{ fontSize: '24px', color: '#fff' }}>总用户 </span>
|
48
|
|
- <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectUserCount || '0'}</span>
|
49
|
|
- </div>
|
50
|
|
- <div style={{
|
51
|
|
- 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',
|
52
|
|
- boxShadow: '0px 0.11rem 14px -15px rgba(255,126,74,1)',
|
53
|
|
- borderRadius: '12px', width: '32%', marginRight: '2%'
|
54
|
|
- }}>
|
55
|
|
- <span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
|
56
|
|
- <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectRegisteredCount || '0'}</span>
|
57
|
|
- </div>
|
58
|
|
- <div onClick={() => router.push('/indexEcharts/newUsers')} style={{
|
59
|
|
- textAlign: 'center', display: 'flex', justifyContent: 'center', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
|
60
|
|
- boxShadow: '0px 0.11rem 14px -15px rgba(107,130,230,1)',
|
61
|
|
- borderRadius: '12px', width: '32%',
|
62
|
|
- }}>
|
63
|
|
- <span style={{ fontSize: '24px', color: '#fff', borderBottom: '1px solid #fff', margin: '30px 0' }}>最近7天新增 </span>
|
64
|
|
- <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy', lineHeight: '100px' }}>{data.selectRecentlyCount || '0'}</span>
|
65
|
|
- </div>
|
66
|
|
- </div>
|
67
|
|
- <IndexEcharts style={{ width: '100%' }}></IndexEcharts>
|
68
|
28
|
|
69
|
|
- {/* <EchartsTest style={{ width: 500, height: 500 }}></EchartsTest> */}
|
70
|
|
-
|
71
|
|
- </>
|
|
29
|
+ <div style={{ display: 'flex', marginBottom: '33px' }}>
|
|
30
|
+ <div style={{
|
|
31
|
+ 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',
|
|
32
|
+ boxShadow: '0px 0.11rem 14px -15px rgba(241,43,62,1)',
|
|
33
|
+ borderRadius: '12px', width: '32%', marginRight: '2%'
|
|
34
|
+ }}>
|
|
35
|
+ <span style={{ fontSize: '24px', color: '#fff' }}>总用户 </span>
|
|
36
|
+ <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectUserCount || '0'}</span>
|
|
37
|
+ </div>
|
|
38
|
+ <div style={{
|
|
39
|
+ 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',
|
|
40
|
+ boxShadow: '0px 0.11rem 14px -15px rgba(255,126,74,1)',
|
|
41
|
+ borderRadius: '12px', width: '32%', marginRight: '2%'
|
|
42
|
+ }}>
|
|
43
|
+ <span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
|
|
44
|
+ <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectRegisteredCount || '0'}</span>
|
|
45
|
+ </div>
|
|
46
|
+ <div onClick={() => router.push('/indexEcharts/newUsers')} style={{
|
|
47
|
+ textAlign: 'center', display: 'flex', justifyContent: 'center', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
|
|
48
|
+ boxShadow: '0px 0.11rem 14px -15px rgba(107,130,230,1)',
|
|
49
|
+ borderRadius: '12px', width: '32%',
|
|
50
|
+ }}>
|
|
51
|
+ <span style={{ fontSize: '24px', color: '#fff', borderBottom: '1px solid #fff', margin: '30px 0' }}>最近7天新增 </span>
|
|
52
|
+ <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy', lineHeight: '100px' }}>{data.selectRecentlyCount || '0'}</span>
|
|
53
|
+ </div>
|
|
54
|
+ <IndexEcharts style={{ width: '100%' }} onReData={(e) => redata(e)} ></IndexEcharts>
|
|
55
|
+ </div>
|
72
|
56
|
)
|
73
|
|
-}
|
74
|
|
-export default Welcome;
|
75
|
57
|
|
|
58
|
+}
|
|
59
|
+export default welcome
|
76
|
60
|
|