|
@@ -7,82 +7,199 @@ import request from '@/utils/request';
|
7
|
7
|
import apis from '@/services/apis';
|
8
|
8
|
|
9
|
9
|
const Monitor = props => {
|
|
10
|
+ const [data, setData] = useState([]);
|
10
|
11
|
|
11
|
|
- const [data, setData] = useState([])
|
12
|
|
-
|
13
|
|
- const [checkData, setCheckData] = useState([])
|
|
12
|
+ const [checkData, setCheckData] = useState([]);
|
14
|
13
|
|
15
|
14
|
useEffect(() => {
|
16
|
|
- getIndexEcharts()
|
17
|
|
- getBuildingReports()
|
18
|
|
- }, [])
|
|
15
|
+ getIndexEcharts();
|
|
16
|
+ getBuildingReports();
|
|
17
|
+ }, []);
|
19
|
18
|
|
20
|
19
|
function getIndexEcharts(params) {
|
21
|
20
|
request({
|
22
|
21
|
...apis.indexEcharts.list,
|
23
|
|
- params
|
24
|
|
- }).then((data) => {
|
25
|
|
- setData(data)
|
26
|
|
- console.log(data, '11111')
|
27
|
|
- })
|
|
22
|
+ params,
|
|
23
|
+ }).then(data => {
|
|
24
|
+ setData(data);
|
|
25
|
+ console.log(data, '11111');
|
|
26
|
+ });
|
28
|
27
|
}
|
29
|
28
|
|
30
|
29
|
function getBuildingReports() {
|
31
|
|
- request({ ...apis.system.taBuildingReports, }).then((data) => {
|
32
|
|
- console.log(data,"22222222222222222")
|
33
|
|
- setCheckData((data.records || []).map((x) => x.reportCode))
|
34
|
|
- })
|
|
30
|
+ request({ ...apis.system.taBuildingReports }).then(data => {
|
|
31
|
+ console.log(
|
|
32
|
+ (data.records || []).map(x => x.reportCode),
|
|
33
|
+ '22222222222222222',
|
|
34
|
+ );
|
|
35
|
+ setCheckData((data.records || []).map(x => x.reportCode));
|
|
36
|
+ });
|
35
|
37
|
}
|
36
|
38
|
|
37
|
39
|
return (
|
38
|
40
|
<Card>
|
39
|
41
|
<div style={{ display: 'flex', marginBottom: '33px' }}>
|
40
|
|
- {checkData.includes('total_number_of_users') &&
|
41
|
|
- <div style={{
|
42
|
|
- 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',
|
43
|
|
- boxShadow: '0px 0.106rem 14px -15px rgba(241,43,62,1)',
|
44
|
|
- borderRadius: '12px', width: '32%', marginRight: '2%'
|
45
|
|
- }}>
|
|
42
|
+ {checkData.includes('total_number_of_users') && (
|
|
43
|
+ <div
|
|
44
|
+ style={{
|
|
45
|
+ textAlign: 'center',
|
|
46
|
+ display: 'flex',
|
|
47
|
+ justifyContent: 'center',
|
|
48
|
+ lineHeight: '100px',
|
|
49
|
+ background: 'linear-gradient(144deg,rgba(241,43,62,1) 0%,rgba(254,144,155,1) 100%)',
|
|
50
|
+ height: '100px',
|
|
51
|
+ boxShadow: '0px 0.106rem 14px -15px rgba(241,43,62,1)',
|
|
52
|
+ borderRadius: '12px',
|
|
53
|
+ width: '32%',
|
|
54
|
+ marginRight: '2%',
|
|
55
|
+ }}
|
|
56
|
+ >
|
46
|
57
|
<span style={{ fontSize: '24px', color: '#fff' }}>总用户 </span>
|
47
|
|
- <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectUserCount || '0'}</span>
|
|
58
|
+ <span
|
|
59
|
+ style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}
|
|
60
|
+ >
|
|
61
|
+ {data.selectUserCount || '0'}
|
|
62
|
+ </span>
|
48
|
63
|
</div>
|
49
|
|
- }
|
50
|
|
- {checkData.includes('total_number_of_registered_users') &&
|
51
|
|
- <div style={{
|
52
|
|
- 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',
|
53
|
|
- boxShadow: '0px 0.106rem 14px -15px rgba(255,126,74,1)',
|
54
|
|
- borderRadius: '12px', width: '32%', marginRight: '2%'
|
55
|
|
- }}>
|
|
64
|
+ )}
|
|
65
|
+ {checkData.includes('total_number_of_registered_users') && (
|
|
66
|
+ <div
|
|
67
|
+ style={{
|
|
68
|
+ textAlign: 'center',
|
|
69
|
+ display: 'flex',
|
|
70
|
+ justifyContent: 'center',
|
|
71
|
+ lineHeight: '100px',
|
|
72
|
+ background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)',
|
|
73
|
+ height: '100px',
|
|
74
|
+ boxShadow: '0px 0.106rem 14px -15px rgba(255,126,74,1)',
|
|
75
|
+ borderRadius: '12px',
|
|
76
|
+ width: '32%',
|
|
77
|
+ marginRight: '2%',
|
|
78
|
+ }}
|
|
79
|
+ >
|
56
|
80
|
<span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
|
57
|
|
- <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectRegisteredCount || '0'}</span>
|
|
81
|
+ <span
|
|
82
|
+ style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}
|
|
83
|
+ >
|
|
84
|
+ {data.selectRegisteredCount || '0'}
|
|
85
|
+ </span>
|
58
|
86
|
</div>
|
59
|
|
- }
|
60
|
|
- {checkData.includes('total_number_of_visit_users') &&
|
61
|
|
- <div style={{
|
62
|
|
- 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',
|
63
|
|
- boxShadow: '0px 0.106rem 14px -15px rgba(255,126,74,1)',
|
64
|
|
- borderRadius: '12px', width: '32%', marginRight: '2%'
|
65
|
|
- }}>
|
|
87
|
+ )}
|
|
88
|
+ {checkData.includes('total_number_of_visit_users') && (
|
|
89
|
+ <div
|
|
90
|
+ style={{
|
|
91
|
+ textAlign: 'center',
|
|
92
|
+ display: 'flex',
|
|
93
|
+ justifyContent: 'center',
|
|
94
|
+ lineHeight: '100px',
|
|
95
|
+ background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)',
|
|
96
|
+ height: '100px',
|
|
97
|
+ boxShadow: '0px 0.106rem 14px -15px rgba(255,126,74,1)',
|
|
98
|
+ borderRadius: '12px',
|
|
99
|
+ width: '32%',
|
|
100
|
+ marginRight: '2%',
|
|
101
|
+ }}
|
|
102
|
+ >
|
66
|
103
|
<span style={{ fontSize: '24px', color: '#fff' }}>今日访问次数 </span>
|
67
|
|
- <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectVisitCount || '0'}</span>
|
|
104
|
+ <span
|
|
105
|
+ style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}
|
|
106
|
+ >
|
|
107
|
+ {data.selectVisitCount || '0'}
|
|
108
|
+ </span>
|
|
109
|
+ </div>
|
|
110
|
+ )}
|
|
111
|
+ {checkData.includes('number_of_new_users') && (
|
|
112
|
+ <div
|
|
113
|
+ onClick={() => router.push('/statistical/newUsers')}
|
|
114
|
+ style={{
|
|
115
|
+ textAlign: 'center',
|
|
116
|
+ display: 'flex',
|
|
117
|
+ justifyContent: 'center',
|
|
118
|
+ background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)',
|
|
119
|
+ height: '100px',
|
|
120
|
+ boxShadow: '0px 0.106rem 14px -15px rgba(107,130,230,1)',
|
|
121
|
+ borderRadius: '12px',
|
|
122
|
+ width: '32%',
|
|
123
|
+ }}
|
|
124
|
+ >
|
|
125
|
+ <span
|
|
126
|
+ style={{
|
|
127
|
+ fontSize: '24px',
|
|
128
|
+ color: '#fff',
|
|
129
|
+ borderBottom: '1px solid #fff',
|
|
130
|
+ margin: '30px 0',
|
|
131
|
+ cursor: 'pointer',
|
|
132
|
+ }}
|
|
133
|
+ >
|
|
134
|
+ 今日新增用户{' '}
|
|
135
|
+ </span>
|
|
136
|
+ <span
|
|
137
|
+ style={{
|
|
138
|
+ fontSize: '52px',
|
|
139
|
+ color: '#fff',
|
|
140
|
+ marginLeft: '26px',
|
|
141
|
+ fontFamily: 'fantasy',
|
|
142
|
+ lineHeight: '100px',
|
|
143
|
+ }}
|
|
144
|
+ >
|
|
145
|
+ {data.selectRecentlyCount || '0'}
|
|
146
|
+ </span>
|
68
|
147
|
</div>
|
69
|
|
- }
|
70
|
|
- {checkData.includes('number_of_new_users') &&
|
71
|
|
- <div onClick={() => router.push('/statistical/newUsers')} style={{
|
72
|
|
- textAlign: 'center', display: 'flex', justifyContent: 'center', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
|
73
|
|
- boxShadow: '0px 0.106rem 14px -15px rgba(107,130,230,1)',
|
74
|
|
- borderRadius: '12px', width: '32%',
|
75
|
|
- }}>
|
76
|
|
- <span style={{ fontSize: '24px', color: '#fff', borderBottom: '1px solid #fff', margin: '30px 0', cursor: 'pointer' }}>今日新增用户 </span>
|
77
|
|
- <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy', lineHeight: '100px' }}>{data.selectRecentlyCount || '0'}</span>
|
|
148
|
+ )}
|
|
149
|
+ {checkData.includes('total_number_of_users') && (
|
|
150
|
+ <div
|
|
151
|
+ style={{
|
|
152
|
+ textAlign: 'center',
|
|
153
|
+ display: 'flex',
|
|
154
|
+ justifyContent: 'center',
|
|
155
|
+ lineHeight: '100px',
|
|
156
|
+ background: 'linear-gradient(144deg,rgba(241,43,62,1) 0%,rgba(254,144,155,1) 100%)',
|
|
157
|
+ height: '100px',
|
|
158
|
+ boxShadow: '0px 0.106rem 14px -15px rgba(241,43,62,1)',
|
|
159
|
+ borderRadius: '12px',
|
|
160
|
+ width: '32%',
|
|
161
|
+ marginRight: '2%',
|
|
162
|
+ }}
|
|
163
|
+ >
|
|
164
|
+ <span style={{ fontSize: '24px', color: '#fff' }}>总用户 </span>
|
|
165
|
+ <span
|
|
166
|
+ style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}
|
|
167
|
+ >
|
|
168
|
+ {data.selectUserCount || '0'}
|
|
169
|
+ </span>
|
78
|
170
|
</div>
|
79
|
|
- }
|
|
171
|
+ )}
|
|
172
|
+ {checkData.includes('total_number_of_users') && (
|
|
173
|
+ <div
|
|
174
|
+ style={{
|
|
175
|
+ textAlign: 'center',
|
|
176
|
+ display: 'flex',
|
|
177
|
+ justifyContent: 'center',
|
|
178
|
+ lineHeight: '100px',
|
|
179
|
+ background: 'linear-gradient(144deg,rgba(241,43,62,1) 0%,rgba(254,144,155,1) 100%)',
|
|
180
|
+ height: '100px',
|
|
181
|
+ boxShadow: '0px 0.106rem 14px -15px rgba(241,43,62,1)',
|
|
182
|
+ borderRadius: '12px',
|
|
183
|
+ width: '32%',
|
|
184
|
+ marginRight: '2%',
|
|
185
|
+ }}
|
|
186
|
+ >
|
|
187
|
+ <span style={{ fontSize: '24px', color: '#fff' }}>总用户 </span>
|
|
188
|
+ <span
|
|
189
|
+ style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}
|
|
190
|
+ >
|
|
191
|
+ {data.selectUserCount || '0'}
|
|
192
|
+ </span>
|
|
193
|
+ </div>
|
|
194
|
+ )}
|
80
|
195
|
</div>
|
81
|
196
|
{/* <Swiper /> */}
|
82
|
|
- <IndexEcharts style={{ width: '100%' }} onReData={(e) => redata(e)} checkData={checkData}></IndexEcharts>
|
|
197
|
+ <IndexEcharts
|
|
198
|
+ style={{ width: '100%' }}
|
|
199
|
+ onReData={e => redata(e)}
|
|
200
|
+ checkData={checkData}
|
|
201
|
+ ></IndexEcharts>
|
83
|
202
|
</Card>
|
84
|
|
- )
|
85
|
|
-
|
86
|
|
-}
|
87
|
|
-export default Monitor
|
88
|
|
-
|
|
203
|
+ );
|
|
204
|
+};
|
|
205
|
+export default Monitor;
|