diff --git a/web/package.json b/web/package.json index 7ada36f74f5..63ecd6930ee 100644 --- a/web/package.json +++ b/web/package.json @@ -20,7 +20,6 @@ "@ant-design/icons": "^5.2.6", "@ant-design/pro-components": "^2.6.46", "@ant-design/pro-layout": "^7.17.16", - "@antv/g": "^6.1.11", "@antv/g6": "^5.0.10", "@hookform/resolvers": "^3.9.1", "@js-preview/excel": "^1.7.8", @@ -73,7 +72,6 @@ "react-i18next": "^14.0.0", "react-infinite-scroll-component": "^6.1.0", "react-markdown": "^9.0.1", - "react-pdf": "^9.1.1", "react-pdf-highlighter": "^6.1.0", "react-string-replace": "^1.1.1", "react-syntax-highlighter": "^15.5.0", diff --git a/web/src/constants/knowledge.ts b/web/src/constants/knowledge.ts index 2bcf19a1980..09dc160e96b 100644 --- a/web/src/constants/knowledge.ts +++ b/web/src/constants/knowledge.ts @@ -57,3 +57,8 @@ export enum KnowledgeSearchParams { DocumentId = 'doc_id', KnowledgeId = 'id', } + +export enum DocumentType { + Virtual = 'virtual', + Visual = 'visual', +} diff --git a/web/src/hooks/file-manager-hooks.ts b/web/src/hooks/file-manager-hooks.ts index 5ce623d5d76..4438609c5bd 100644 --- a/web/src/hooks/file-manager-hooks.ts +++ b/web/src/hooks/file-manager-hooks.ts @@ -131,23 +131,6 @@ export const useDownloadFile = () => { return { data, loading, downloadFile: mutateAsync }; }; -export const useLoadFile = () => { - const { - data, - isPending: loading, - mutateAsync, - error, - } = useMutation({ - mutationKey: ['downloadFile'], - mutationFn: async (params: { id: string }) => { - const response = await fileManagerService.getFile({}, params.id); - const blob = new Blob([response.data], { type: response.data.type }); - return blob; - }, - }); - return { data, loading, loadFile: mutateAsync, error }; -}; - export const useRenameFile = () => { const queryClient = useQueryClient(); const { t } = useTranslation(); diff --git a/web/src/pages/add-knowledge/components/knowledge-file/parsing-action-cell/index.tsx b/web/src/pages/add-knowledge/components/knowledge-file/parsing-action-cell/index.tsx index dd22b40d60a..8c644aac056 100644 --- a/web/src/pages/add-knowledge/components/knowledge-file/parsing-action-cell/index.tsx +++ b/web/src/pages/add-knowledge/components/knowledge-file/parsing-action-cell/index.tsx @@ -11,6 +11,7 @@ import { import { Button, Dropdown, MenuProps, Space, Tooltip } from 'antd'; import { isParserRunning } from '../utils'; +import { DocumentType } from '../constant'; import styles from './index.less'; interface IProps { @@ -31,6 +32,7 @@ const ParsingActionCell = ({ const { t } = useTranslate('knowledgeDetails'); const { removeDocument } = useRemoveNextDocument(); const showDeleteConfirm = useShowDeleteConfirm(); + const isVirtualDocument = record.type === DocumentType.Virtual; const onRmDocument = () => { if (!isRunning) { @@ -73,15 +75,17 @@ const ParsingActionCell = ({ return ( - - - + {isVirtualDocument || ( + + + + )} - - - + {isVirtualDocument || ( + + + + )} ); }; diff --git a/web/src/pages/add-knowledge/components/knowledge-file/parsing-status-cell/index.tsx b/web/src/pages/add-knowledge/components/knowledge-file/parsing-status-cell/index.tsx index ff4a5fb9bb2..14c3d99261d 100644 --- a/web/src/pages/add-knowledge/components/knowledge-file/parsing-status-cell/index.tsx +++ b/web/src/pages/add-knowledge/components/knowledge-file/parsing-status-cell/index.tsx @@ -7,7 +7,7 @@ import { Badge, DescriptionsProps, Flex, Popover, Space, Tag } from 'antd'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; import reactStringReplace from 'react-string-replace'; -import { RunningStatus, RunningStatusMap } from '../constant'; +import { DocumentType, RunningStatus, RunningStatusMap } from '../constant'; import { useHandleRunDocumentByIds } from '../hooks'; import { isParserRunning } from '../utils'; import styles from './index.less'; @@ -96,7 +96,7 @@ export const ParsingStatusCell = ({ record }: IProps) => { handleRunDocumentByIds(record.id, isRunning); }; - return ( + return record.type === DocumentType.Virtual ? null : ( }> diff --git a/web/src/pages/flow/flow-drawer/index.tsx b/web/src/pages/flow/flow-drawer/index.tsx index 542f4dada0a..f669038a276 100644 --- a/web/src/pages/flow/flow-drawer/index.tsx +++ b/web/src/pages/flow/flow-drawer/index.tsx @@ -39,6 +39,7 @@ import OperatorIcon from '../operator-icon'; import { CloseOutlined } from '@ant-design/icons'; import { lowerFirst } from 'lodash'; +import EmailForm from '../form/email-form'; import TemplateForm from '../form/template-form'; import { getDrawerWidth } from '../utils'; import styles from './index.less';