fix welcome layout

mgy
Dawn1Ocean 2024-04-07 13:19:01 +08:00
parent 0604a3dfbf
commit 2731f5560f
1 changed files with 4 additions and 4 deletions

View File

@ -1,9 +1,9 @@
import type { TinyRingConfig } from '@ant-design/charts';
import { Tiny } from '@ant-design/charts'; import { Tiny } from '@ant-design/charts';
import { PageContainer, ProCard, StatisticCard } from '@ant-design/pro-components'; import { PageContainer, ProCard, StatisticCard } from '@ant-design/pro-components';
import { Card, Statistic } from 'antd'; import { Card, Statistic } from 'antd';
import RcResizeObserver from 'rc-resize-observer'; import RcResizeObserver from 'rc-resize-observer';
import { useState } from 'react'; import { useState } from 'react';
import type { TinyRingConfig } from '@ant-design/charts';
const percentRing = (percent: number, frontColor: string): React.JSX.Element => { const percentRing = (percent: number, frontColor: string): React.JSX.Element => {
const TinyRing = Tiny.Ring as (props: TinyRingConfig) => JSX.Element; const TinyRing = Tiny.Ring as (props: TinyRingConfig) => JSX.Element;
@ -52,7 +52,7 @@ const Logs: React.FC = () => {
const [responsive, setResponsive] = useState(false); const [responsive, setResponsive] = useState(false);
return ( return (
<PageContainer> <PageContainer>
<Card style={{color: '#f5f5f5'}}> <Card style={{ color: '#f5f5f5' }}>
<RcResizeObserver <RcResizeObserver
key="resize-observer" key="resize-observer"
onResize={(offset) => { onResize={(offset) => {
@ -83,7 +83,7 @@ const Logs: React.FC = () => {
<ProCard> <ProCard>
<StatisticCard.Group direction={responsive ? 'row' : 'column'}> <StatisticCard.Group direction={responsive ? 'row' : 'column'}>
<StatisticCard <StatisticCard
hoverable hoverable
chart={percentRing( chart={percentRing(
Math.round(((indexData.oreo / indexData.totalPT) * 1000) / 10), Math.round(((indexData.oreo / indexData.totalPT) * 1000) / 10),
'#00CC66', '#00CC66',
@ -96,7 +96,7 @@ const Logs: React.FC = () => {
chartPlacement="left" chartPlacement="left"
/> />
<StatisticCard <StatisticCard
hoverable hoverable
style={{ marginTop: '3vh' }} style={{ marginTop: '3vh' }}
chart={percentRing( chart={percentRing(
Math.round((indexData.allSuccess / indexData.all) * 1000) / 10, Math.round((indexData.allSuccess / indexData.all) * 1000) / 10,