fix(ui): 统一表格筛选分页和用量明细,升级 ESLint

This commit is contained in:
zhanjunhao
2026-11-19 23:09:58 +08:00
parent e70e0d2224
commit e80d719c30
76 changed files with 2556 additions and 2410 deletions
+22 -15
View File
@@ -24,6 +24,27 @@ import { useIsMobile } from '../../hooks/common/useIsMobile';
import { ConsoleCard, ConsoleSearchBar } from './ConsolePrimitives';
import { TableTitle } from '../common/table/TableToolbar';
export function ConsoleCollectionSearch({ children, className }) {
const { t } = useTranslation();
const isMobile = useIsMobile();
const [expanded, setExpanded] = useState(false);
return (
<>
{isMobile && (
<Button
onClick={() => setExpanded((value) => !value)}
aria-expanded={expanded}
>
{t(expanded ? '隐藏操作项' : '显示操作项')}
</Button>
)}
<ConsoleSearchBar className={className} hidden={isMobile && !expanded}>
{children}
</ConsoleSearchBar>
</>
);
}
export default function ConsoleCollection({
children,
statsArea,
@@ -36,27 +57,13 @@ export default function ConsoleCollection({
tableActionsOffset = false,
paginationArea,
}) {
const { t } = useTranslation();
const isMobile = useIsMobile();
const [expanded, setExpanded] = useState(false);
const showSearch = !isMobile || expanded;
return (
<div className='console-collection'>
{statsArea && (
<ConsoleCard className='console-stats'>{statsArea}</ConsoleCard>
)}
{searchArea && (
<>
{isMobile && (
<Button
onClick={() => setExpanded(!expanded)}
aria-expanded={expanded}
>
{t(expanded ? '隐藏操作项' : '显示操作项')}
</Button>
)}
<ConsoleSearchBar hidden={!showSearch}>{searchArea}</ConsoleSearchBar>
</>
<ConsoleCollectionSearch>{searchArea}</ConsoleCollectionSearch>
)}
<ConsoleCard>
{tabsArea && <div className='console-list-tabs'>{tabsArea}</div>}