|
|
|
|
@ -17,6 +17,7 @@ import IconComments from './assets/comments.svg';
|
|
|
|
|
import IconContent from './assets/content.svg';
|
|
|
|
|
import IconIncrease from './assets/increase.svg';
|
|
|
|
|
import HeatMap from '@/components/Chart/heat-map';
|
|
|
|
|
import { getOverviewHome } from '@/api/overview';
|
|
|
|
|
|
|
|
|
|
const { Row, Col } = Grid;
|
|
|
|
|
|
|
|
|
|
@ -47,10 +48,10 @@ function StatisticItem(props: StatisticItemType) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type DataType = {
|
|
|
|
|
allContents?: string;
|
|
|
|
|
liveContents?: string;
|
|
|
|
|
increaseComments?: string;
|
|
|
|
|
growthRate?: string;
|
|
|
|
|
sceneNum?: string | number;
|
|
|
|
|
compNum?: string | number;
|
|
|
|
|
appNum?: string | number;
|
|
|
|
|
instanceNum?: string | number;
|
|
|
|
|
chartData?: { count?: number; date?: string }[];
|
|
|
|
|
down?: boolean;
|
|
|
|
|
};
|
|
|
|
|
@ -62,16 +63,11 @@ function Overview() {
|
|
|
|
|
|
|
|
|
|
const userInfo = useSelector((state: any) => state.userInfo || {});
|
|
|
|
|
|
|
|
|
|
const fetchData = () => {
|
|
|
|
|
const fetchData = async () => {
|
|
|
|
|
setLoading(true);
|
|
|
|
|
axios
|
|
|
|
|
.get('/api/workplace/overview-content')
|
|
|
|
|
.then((res) => {
|
|
|
|
|
setData(res as any);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
setLoading(false);
|
|
|
|
|
});
|
|
|
|
|
const res: any = await getOverviewHome();
|
|
|
|
|
if (res.code === 200) setData(res.data);
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
@ -90,7 +86,7 @@ function Overview() {
|
|
|
|
|
<StatisticItem
|
|
|
|
|
icon={<IconCalendar />}
|
|
|
|
|
title="工程数量"
|
|
|
|
|
count={data.allContents}
|
|
|
|
|
count={data.sceneNum}
|
|
|
|
|
loading={loading}
|
|
|
|
|
unit={t['workplace.pecs']}
|
|
|
|
|
/>
|
|
|
|
|
@ -100,7 +96,7 @@ function Overview() {
|
|
|
|
|
<StatisticItem
|
|
|
|
|
icon={<IconContent />}
|
|
|
|
|
title="组件数量"
|
|
|
|
|
count={data.liveContents}
|
|
|
|
|
count={data.compNum}
|
|
|
|
|
loading={loading}
|
|
|
|
|
unit={t['workplace.pecs']}
|
|
|
|
|
/>
|
|
|
|
|
@ -110,7 +106,7 @@ function Overview() {
|
|
|
|
|
<StatisticItem
|
|
|
|
|
icon={<IconComments />}
|
|
|
|
|
title="应用数量"
|
|
|
|
|
count={data.increaseComments}
|
|
|
|
|
count={data.appNum}
|
|
|
|
|
loading={loading}
|
|
|
|
|
unit={t['workplace.pecs']}
|
|
|
|
|
/>
|
|
|
|
|
@ -120,7 +116,7 @@ function Overview() {
|
|
|
|
|
<StatisticItem
|
|
|
|
|
icon={<IconIncrease />}
|
|
|
|
|
title="应用实例数量"
|
|
|
|
|
count={data.growthRate}
|
|
|
|
|
count={data.instanceNum}
|
|
|
|
|
loading={loading}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
|