import { Button } from '@douyinfe/semi-ui-19'; import { IconChart, IconChevronRight, IconClock, IconDownload, IconExport, IconImageAdd, IconPlay, IconScript, IconTask, } from '@lingxi/ui/icons'; import type { ReactNode } from 'react'; import { useNavigate } from 'react-router'; import { useAuthStore } from '@/stores/auth-store'; interface ProductionTask { id: string; name: string; kind: string; progress: number; status: 'running' | 'review' | 'done'; updatedAt: string; } const TASKS: readonly ProductionTask[] = [ { id: 'task-1', name: '夏日防晒 · 图片合成批次', kind: '图片合成', progress: 68, status: 'running', updatedAt: '12 分钟前', }, { id: 'task-2', name: '通勤穿搭 · 视频逐镜生成', kind: '视频生产', progress: 42, status: 'running', updatedAt: '26 分钟前', }, { id: 'task-3', name: '会员日 · 脚本批量生成', kind: '脚本', progress: 100, status: 'review', updatedAt: '1 小时前', }, { id: 'task-4', name: '春季新品 · 快筛候选集', kind: '快筛', progress: 100, status: 'done', updatedAt: '今天 10:24', }, ]; const STATUS_LABEL: Record = { running: '进行中', review: '待审核', done: '已完成', }; const QUICK_ACTIONS = [ { key: 'script', label: '新建脚本', hint: '从要素卡开始', path: '/scripts/batch', icon: IconScript, }, { key: 'image', label: '图片合成', hint: 'PSD 套版与抠图', path: '/material/image-compose', icon: IconImageAdd, }, { key: 'video', label: '视频生产', hint: '逐镜生成成片', path: '/material/video', icon: IconPlay, }, { key: 'export', label: '导出素材', hint: '勾选后导出并归档', path: '/delivery/export', icon: IconExport, }, ] as const; const RECENT_ASSETS = [ { id: 'a1', name: '防晒喷雾 · 主图 01', spec: '1080 × 1920', tone: 1 }, { id: 'a2', name: '通勤穿搭 · 封面', spec: '1080 × 1920', tone: 2 }, { id: 'a3', name: '会员日 · 利益点', spec: '1080 × 1920', tone: 3 }, { id: 'a4', name: '春季新品 · 场景 A', spec: '1080 × 1920', tone: 4 }, { id: 'a5', name: '防晒喷雾 · 细节', spec: '1080 × 1080', tone: 5 }, { id: 'a6', name: '通勤穿搭 · 结尾卡', spec: '1080 × 1920', tone: 6 }, ] as const; function HomeHero({ userName }: { userName: string }): ReactNode { const navigate = useNavigate(); return (

工作台

{userName},欢迎回来

); } const METRICS = [ { key: 'output', label: '今日产出', value: '128', unit: '条', foot: '较昨日 +12.4%', trend: '+12.4%', icon: IconChart, }, { key: 'running', label: '进行中任务', value: '6', unit: '个', foot: '2 个排队中 · 预计 4:12 完成', trend: '', icon: IconTask, }, { key: 'review', label: '待审核', value: '24', unit: '条', foot: '8 条已超 2 小时', trend: '', icon: IconClock, }, { key: 'export', label: '本周导出', value: '512', unit: '条', foot: '较上周 +8.1%', trend: '+8.1%', icon: IconDownload, }, ] as const; function HomeMetrics(): ReactNode { return (
{METRICS.map((metric) => { const Icon = metric.icon; return (
{metric.label}

{metric.value} {metric.unit}

{metric.trend === '' ? ( metric.foot ) : ( {metric.trend} )} {metric.trend === '' ? null : ` · ${metric.foot}`}

); })}
); } function TaskRow({ task }: { task: ProductionTask }): ReactNode { return (
{task.name} {task.kind} {STATUS_LABEL[task.status]} {task.updatedAt}
); } function TaskPanel(): ReactNode { const navigate = useNavigate(); return (

生产任务

按最近更新时间排序

任务 类型 进度 状态 更新时间
{TASKS.map((task) => ( ))}
); } function QuickPanel(): ReactNode { const navigate = useNavigate(); return ( ); } function RecentAssetsPanel(): ReactNode { const navigate = useNavigate(); return (

最近素材

今天产出的图片与视频封面

{RECENT_ASSETS.map((asset) => ( ))}
); } export default function HomePage(): ReactNode { const user = useAuthStore((state) => state.user); return (
); }