diff --git a/src/frontend/platform/src/pages/KnowledgePage/components/PreviewResult.tsx b/src/frontend/platform/src/pages/KnowledgePage/components/PreviewResult.tsx
index 26b0ba547..5efd08e4e 100644
--- a/src/frontend/platform/src/pages/KnowledgePage/components/PreviewResult.tsx
+++ b/src/frontend/platform/src/pages/KnowledgePage/components/PreviewResult.tsx
@@ -146,9 +146,19 @@ console.log(showPreview, previewCount, rules, step, applyEachCell, cellGeneralCo
// 更新分段
const selectedBbox = useKnowledgeStore((state) => state.selectedBbox);
const handleChunkChange = (chunkIndex, text) => {
- const bbox = { chunk_bboxes: selectedBbox }
+
+
+ const existingBbox = chunks[chunkIndex]?.bbox ? JSON.parse(chunks[chunkIndex].bbox) : { chunk_bboxes: [] };
+ const targetChunkBboxes = selectedBbox && selectedBbox.length > 0
+ ? selectedBbox
+ : existingBbox.chunk_bboxes;
+ const bbox = {
+ chunk_bboxes: targetChunkBboxes
+ };
+ console.log( bbox,existingBbox,98999898);
+
updatePreviewChunkApi({
- knowledge_id: Number(id), file_path: currentFile.filePath, chunk_index: chunkIndex, text, bbox: JSON.stringify(bbox)
+ knowledge_id: Number(id)||kId, file_path: currentFile.filePath, chunk_index: chunkIndex, text, bbox: JSON.stringify(bbox)
})
setChunks(chunks => chunks.map(chunk => chunk.chunkIndex === chunkIndex ? { ...chunk, text } : chunk))
}
@@ -163,7 +173,7 @@ console.log(showPreview, previewCount, rules, step, applyEachCell, cellGeneralCo
setChunks={setChunks}
partitions={partitions}
/>}
-
+
{/* 下拉框 - 右上角 */}
{(step === 3 || (step === 2 && showPreview)) && (
diff --git a/src/frontend/platform/src/pages/KnowledgePage/components/RuleFile.tsx b/src/frontend/platform/src/pages/KnowledgePage/components/RuleFile.tsx
index f39bc4d8f..a9d8c1162 100644
--- a/src/frontend/platform/src/pages/KnowledgePage/components/RuleFile.tsx
+++ b/src/frontend/platform/src/pages/KnowledgePage/components/RuleFile.tsx
@@ -186,7 +186,7 @@ export default function RuleFile({
return (