mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-03 02:55:29 +08:00
### What problem does this PR solve? feat: Move files in file manager #1826 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,6 +1,12 @@
|
||||
import NewDocumentLink from '@/components/new-document-link';
|
||||
import SvgIcon from '@/components/svg-icon';
|
||||
import { useTranslate } from '@/hooks/common-hooks';
|
||||
import { IFile } from '@/interfaces/database/file-manager';
|
||||
import { api_host } from '@/utils/api';
|
||||
import {
|
||||
getExtension,
|
||||
isSupportedPreviewDocumentType,
|
||||
} from '@/utils/document-util';
|
||||
import { downloadFile } from '@/utils/file-util';
|
||||
import {
|
||||
DeleteOutlined,
|
||||
@ -11,18 +17,13 @@ import {
|
||||
} from '@ant-design/icons';
|
||||
import { Button, Space, Tooltip } from 'antd';
|
||||
import { useHandleDeleteFile } from '../hooks';
|
||||
|
||||
import NewDocumentLink from '@/components/new-document-link';
|
||||
import {
|
||||
getExtension,
|
||||
isSupportedPreviewDocumentType,
|
||||
} from '@/utils/document-util';
|
||||
import styles from './index.less';
|
||||
|
||||
interface IProps {
|
||||
record: IFile;
|
||||
setCurrentRecord: (record: any) => void;
|
||||
showRenameModal: (record: IFile) => void;
|
||||
showMoveFileModal: (ids: string[]) => void;
|
||||
showConnectToKnowledgeModal: (record: IFile) => void;
|
||||
setSelectedRowKeys(keys: string[]): void;
|
||||
}
|
||||
@ -33,6 +34,7 @@ const ActionCell = ({
|
||||
showRenameModal,
|
||||
showConnectToKnowledgeModal,
|
||||
setSelectedRowKeys,
|
||||
showMoveFileModal,
|
||||
}: IProps) => {
|
||||
const documentId = record.id;
|
||||
const beingUsed = false;
|
||||
@ -64,6 +66,10 @@ const ActionCell = ({
|
||||
showConnectToKnowledgeModal(record);
|
||||
};
|
||||
|
||||
const onShowMoveFileModal = () => {
|
||||
showMoveFileModal([documentId]);
|
||||
};
|
||||
|
||||
return (
|
||||
<Space size={0}>
|
||||
{isKnowledgeBase || (
|
||||
@ -90,6 +96,18 @@ const ActionCell = ({
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
{isKnowledgeBase || (
|
||||
<Tooltip title={t('move', { keyPrefix: 'common' })}>
|
||||
<Button
|
||||
type="text"
|
||||
disabled={beingUsed}
|
||||
onClick={onShowMoveFileModal}
|
||||
className={styles.iconButton}
|
||||
>
|
||||
<SvgIcon name={`move`} width={16}></SvgIcon>
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
{isKnowledgeBase || (
|
||||
<Tooltip title={t('delete', { keyPrefix: 'common' })}>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user