Skip to content

Commit

Permalink
主页组件更新和图标对齐调整
Browse files Browse the repository at this point in the history
- 调整了主页面的布局和图标,以提升用户界面的一致性和清晰度。
- 更新了统计信息的展示方式,以提供更直观的项目概览。
- 移除了未使用的图标导入,以清理代码库。
- 改进了描述的显示,使用可折叠的段落来优化内容的可读性。
- 调整了卡片组件的间距和样式,以增强视觉效果和响应性。
  • Loading branch information
www.zerocode.net.cn committed Sep 17, 2024
1 parent 9f3ea51 commit b6e164f
Showing 1 changed file with 43 additions and 8 deletions.
51 changes: 43 additions & 8 deletions src/pages/home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {FC} from 'react';
import {Avatar, Card, Col, List, Skeleton, Row, Statistic, Tag, Space, Typography, Progress} from 'antd';
import {Radar, Pie} from '@ant-design/charts';
import { RocketOutlined, BarChartOutlined, ProjectOutlined, GlobalOutlined, NotificationOutlined, CompassOutlined, PieChartOutlined, PlusOutlined, ImportOutlined, HistoryOutlined, BookOutlined, BranchesOutlined, ExportOutlined, SafetyOutlined, ReadOutlined, CustomerServiceOutlined, CrownOutlined, DatabaseOutlined } from '@ant-design/icons';
import { RocketOutlined, BarChartOutlined, ProjectOutlined, GlobalOutlined, NotificationOutlined, CompassOutlined, PieChartOutlined, PlusOutlined, ImportOutlined, HistoryOutlined, BookOutlined, BranchesOutlined, ExportOutlined, SafetyOutlined, ReadOutlined, CustomerServiceOutlined, CrownOutlined, DatabaseOutlined, TeamOutlined, UserOutlined } from '@ant-design/icons';

import moment from 'moment';
import EditableLinkGroup from './components/EditableLinkGroup';
Expand All @@ -16,7 +16,6 @@ import {PageContainer} from "@ant-design/pro-components";
import {VipOne} from "@icon-park/react";
import * as cache from "@/utils/cache";
import Line from "antd/es/progress/Line";
import {TeamOutlined, UserOutlined} from "@ant-design/icons";

const { Title, Text, Paragraph } = Typography;

Expand Down Expand Up @@ -256,7 +255,7 @@ const Home: React.FC<HomeProps> = (props) => {
</Row>
}
>
<Row gutter={24}>
<Row gutter={16}>
<Col xl={16} lg={24} md={24} sm={24} xs={24}>
<Card
className={styles.projectList}
Expand All @@ -268,7 +267,7 @@ const Home: React.FC<HomeProps> = (props) => {
</Space>
}
bordered={false}
extra={<Link to="/project/recent">查看全部</Link>}
extra={<Link to="/dataModels">查看全部</Link>}
loading={projectLoading}
bodyStyle={{padding: 0}}
>
Expand All @@ -286,7 +285,11 @@ const Home: React.FC<HomeProps> = (props) => {
<Text strong>{item.projectName}</Text>
</div>
}
description={item.description || '无描述'}
description={
<Typography.Paragraph type='secondary' ellipsis={{ rows: 2, expandable: false, symbol: '...' }}>
{item.description || '无描述'}
</Typography.Paragraph>
}
/>
<div className={styles.projectItemContent}>
{item.updateTime && (
Expand Down Expand Up @@ -324,7 +327,7 @@ const Home: React.FC<HomeProps> = (props) => {
</Col>
<Col xl={8} lg={24} md={24} sm={24} xs={24}>
<Card
style={{marginBottom: 24}}
style={{marginBottom: 16}}
title={
<Space>
<CompassOutlined />
Expand All @@ -341,12 +344,44 @@ const Home: React.FC<HomeProps> = (props) => {
title={
<Space>
<PieChartOutlined />
<Title level={4}>项目分析</Title>
<Title level={4}>项目概览</Title>
</Space>
}
bodyStyle={{padding: 16}}
>
<Pie {...config} />
<Row gutter={[8, 16]}>
<Col span={12}>
<Statistic
title="个人项目"
value={statisticInfo.personTotal}
prefix={<UserOutlined />}
valueStyle={{ color: '#1890ff' }}
/>
</Col>
<Col span={12}>
<Statistic
title="团队项目"
value={statisticInfo.groupTotal}
prefix={<TeamOutlined />}
valueStyle={{ color: '#52c41a' }}
/>
</Col>
<Col span={18}>
<Progress
percent={statisticInfo.personTotal / (statisticInfo.personTotal + statisticInfo.groupTotal) * 100}
strokeColor={{
'0%': '#1890ff',
'100%': '#52c41a',
}}
format={(percent) => `${percent?.toFixed(1)}% 个人项目`}
/>
</Col>
<Col span={24}>
<Text type="secondary">
总项目数: {statisticInfo.personTotal + statisticInfo.groupTotal}
</Text>
</Col>
</Row>
</Card>
</Col>
</Row>
Expand Down

0 comments on commit b6e164f

Please sign in to comment.