import { useEffect, useMemo, useState } from "react"; import { AudioOutlined, ArrowRightOutlined, CustomerServiceOutlined, PlayCircleOutlined, RadarChartOutlined, SoundOutlined, VideoCameraAddOutlined } from "@ant-design/icons"; import { Button, Empty, Skeleton, Tag, Typography } from "antd"; import { useNavigate } from "react-router-dom"; import dayjs from "dayjs"; import { getRecentTasks } from "@/api/business/dashboard"; import type { MeetingVO } from "@/api/business/meeting"; import "./index.less"; const { Text, Title } = Typography; type QuickEntry = { title: string; badge: string; icon: React.ReactNode; description: string[]; accent: string; onClick: () => void; }; type RecentCard = { id: number | string; title: string; duration: string; time: string; tags: string[]; }; const fallbackRecentCards: RecentCard[] = [ { id: "sample-1", title: "2026-03-25 16:05 记录", duration: "01:10", time: "今天 16:05", tags: ["发言人", "降噪", "速度", "模仿", "暂停"] }, { id: "sample-2", title: "【示例】开会用通义听悟,高效又省心", duration: "02:14", time: "2026-03-24 11:04", tags: ["会议日程", "笔记", "发言人", "协同", "纪要"] }, { id: "sample-3", title: "【示例】上课用通义听悟,学习效率 UPUP", duration: "02:01", time: "2026-03-23 11:04", tags: ["转写", "笔记", "学习", "教学音频", "课程音频"] } ]; function buildRecentCards(tasks: MeetingVO[]): RecentCard[] { if (!tasks.length) { return fallbackRecentCards; } return tasks.slice(0, 3).map((task, index) => ({ id: task.id, title: task.title, duration: `0${index + 1}:${10 + index * 12}`, time: dayjs(task.meetingTime || task.createdAt).format("YYYY-MM-DD HH:mm"), tags: task.tags?.split(",").filter(Boolean).slice(0, 5) || ["转写", "总结", "纪要"] })); } export default function HomePage() { const navigate = useNavigate(); const [recentTasks, setRecentTasks] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { const fetchRecentTasks = async () => { try { const response = await getRecentTasks(); setRecentTasks(response.data.data || []); } catch (error) { console.error("Home recent tasks load failed", error); } finally { setLoading(false); } }; void fetchRecentTasks(); }, []); const quickEntries = useMemo( () => [ { title: "开启实时会议", badge: "实时协作", icon: , description: ["边开会边转写,自动沉淀结构化纪要", "适合讨论会、评审会、客户沟通"], accent: "violet", onClick: () => navigate("/meeting-live-create") }, { title: "上传音频", badge: "离线整理", icon: , description: ["上传录音文件,区分发言人并整理内容", "适合访谈录音、培训音频、课程复盘"], accent: "cyan", onClick: () => navigate("/meeting-create") } ], [navigate] ); const recentCards = useMemo(() => buildRecentCards(recentTasks), [recentTasks]); return (
iMeeting 智能首页
每一次交流 <span> 都有迹可循</span>
支持实时记录、上传转写、纪要整理
两种入口,覆盖实时会议和离线录音
{quickEntries.map((entry) => (
{ if (event.key === "Enter" || event.key === " ") { event.preventDefault(); entry.onClick(); } }} >
))}
最近
{loading ? (
{Array.from({ length: 3 }).map((_, index) => (
))}
) : recentCards.length ? (
{recentCards.map((card, index) => (
typeof card.id === "number" && navigate(`/meetings/${card.id}`)} >
))}
) : (
)}
); }