diff --git a/web/src/components/chunk_image/index.tsx b/web/src/components/chunk_image/index.tsx
index 13c22c1..c1ddca9 100644
--- a/web/src/components/chunk_image/index.tsx
+++ b/web/src/components/chunk_image/index.tsx
@@ -1,4 +1,3 @@
-import { api_host } from '@/utils/api';
import { Popover } from 'antd';
import classNames from 'classnames';
@@ -10,10 +9,12 @@ interface IImage {
}
const ChunkImage = ({ id, className, ...props }: IImage) => {
+ const imgSrc = id;
+
return (
diff --git a/web/src/pages/add-knowledge/components/knowledge-chunk/index.less b/web/src/pages/add-knowledge/components/knowledge-chunk/index.less
index 617f479..0867737 100644
--- a/web/src/pages/add-knowledge/components/knowledge-chunk/index.less
+++ b/web/src/pages/add-knowledge/components/knowledge-chunk/index.less
@@ -94,13 +94,20 @@
.imagePreviewPane {
width: 200px;
min-width: 200px;
- background-color: var(--colors-background-inverse-weak);
+ background-color: #f0f9ff;
border-radius: 8px;
padding: 16px;
display: flex;
flex-direction: column;
h4 {
+ text-align: center;
+ margin-bottom: 12px;
+ font-weight: 500;
+ }
+
+ p {
+ text-align: center;
margin-bottom: 12px;
font-weight: 500;
}
diff --git a/web/src/pages/add-knowledge/components/knowledge-chunk/index.tsx b/web/src/pages/add-knowledge/components/knowledge-chunk/index.tsx
index 52967f5..78f8152 100644
--- a/web/src/pages/add-knowledge/components/knowledge-chunk/index.tsx
+++ b/web/src/pages/add-knowledge/components/knowledge-chunk/index.tsx
@@ -50,6 +50,11 @@ const Chunk = () => {
// 获取选中的chunk
const selectedChunk = data.find((item) => item.chunk_id === selectedChunkId);
+ // 获取图片ID,兼容两种字段名
+ const getImageId = (chunk: any) => {
+ return chunk?.image_id || chunk?.img_id;
+ };
+
const onPaginationChange: PaginationProps['onShowSizeChange'] = (
page,
size,
@@ -142,24 +147,22 @@ const Chunk = () => {
{t('chunk.noImageAssociated', '此区块没有关联图片')}
{t(
'chunk.selectChunkToViewImage',
diff --git a/web/src/pages/knowledge/index.tsx b/web/src/pages/knowledge/index.tsx
index 6991a70..a6b5857 100644
--- a/web/src/pages/knowledge/index.tsx
+++ b/web/src/pages/knowledge/index.tsx
@@ -1,16 +1,7 @@
import { useInfiniteFetchKnowledgeList } from '@/hooks/knowledge-hooks';
import { useFetchUserInfo } from '@/hooks/user-setting-hooks';
-import { PlusOutlined, SearchOutlined } from '@ant-design/icons';
-import {
- Button,
- Divider,
- Empty,
- Flex,
- Input,
- Skeleton,
- Space,
- Spin,
-} from 'antd';
+import { SearchOutlined } from '@ant-design/icons';
+import { Divider, Empty, Flex, Input, Skeleton, Space, Spin } from 'antd';
import { useTranslation } from 'react-i18next';
import InfiniteScroll from 'react-infinite-scroll-component';
import { useSaveKnowledge } from './hooks';
@@ -26,7 +17,6 @@ const KnowledgeList = () => {
const {
visible,
hideModal,
- showModal,
onCreateOk,
loading: creatingLoading,
} = useSaveKnowledge();
@@ -67,15 +57,6 @@ const KnowledgeList = () => {
onChange={handleInputChange}
prefix={