fix: fix dataset-page's bugs (#8786)

### What problem does this PR solve?

fix dataset-page's bugs,Input component supports icon, added Radio
component, and removed antd from chunk-result-bar page [#3221
](https://github.com/infiniflow/ragflow/issues/3221)

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-07-11 11:34:36 +08:00
committed by GitHub
parent 07208e519b
commit 52dce4329d
23 changed files with 399 additions and 153 deletions

View File

@ -37,20 +37,6 @@ export const useSetSelectedRecord = <T = IKnowledgeFile>() => {
return { currentRecord, setRecord };
};
export const useHandleSearchChange = () => {
const [searchString, setSearchString] = useState('');
const handleInputChange = useCallback(
(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
const value = e.target.value;
setSearchString(value);
},
[],
);
return { handleInputChange, searchString };
};
export const useChangeLanguage = () => {
const { i18n } = useTranslation();
const { saveSetting } = useSaveSetting();
@ -82,9 +68,12 @@ export const useGetPaginationWithRouter = () => {
const setCurrentPagination = useCallback(
(pagination: { page: number; pageSize?: number }) => {
if (pagination.pageSize !== pageSize) {
pagination.page = 1; // Reset to first page if pageSize changes
}
setPaginationParams(pagination.page, pagination.pageSize);
},
[setPaginationParams],
[setPaginationParams, pageSize],
);
const pagination: PaginationProps = useMemo(() => {
@ -106,6 +95,21 @@ export const useGetPaginationWithRouter = () => {
};
};
export const useHandleSearchChange = () => {
const [searchString, setSearchString] = useState('');
const { setPagination } = useGetPaginationWithRouter();
const handleInputChange = useCallback(
(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
const value = e.target.value;
setSearchString(value);
setPagination({ page: 1 });
},
[setPagination],
);
return { handleInputChange, searchString };
};
export const useGetPagination = () => {
const [pagination, setPagination] = useState({ page: 1, pageSize: 10 });
const { t } = useTranslate('common');