// Copyright 2026 Arctel.net // SPDX-License-Identifier: Apache-2.0 "use client" import * as React from "react" import {Code, Edit, ListFilter, Plus, Search, Trash2} from "lucide-react" import {Button} from "@/components/ui/button" import {Input} from "@/components/ui/input" import {Table, TableBody, TableCell, TableHead, TableHeader, TableRow} from "@/components/ui/table" import {Badge} from "@/components/ui/badge" import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card" export function TableTab() { const mockTableData = [ { id: "TX-1002", name: "用户信息批量同步导出", type: "数据同步", status: "success", duration: "1.2s", time: "2026-06-15 14:22" }, { id: "TX-1003", name: "系统数据库每周自动备份归档", type: "数据库运维", status: "running", duration: "在执行中", time: "2026-06-15 15:00" }, { id: "TX-1004", name: "远端S3过期缓存对象自动清理任务", type: "磁盘清理", status: "failed", duration: "0.4s", time: "2026-06-15 10:05" }, ] return (
{/* 表格控制工具栏 */}
{/* 数据表格本身 */}
任务编号 执行任务名称 任务类型 状态 执行耗时 触发时间 操作 {mockTableData.map((row) => ( {row.id} {row.name} {row.type} {row.status === "success" && ( 成功 )} {row.status === "running" && ( 运行中 )} {row.status === "failed" && ( 失败 )} {row.duration} {row.time}
))}
{/* 表格规范指引 */} 表格设计规范与代码模板
  • 表格容器必须统一使用带有虚线边框的容器,即类名:border border-dashed shadow-none rounded-lg overflow-hidden bg-background。
  • 表头背景设为 bg-muted/40。表头表项字号统一为小字粗体 text-xs font-semibold。
  • 单元格行与列之间使用虚线分割(border-dashed)。表格行悬浮交互采用温和过渡色 hover:bg-muted/10 transition-colors。
  • 编码、主键或唯一 ID 类字段一律采用等宽字体呈现:font-mono text-xs。
  • 状态标签(Badge)尽量圆角化(rounded-full py-0 px-2),并以浅背景配以各自对应的图标圆点,以实现现代、高对比度的视觉质感。
{`
编号 状态 ID-1001 成功
`}
) }