From 0789462a8d71c0417610010dc40fbc22f8395eab Mon Sep 17 00:00:00 2001 From: luorijun Date: Tue, 7 Apr 2026 17:06:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E5=A2=9E=E5=8A=A0=E5=BA=8F?= =?UTF-8?q?=E5=8F=B7=E5=88=97=EF=BC=8C=E7=A7=BB=E9=99=A4=20id=20=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(root)/batch/page.tsx | 1 - src/app/(root)/billing/page.tsx | 1 - src/app/(root)/channel/page.tsx | 1 - src/app/(root)/coupon/page.tsx | 1 - src/app/(root)/cust/page.tsx | 1 - src/app/(root)/resources/page.tsx | 1 - src/app/(root)/trade/page.tsx | 1 - src/app/(root)/user/page.tsx | 1 - src/components/data-table/component.tsx | 10 +++++++++- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/app/(root)/batch/page.tsx b/src/app/(root)/batch/page.tsx index ffe789c..0fde74a 100644 --- a/src/app/(root)/batch/page.tsx +++ b/src/app/(root)/batch/page.tsx @@ -250,7 +250,6 @@ export default function BatchPage() { {...table} columns={[ - { header: "ID", accessorKey: "id" }, { header: "会员号", accessorFn: row => row.user?.phone || "-", diff --git a/src/app/(root)/billing/page.tsx b/src/app/(root)/billing/page.tsx index df23de3..4eef580 100644 --- a/src/app/(root)/billing/page.tsx +++ b/src/app/(root)/billing/page.tsx @@ -328,7 +328,6 @@ export default function BillingPage() { {...table} columns={[ - { header: "ID", accessorKey: "id" }, { header: "会员号", accessorFn: row => row.user?.phone || "-" }, { header: "套餐号", accessorKey: "resource.resource_no" }, { diff --git a/src/app/(root)/channel/page.tsx b/src/app/(root)/channel/page.tsx index 845edf6..086b83e 100644 --- a/src/app/(root)/channel/page.tsx +++ b/src/app/(root)/channel/page.tsx @@ -238,7 +238,6 @@ export default function ChannelPage() { {...table} columns={[ - { header: "ID", accessorKey: "id" }, { header: "会员号", accessorFn: row => row.user?.phone || "-", diff --git a/src/app/(root)/coupon/page.tsx b/src/app/(root)/coupon/page.tsx index 1287010..d02f894 100644 --- a/src/app/(root)/coupon/page.tsx +++ b/src/app/(root)/coupon/page.tsx @@ -35,7 +35,6 @@ export default function CouponPage() { {...table} columns={[ - { header: "ID", accessorKey: "id" }, { header: "所属用户", accessorKey: "user_id" }, { header: "代码", accessorKey: "code" }, { header: "备注", accessorKey: "remark" }, diff --git a/src/app/(root)/cust/page.tsx b/src/app/(root)/cust/page.tsx index 50e60d6..859acb5 100644 --- a/src/app/(root)/cust/page.tsx +++ b/src/app/(root)/cust/page.tsx @@ -234,7 +234,6 @@ export default function UserPage() { {...table} columns={[ - { header: "ID", accessorKey: "id" }, { header: "账号", accessorKey: "username" }, { header: "手机", accessorKey: "phone" }, { header: "邮箱", accessorKey: "email" }, diff --git a/src/app/(root)/resources/page.tsx b/src/app/(root)/resources/page.tsx index 3f9d23c..d69ba8a 100644 --- a/src/app/(root)/resources/page.tsx +++ b/src/app/(root)/resources/page.tsx @@ -281,7 +281,6 @@ function ResourceList({ resourceType }: ResourceListProps) { const columns = useMemo( () => [ - { header: "ID", accessorKey: "id" }, { header: "会员号", accessorFn: (row: Resources) => row.user?.phone || "-", diff --git a/src/app/(root)/trade/page.tsx b/src/app/(root)/trade/page.tsx index 46bad90..4881f31 100644 --- a/src/app/(root)/trade/page.tsx +++ b/src/app/(root)/trade/page.tsx @@ -258,7 +258,6 @@ export default function TradePage() { {...table} columns={[ - { header: "ID", accessorKey: "id" }, { header: "会员号", accessorFn: row => row.user?.phone || "-", diff --git a/src/app/(root)/user/page.tsx b/src/app/(root)/user/page.tsx index 2df0c76..5569628 100644 --- a/src/app/(root)/user/page.tsx +++ b/src/app/(root)/user/page.tsx @@ -150,7 +150,6 @@ export default function UserPage() { data={userList || []} status={loading ? "load" : "done"} columns={[ - { header: "ID", accessorKey: "id" }, { header: "账号", accessorKey: "username" }, { header: "手机", accessorKey: "phone" }, { header: "邮箱", accessorKey: "email" }, diff --git a/src/components/data-table/component.tsx b/src/components/data-table/component.tsx index cd5e8bb..a775744 100644 --- a/src/components/data-table/component.tsx +++ b/src/components/data-table/component.tsx @@ -29,6 +29,7 @@ export type DataTableProps = { headRow?: string dataRow?: string } + serial?: boolean } export function DataTable>( @@ -36,7 +37,14 @@ export function DataTable>( ) { const table = useReactTable({ data: props.data, - columns: props.columns, + columns: [ + { + id: "serial", + header: "#", + cell: ({ row }) => row.index + 1, + }, + ...props.columns, + ], getCoreRowModel: getCoreRowModel(), manualPagination: true, rowCount: props.pagination?.total,