12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- import React, { useEffect, useState } from 'react';
- import { Card, Typography, Alert, Row, Col } from 'antd';
- import { FormattedMessage } from 'umi-plugin-react/locale';
- import EchartsTest from '../components/EchartsTest';
- import IndexEcharts from './indexEcharts/index';
- import router from 'umi/router';
- import apis from '../services/apis';
- import request from '../utils/request'
- const Welcome = (props) => {
-
- const option = {
- xAxis: {
- type: 'category',
- data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
- },
- yAxis: {
- type: 'value'
- },
- series: [{
- data: [820, 932, 901, 934, 1290, 1330, 1320],
- type: 'line'
- }]
- };
- useEffect(() => {
- echratsInfo();
- }, [])
- const [data, setData] = useState({ records: [] })
- function echratsInfo(params) {
- request({
- ...apis.indexEcharts.list,
- params,
- }).then((data) => {
- setData(data)
- console.log(data, "666666666666666666666666666666")
-
- })
- }
-
- return (
- <>
- <div style={{ display: 'flex', marginBottom: '28px' }}>
- <div style={{
- 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',
- boxShadow: '0px 0.11rem 14px -15px rgba(241,43,62,1)',
- borderRadius: '12px', width: '32%', marginRight: '2%'
- }}>
- <span style={{ fontSize: '24px', color: '#fff' }}>总用户 </span>
- <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectUserCount || '0'}</span>
- </div>
- <div style={{
- 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',
- boxShadow: '0px 0.11rem 14px -15px rgba(255,126,74,1)',
- borderRadius: '12px', width: '32%', marginRight: '2%'
- }}>
- <span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
- <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectRegisteredCount || '0'}</span>
- </div>
- <div onClick={() => router.push('/indexEcharts/newUsers')} style={{
- textAlign: 'center', display: 'flex', justifyContent: 'center', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
- boxShadow: '0px 0.11rem 14px -15px rgba(107,130,230,1)',
- borderRadius: '12px', width: '32%',
- }}>
- <span style={{ fontSize: '24px', color: '#fff', borderBottom: '1px solid #fff', margin: '30px 0' }}>最近7天新增 </span>
- <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy', lineHeight: '100px' }}>{data.selectRecentlyCount || '0'}</span>
- </div>
- </div>
- <IndexEcharts style={{ width: '100%' }}></IndexEcharts>
-
- {/* <EchartsTest style={{ width: 500, height: 500 }}></EchartsTest> */}
-
- </>
- )
- }
- export default Welcome;
-
|