From a3d608318860214c139a9e5beefbc6054e3f4ced Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Fri, 7 Feb 2025 15:13:14 +0800 Subject: [PATCH] fix: XLS, XLSX, CSV file upload lost data (#2150) --- apps/common/handle/impl/csv_split_handle.py | 2 +- apps/common/handle/impl/xls_split_handle.py | 2 +- apps/common/handle/impl/xlsx_split_handle.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/common/handle/impl/csv_split_handle.py b/apps/common/handle/impl/csv_split_handle.py index d4691a3d6..11dbdc785 100644 --- a/apps/common/handle/impl/csv_split_handle.py +++ b/apps/common/handle/impl/csv_split_handle.py @@ -53,7 +53,7 @@ class CsvSplitHandle(BaseSplitHandle): result_item_content += next_md_content else: paragraphs.append({'content': result_item_content, 'title': ''}) - result_item_content = '' + result_item_content = next_md_content if len(result_item_content) > 0: paragraphs.append({'content': result_item_content, 'title': ''}) return result diff --git a/apps/common/handle/impl/xls_split_handle.py b/apps/common/handle/impl/xls_split_handle.py index 332e5b56d..0863bedec 100644 --- a/apps/common/handle/impl/xls_split_handle.py +++ b/apps/common/handle/impl/xls_split_handle.py @@ -48,7 +48,7 @@ def handle_sheet(file_name, sheet, limit: int): result_item_content += next_md_content else: paragraphs.append({'content': result_item_content, 'title': ''}) - result_item_content = '' + result_item_content = next_md_content if len(result_item_content) > 0: paragraphs.append({'content': result_item_content, 'title': ''}) return result diff --git a/apps/common/handle/impl/xlsx_split_handle.py b/apps/common/handle/impl/xlsx_split_handle.py index c8763b1fb..c367a65f6 100644 --- a/apps/common/handle/impl/xlsx_split_handle.py +++ b/apps/common/handle/impl/xlsx_split_handle.py @@ -54,7 +54,7 @@ def handle_sheet(file_name, sheet, image_dict, limit: int): result_item_content += next_md_content else: paragraphs.append({'content': result_item_content, 'title': ''}) - result_item_content = '' + result_item_content = next_md_content if len(result_item_content) > 0: paragraphs.append({'content': result_item_content, 'title': ''}) return result