feat: select the corresponding parsing method according to the file type and after the document is successfully uploaded, use the ChunkMethodModal to select the parsing method. and remove ChunkMethodModal from knowledge-file (#158)
* feat: select the corresponding parsing method according to the file type * feat: after the document is successfully uploaded, use the ChunkMethodModal to select the parsing method. * feat: add pdf types to ParserListMap * feat: remove ChunkMethodModal from knowledge-file
This commit is contained in:
@@ -7,10 +7,7 @@ import {
|
||||
} from '@/hooks/documentHooks';
|
||||
import { useGetKnowledgeSearchParams } from '@/hooks/routeHook';
|
||||
import { useOneNamespaceEffectsLoading } from '@/hooks/storeHooks';
|
||||
import {
|
||||
useFetchTenantInfo,
|
||||
useSelectParserList,
|
||||
} from '@/hooks/userSettingHook';
|
||||
import { useFetchTenantInfo } from '@/hooks/userSettingHook';
|
||||
import { Pagination } from '@/interfaces/common';
|
||||
import { IKnowledgeFile } from '@/interfaces/database/knowledge';
|
||||
import { IChangeParserConfigRequestBody } from '@/interfaces/request/document';
|
||||
@@ -243,21 +240,3 @@ export const useChangeDocumentParser = (documentId: string) => {
|
||||
showChangeParserModal,
|
||||
};
|
||||
};
|
||||
|
||||
export const useFetchParserListOnMount = (parserId: string) => {
|
||||
const [selectedTag, setSelectedTag] = useState('');
|
||||
const parserList = useSelectParserList();
|
||||
|
||||
useFetchTenantInfo();
|
||||
|
||||
useEffect(() => {
|
||||
setSelectedTag(parserId);
|
||||
}, [parserId]);
|
||||
|
||||
const handleChange = (tag: string, checked: boolean) => {
|
||||
const nextSelectedTag = checked ? tag : selectedTag;
|
||||
setSelectedTag(nextSelectedTag);
|
||||
};
|
||||
|
||||
return { parserList, handleChange, selectedTag };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user