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

This commit is contained in:
zhanjunhao
2026-11-19 23:09:58 +08:00
parent 7908ed53a3
commit 04cc45bbb7
76 changed files with 2556 additions and 2410 deletions
+18 -22
View File
@@ -32,6 +32,8 @@ import {
} from 'antd';
import { useTranslation } from 'react-i18next';
import TableEmpty from '../common/table/TableEmpty';
import FilterSearchButton from '../common/table/FilterSearchButton';
import './console.css';
import {
ConsoleSearchContext,
useConsolePage,
@@ -96,38 +98,32 @@ export function ConsoleSearchBar({ children, className, formProps, ...props }) {
);
}
export function ConsoleSearchActions({
onReset,
onSearch,
loading,
searchLabel = '搜索',
}) {
export function ConsoleSearchActions({ onReset, loading }) {
const { t } = useTranslation();
return (
<div className='console-search-actions'>
{onReset && <Button onClick={onReset}>{t('重置')}</Button>}
<Button
type='primary'
htmlType={onSearch ? 'button' : 'submit'}
onClick={onSearch}
loading={loading}
>
{t(searchLabel)}
</Button>
{onReset && (
<Button htmlType='button' onClick={onReset}>
{t('重置')}
</Button>
)}
<FilterSearchButton loading={loading} />
</div>
);
}
export function ConsoleFilterGrid({ children, onReset, onSearch, loading }) {
return (
<div className='console-filter-panel'>
<form
className='console-filter-panel'
onSubmit={(event) => {
event.preventDefault();
onSearch();
}}
>
<div className='console-filter-grid'>{children}</div>
<ConsoleSearchActions
onReset={onReset}
onSearch={onSearch}
loading={loading}
/>
</div>
<ConsoleSearchActions onReset={onReset} loading={loading} />
</form>
);
}