feat: 列名支持展示更新时间

This commit is contained in:
richarjiang
2026-06-07 16:29:16 +08:00
parent 588b6fbc77
commit 1e1e774c4c
2 changed files with 12 additions and 2 deletions

View File

@@ -6,9 +6,9 @@ import { Pencil, Trash2 } from 'lucide-react'
import Image from 'next/image'
// 列宽定义header 和 row 必须保持一致。用 grid-template-columns 统一控制。
// 序号 | 图片 | 答案 | 谐音梗 | 提示 | 创建时间 | 评分 | 操作
// 序号 | 图片 | 答案 | 谐音梗 | 提示 | 创建时间 | 更新时间 | 评分 | 操作
export const GRID_TEMPLATE =
'minmax(60px,60px) minmax(120px,120px) minmax(80px,1fr) minmax(100px,1fr) minmax(160px,2fr) minmax(100px,100px) minmax(110px,110px) minmax(100px,100px)'
'minmax(60px,60px) minmax(120px,120px) minmax(80px,1fr) minmax(100px,1fr) minmax(160px,2fr) minmax(110px,110px) minmax(110px,110px) minmax(110px,110px) minmax(100px,100px)'
interface LevelRowProps {
level: Level
@@ -91,6 +91,15 @@ export function LevelRow({ level, index, onEdit, onDelete }: LevelRowProps) {
})}
</span>
{/* 更新时间 */}
<span className="text-muted-foreground whitespace-nowrap">
{new Date(level.updatedAt).toLocaleDateString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
})}
</span>
{/* 评分 */}
<span className="text-xs text-muted-foreground whitespace-nowrap">
{level.difficultyScore != null || level.funScore != null

View File

@@ -19,6 +19,7 @@ const HEADER_COLUMNS = [
'谐音梗',
'提示',
'创建时间',
'更新时间',
'评分',
'操作',
]