feat: 修改代码结构

This commit is contained in:
2025-08-15 03:22:14 -07:00
parent 77e246198f
commit 5524d25d9a
24 changed files with 128 additions and 77 deletions
@@ -35,7 +35,7 @@ export function ColumnFilter<TData>({ table, params, filters }: ColumnFilterProp
return (
<Combobox
key={param.key}
className='w-32'
className='w-24'
placeholder={param.placeholder || 'Choose...'}
value={filters[param.key] || ''}
onChange={(value) => {
@@ -48,7 +48,7 @@ export function ColumnFilter<TData>({ table, params, filters }: ColumnFilterProp
return (
<Input
key={param.key}
className='w-16 rounded-[20px] text-xs shadow-[inset_0_0_7.6px_0_#00000040] sm:w-64 sm:text-xl'
className='w-36 rounded-[20px] text-xs shadow-[inset_0_0_7.6px_0_#00000040] sm:w-64 sm:text-xl'
placeholder={param.placeholder || 'Search...'}
value={filters[param.key] || ''}
onChange={(event) => updateFilter(param.key, event.target.value)}
@@ -134,13 +134,22 @@ export function ProList<TData, TValue extends Record<string, unknown>>({
return (
<div className='flex max-w-full flex-col gap-2 sm:gap-4'>
<div className='flex flex-wrap-reverse items-center justify-between gap-4'>
<div>
<div className={'w-full'}>
{params ? (
<ColumnFilter
table={table}
params={params}
filters={Object.fromEntries(columnFilters.map((item) => [item.id, item.value]))}
/>
<div className='flex w-full justify-between'>
<ColumnFilter
table={table}
params={params}
filters={Object.fromEntries(columnFilters.map((item) => [item.id, item.value]))}
/>
<Button
variant='outline'
className='h-8 w-8 rounded-full bg-[#D9D9D9] p-2 sm:hidden'
onClick={fetchData}
>
<RefreshCcw className='h-4 w-4 text-[#848484]' />
</Button>
</div>
) : (
header?.title
)}
@@ -150,7 +159,7 @@ export function ProList<TData, TValue extends Record<string, unknown>>({
<>
<Button
variant='outline'
className='h-8 w-8 rounded-full bg-[#D9D9D9] p-2'
className='hidden h-8 w-8 rounded-full bg-[#D9D9D9] p-2 sm:block'
onClick={fetchData}
>
<RefreshCcw className='h-4 w-4 text-[#848484]' />