|
@@ -7,10 +7,8 @@ type Props = {
|
|
|
offset?: number;
|
|
|
onSearch: () => void;
|
|
|
onExport?: () => void;
|
|
|
- searchTestId?: string;
|
|
|
isSearching?: boolean;
|
|
|
isExporting?: boolean;
|
|
|
- exportTestId?: string;
|
|
|
onRefresh?: () => void;
|
|
|
onFilter?: () => void;
|
|
|
onReset?: () => void;
|
|
@@ -22,10 +20,8 @@ const FiterButtonGroup: FC<Props> = function ({
|
|
|
onRefresh,
|
|
|
onFilter,
|
|
|
onReset,
|
|
|
- searchTestId,
|
|
|
isSearching,
|
|
|
isExporting,
|
|
|
- exportTestId,
|
|
|
}) {
|
|
|
return (
|
|
|
<>
|
|
@@ -34,7 +30,7 @@ const FiterButtonGroup: FC<Props> = function ({
|
|
|
loading={isSearching}
|
|
|
type='primary'
|
|
|
onClick={onSearch}
|
|
|
- data-testid={searchTestId ?? 'search_btn'}
|
|
|
+ data-testid={'search_btn'}
|
|
|
icon={<Search theme='outline' className='anticon' />}
|
|
|
htmlType='submit'
|
|
|
>
|
|
@@ -44,7 +40,7 @@ const FiterButtonGroup: FC<Props> = function ({
|
|
|
<Button
|
|
|
loading={isSearching}
|
|
|
onClick={onRefresh}
|
|
|
- data-testid={searchTestId ?? 'refresh_btn'}
|
|
|
+ data-testid='refresh_btn'
|
|
|
className='ant-btn-color-green'
|
|
|
icon={<Refresh theme='outline' className='anticon' />}
|
|
|
htmlType='button'
|
|
@@ -54,7 +50,7 @@ const FiterButtonGroup: FC<Props> = function ({
|
|
|
)}
|
|
|
{onExport && (
|
|
|
<Button
|
|
|
- data-testid={exportTestId ?? 'export_btn'}
|
|
|
+ data-testid='export_btn'
|
|
|
loading={isExporting}
|
|
|
type='default'
|
|
|
onClick={onExport}
|
|
@@ -71,6 +67,7 @@ const FiterButtonGroup: FC<Props> = function ({
|
|
|
onClick={onReset}
|
|
|
icon={<Clear theme='outline' className='anticon' />}
|
|
|
htmlType='button'
|
|
|
+ data-testid='reset_btn'
|
|
|
>
|
|
|
重置
|
|
|
</Button>
|
|
@@ -81,6 +78,7 @@ const FiterButtonGroup: FC<Props> = function ({
|
|
|
onClick={onFilter}
|
|
|
icon={<Filter theme='outline' className='anticon' />}
|
|
|
htmlType='button'
|
|
|
+ data-testid='filter_btn'
|
|
|
>
|
|
|
筛选
|
|
|
</Button>
|