修复动静态ip标题跳转问题 & 添加admin页面
This commit is contained in:
@@ -27,14 +27,12 @@ export type DataTableProps<T> = {
|
||||
headRow?: string
|
||||
dataRow?: string
|
||||
}
|
||||
/** 是否开启行选择复选框 */
|
||||
enableSelection?: boolean
|
||||
/** 受控选中状态 */
|
||||
rowSelection?: Record<string, boolean>
|
||||
/** 选中状态变化回调 */
|
||||
onSelectionChange?: (selection: Record<string, boolean>) => void
|
||||
/** 行唯一ID生成函数 */
|
||||
getRowId?: (row: T, index: number) => string
|
||||
stickyHeader?: boolean
|
||||
maxHeight?: string
|
||||
}
|
||||
|
||||
export default function DataTable<T extends Record<string, unknown>>(
|
||||
@@ -112,8 +110,18 @@ export default function DataTable<T extends Record<string, unknown>>(
|
||||
<>
|
||||
{/* 数据表 */}
|
||||
<div className="rounded-md relative bg-card">
|
||||
<TableRoot>
|
||||
<TableHeader>
|
||||
<TableRoot
|
||||
containerClassName={
|
||||
props.stickyHeader
|
||||
? cn("overflow-y-auto", props.maxHeight ?? "max-h-[600px]")
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<TableHeader
|
||||
className={
|
||||
props.stickyHeader ? "sticky top-0 z-10 bg-card" : undefined
|
||||
}
|
||||
>
|
||||
{table.getHeaderGroups().map(group => (
|
||||
<TableRow key={group.id} className={props.classNames?.headRow}>
|
||||
{group.headers.map(header => (
|
||||
|
||||
Reference in New Issue
Block a user