mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Batch operations on documents in a dataset #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { useSelectedIds } from '@/hooks/logic-hooks/use-row-selection';
|
||||
import { IFile } from '@/interfaces/database/file-manager';
|
||||
import { OnChangeFn, RowSelectionState } from '@tanstack/react-table';
|
||||
import { FolderInput, Trash2 } from 'lucide-react';
|
||||
import { useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useHandleDeleteFile } from './use-delete-file';
|
||||
import { UseMoveDocumentShowType } from './use-move-file';
|
||||
@ -18,12 +18,7 @@ export function useBulkOperateFile({
|
||||
} & UseMoveDocumentShowType) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const selectedIds = useMemo(() => {
|
||||
const indexes = Object.keys(rowSelection);
|
||||
return files
|
||||
.filter((x, idx) => indexes.some((y) => Number(y) === idx))
|
||||
.map((x) => x.id);
|
||||
}, [files, rowSelection]);
|
||||
const { selectedIds } = useSelectedIds(rowSelection, files);
|
||||
|
||||
const { handleRemoveFile } = useHandleDeleteFile();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user