调整列表字段和枚举值转换
This commit is contained in:
@@ -1,27 +1,35 @@
|
||||
"use client"
|
||||
import { format } from "date-fns"
|
||||
import { Suspense } from "react"
|
||||
import { getPageBatch } from "@/actions/batch"
|
||||
import { DataTable, useDataTable } from "@/components/data-table"
|
||||
import type { User } from "@/models/user"
|
||||
import type { Batch } from "@/models/batch"
|
||||
|
||||
export default function UserPage() {
|
||||
const table = useDataTable<User>((page, size) => getPageBatch({ page, size }))
|
||||
export default function BatchPage() {
|
||||
const table = useDataTable<Batch>((page, size) =>
|
||||
getPageBatch({ page, size }),
|
||||
)
|
||||
console.log(table, "table")
|
||||
|
||||
return (
|
||||
<Suspense>
|
||||
<DataTable<User>
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<DataTable<Batch>
|
||||
{...table}
|
||||
columns={[
|
||||
{ header: "ID", accessorKey: "id" },
|
||||
{ header: "批次号", accessorKey: "batch_no" },
|
||||
{ header: "城市", accessorKey: "city" },
|
||||
{ header: "省份", accessorKey: "prov" },
|
||||
{ header: "数量", accessorKey: "count" },
|
||||
{ header: "城市", accessorKey: "city" },
|
||||
{ header: "提取IP", accessorKey: "ip" },
|
||||
{ header: "运营商", accessorKey: "isp" },
|
||||
{ header: "可用资源", accessorKey: "resource_id" },
|
||||
{ header: "时间", accessorKey: "time" },
|
||||
{ header: "提取数量", accessorKey: "count" },
|
||||
{ header: "资源数量", accessorKey: "resource_id" },
|
||||
{
|
||||
header: "提取时间",
|
||||
accessorKey: "time",
|
||||
cell: ({ row }) =>
|
||||
format(new Date(row.original.time), "yyyy-MM-dd HH:mm"),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</Suspense>
|
||||
|
||||
Reference in New Issue
Block a user