获取大盘统计数据
This commit is contained in:
parent
dbb6be176d
commit
8efa4eed57
@ -31,3 +31,10 @@ export function getLayerPoints( params ) {
|
|||||||
params: params
|
params: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取大盘统计数据
|
||||||
|
export function getDashboardData() {
|
||||||
|
return request('/api/dashboard/getDashboardData', {
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Layout, Row, Col, Select } from 'antd';
|
import { Layout, Row, Col, Select } from 'antd';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import styles from './Guide.less';
|
import styles from './Guide.less';
|
||||||
|
import { getDashboardData } from '../../api';
|
||||||
|
|
||||||
import { GaodeMap ,Scene } from '@antv/l7';
|
import { GaodeMap ,Scene } from '@antv/l7';
|
||||||
import { Choropleth } from '@antv/l7plot';
|
import { Choropleth } from '@antv/l7plot';
|
||||||
@ -14,7 +15,11 @@ interface Props {
|
|||||||
// 脚手架示例组件
|
// 脚手架示例组件
|
||||||
const Guide: React.FC<Props> = (props) => {
|
const Guide: React.FC<Props> = (props) => {
|
||||||
const { name } = props;
|
const { name } = props;
|
||||||
useEffect(() => {
|
const [registerDays, setRegisterDays] = useState(0);
|
||||||
|
const [createLayerCount, setCreateLayerCount] = useState(0);
|
||||||
|
const [createPointCount, setCreatePointCount] = useState(0);
|
||||||
|
|
||||||
|
useEffect(() => {debugger
|
||||||
const scene = new Scene({
|
const scene = new Scene({
|
||||||
id: 'map',
|
id: 'map',
|
||||||
map: new GaodeMap({
|
map: new GaodeMap({
|
||||||
@ -25,7 +30,6 @@ const Guide: React.FC<Props> = (props) => {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
scene.on('loaded', () => {
|
scene.on('loaded', () => {
|
||||||
const areadata = areaList;
|
|
||||||
const data = areaList
|
const data = areaList
|
||||||
// .filter(({ level, parent }) => level === 'city' && parent === 330000)
|
// .filter(({ level, parent }) => level === 'city' && parent === 330000)
|
||||||
.map((item) => ({ ...item, value: Math.random() * 5000 }));
|
.map((item) => ({ ...item, value: Math.random() * 5000 }));
|
||||||
@ -86,6 +90,15 @@ const Guide: React.FC<Props> = (props) => {
|
|||||||
|
|
||||||
choropleth.addToScene(scene);
|
choropleth.addToScene(scene);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//大盘统计数据
|
||||||
|
getDashboardData().then((e) => {
|
||||||
|
const data = e.data || {};
|
||||||
|
data.registerDays && setRegisterDays(data.registerDays);
|
||||||
|
data.createLayerCount && setCreateLayerCount(data.createLayerCount);
|
||||||
|
data.createPointCount && setCreatePointCount(data.createPointCount);
|
||||||
|
});
|
||||||
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
let onLayerSelectChange = (e:any) => {
|
let onLayerSelectChange = (e:any) => {
|
||||||
@ -102,9 +115,9 @@ const Guide: React.FC<Props> = (props) => {
|
|||||||
|
|
||||||
{/* 顶部信息 */}
|
{/* 顶部信息 */}
|
||||||
<div className={styles.homepageMsg}>
|
<div className={styles.homepageMsg}>
|
||||||
<div className={styles.homepageMsgItem}>您已注册<span className={styles.homepageMsgItemSpan}>125</span>天</div>
|
<div className={styles.homepageMsgItem}>您已注册<span className={styles.homepageMsgItemSpan}>{registerDays}</span>天</div>
|
||||||
<div className={styles.homepageMsgItem}>已创建图层项目<span className={styles.homepageMsgItemSpan}>125</span>个</div>
|
<div className={styles.homepageMsgItem}>已创建图层数目<span className={styles.homepageMsgItemSpan}>{createLayerCount}</span>个</div>
|
||||||
<div className={styles.homepageMsgItem}>已创建点位项目<span className={styles.homepageMsgItemSpan}>125</span>个</div>
|
<div className={styles.homepageMsgItem}>已创建点位数目<span className={styles.homepageMsgItemSpan}>{createPointCount}</span>个</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 下拉框 全国自定义点位数目图 */}
|
{/* 下拉框 全国自定义点位数目图 */}
|
||||||
|
Loading…
Reference in New Issue
Block a user