Feat: Bind the route to the navigation bar in the head #3221 (#3863)

### What problem does this PR solve?
Feat: Bind the route to the navigation bar in the head #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-12-04 19:10:08 +08:00
committed by GitHub
parent 1b817a5b4c
commit 84afb4259c
14 changed files with 246 additions and 113 deletions

View File

@ -6,7 +6,7 @@ import { useClickDrawer } from '@/components/pdf-drawer/hooks';
import RetrievalDocuments from '@/components/retrieval-documents';
import SvgIcon from '@/components/svg-icon';
import {
useNextFetchKnowledgeList,
useFetchKnowledgeList,
useSelectTestingResult,
} from '@/hooks/knowledge-hooks';
import { useGetPaginationWithRouter } from '@/hooks/logic-hooks';
@ -45,7 +45,7 @@ const SearchPage = () => {
const { t } = useTranslation();
const [checkedList, setCheckedList] = useState<string[]>([]);
const { chunks, total } = useSelectTestingResult();
const { list: knowledgeList } = useNextFetchKnowledgeList();
const { list: knowledgeList } = useFetchKnowledgeList();
const checkedWithoutEmbeddingIdList = useMemo(() => {
return checkedList.filter((x) => knowledgeList.some((y) => y.id === x));
}, [checkedList, knowledgeList]);

View File

@ -1,4 +1,4 @@
import { useNextFetchKnowledgeList } from '@/hooks/knowledge-hooks';
import { useFetchKnowledgeList } from '@/hooks/knowledge-hooks';
import { UserOutlined } from '@ant-design/icons';
import type { TreeDataNode, TreeProps } from 'antd';
import { Avatar, Layout, Space, Spin, Tree, Typography } from 'antd';
@ -27,7 +27,7 @@ const SearchSidebar = ({
checkedList,
setCheckedList,
}: IProps) => {
const { list, loading } = useNextFetchKnowledgeList();
const { list, loading } = useFetchKnowledgeList();
const groupedList = useMemo(() => {
return list.reduce((pre: TreeDataNode[], cur) => {