From fe7b58cb6dc426409aa1029e6dc58f2ab4305c77 Mon Sep 17 00:00:00 2001 From: Shu Guang <61069967+shuguangnet@users.noreply.github.com> Date: Sat, 19 Apr 2025 02:09:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=BA=E5=9D=9B=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Footer/index.tsx | 11 +- src/pages/Forum/List/index.less | 62 +++++++++++ src/pages/Forum/List/index.tsx | 143 ++++++++++++++++++++---- src/pages/Forum/Publish/index.less | 44 ++++++++ src/pages/Forum/Publish/index.tsx | 167 +++++++++++++++++++---------- 5 files changed, 345 insertions(+), 82 deletions(-) create mode 100644 src/pages/Forum/List/index.less create mode 100644 src/pages/Forum/Publish/index.less diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx index 83e069d..1a00c86 100644 --- a/src/components/Footer/index.tsx +++ b/src/components/Footer/index.tsx @@ -1,4 +1,4 @@ -import { GithubOutlined, HeartFilled, WechatOutlined, MailOutlined } from '@ant-design/icons'; +import { HeartFilled } from '@ant-design/icons'; import { DefaultFooter } from '@ant-design/pro-components'; import React from 'react'; @@ -16,7 +16,7 @@ const Footer: React.FC = () => { copyright={
- Copyright © 2023-{currentYear} 陕西科技大学镐京学院 + Copyright © {currentYear} 陕西科技大学镐京学院
Powered by SunHe @@ -31,12 +31,7 @@ const Footer: React.FC = () => { href: 'https://www.sust.edu.cn/', blankTarget: true, }, - { - key: 'github', - title: , - href: 'https://github.com/shuguangnet', - blankTarget: true, - }, + ]} /> diff --git a/src/pages/Forum/List/index.less b/src/pages/Forum/List/index.less new file mode 100644 index 0000000..b32dcba --- /dev/null +++ b/src/pages/Forum/List/index.less @@ -0,0 +1,62 @@ +.forumContainer { + .searchBar { + background: #fff; + padding: 16px; + border-radius: 8px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); + margin-bottom: 16px; + } + + .postItem { + transition: all 0.3s; + + &:hover { + background-color: #fafafa; + } + + .postTitle { + font-size: 18px; + font-weight: 500; + color: #1a1a1a; + + &:hover { + color: #1890ff; + } + } + + .postMeta { + color: #8c8c8c; + font-size: 14px; + } + + .postStats { + color: #595959; + font-size: 14px; + + .statItem { + display: inline-flex; + align-items: center; + gap: 4px; + + &:hover { + color: #1890ff; + } + } + } + + .coverImage { + border-radius: 8px; + object-fit: cover; + transition: transform 0.3s; + + &:hover { + transform: scale(1.02); + } + } + } + + .categoryTag { + border-radius: 12px; + padding: 2px 12px; + } +} \ No newline at end of file diff --git a/src/pages/Forum/List/index.tsx b/src/pages/Forum/List/index.tsx index 04a9c45..594e49a 100644 --- a/src/pages/Forum/List/index.tsx +++ b/src/pages/Forum/List/index.tsx @@ -1,7 +1,14 @@ import React, { useState } from 'react'; -import { Card, List, Tag, Space, Input, Button, Select } from 'antd'; +import { Card, List, Tag, Space, Input, Button, Select, Badge } from 'antd'; import { history } from '@umijs/max'; -import { SearchOutlined, PlusOutlined } from '@ant-design/icons'; +import { + SearchOutlined, + PlusOutlined, + EyeOutlined, + MessageOutlined, + LikeOutlined, +} from '@ant-design/icons'; +import styles from './index.less'; const { Search } = Input; @@ -9,6 +16,74 @@ const ForumList: React.FC = () => { const [loading, setLoading] = useState(false); const [filter, setFilter] = useState('all'); + const mockPosts = [ + { + id: 1, + title: '使用 GPT-4 进行高级数据分析的实践经验', + category: '技术讨论', + author: '数据专家', + createTime: '2024-01-15 14:30', + description: '分享在大规模数据集上使用 GPT-4 进行智能分析的经验,包括提示词工程、数据预处理技巧,以及如何提高分析准确率...', + views: 2150, + comments: 156, + likes: 342, + isTop: true, + cover: 'https://picsum.photos/272/153', + }, + { + id: 2, + title: 'AI 辅助数据可视化最佳实践', + category: '经验分享', + author: '可视化工程师', + createTime: '2024-01-14 16:20', + description: '探讨如何利用 AI 技术自动生成数据可视化方案,包括图表类型选择、配色方案优化、以及交互设计的智能推荐...', + views: 1856, + comments: 89, + likes: 267, + isTop: false, + cover: 'https://picsum.photos/272/153?random=2', + }, + { + id: 3, + title: '智能预测模型准确率问题求助', + category: '问题求助', + author: '数据新手', + createTime: '2024-01-13 09:45', + description: '在使用系统进行销售预测时发现准确率不够理想,数据预处理已经做了基础清洗,请问还有哪些方面需要优化?...', + views: 632, + comments: 42, + likes: 28, + isTop: false, + cover: null, + }, + { + id: 4, + title: 'AIGC 在金融数据分析中的应用实践', + category: '技术讨论', + author: '金融分析师', + createTime: '2024-01-12 11:30', + description: '分享我们团队使用 AIGC 技术进行金融市场分析的经验,包括风险评估、趋势预测和投资建议生成的完整流程...', + views: 1967, + comments: 156, + likes: 420, + isTop: true, + cover: 'https://picsum.photos/272/153?random=4', + }, + { + id: 5, + title: '大规模数据集的智能分析方法论', + category: '经验分享', + author: '资深数据科学家', + createTime: '2024-01-11 15:15', + description: '详细介绍如何处理和分析大规模数据集,包括数据清洗策略、特征工程技巧、模型选择以及结果验证方法...', + views: 2543, + comments: 189, + likes: 534, + isTop: false, + cover: 'https://picsum.photos/272/153?random=5', + }, + ]; + const categories = [ { value: 'all', label: '全部' }, { value: 'tech', label: '技术讨论' }, @@ -21,51 +96,67 @@ const ForumList: React.FC = () => { }; return ( - -
- +
+ + - - - - - - - -