From 50f2da55030c82f510cd2254123cd57975c10bd0 Mon Sep 17 00:00:00 2001
From: Jerry Yan <792602257@qq.com>
Date: Wed, 4 Feb 2026 15:43:53 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20hasArchive=20?=
=?UTF-8?q?=E5=92=8C=20splitByLine=20=E5=90=8C=E6=97=B6=E5=AD=98=E5=9C=A8?=
=?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
问题:hasArchive 默认为 true,而 splitByLine 可以与其同时开启,
导致压缩包被错误地按行分割,产生逻辑矛盾。
修复:
1. 当 hasArchive=true 时,禁用 splitByLine switch
2. 添加 useEffect,当 hasArchive 变为 true 时自动关闭 splitByLine
修改文件:frontend/src/pages/DataManagement/Detail/components/ImportConfiguration.tsx
---
.../Detail/components/ImportConfiguration.tsx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/frontend/src/pages/DataManagement/Detail/components/ImportConfiguration.tsx b/frontend/src/pages/DataManagement/Detail/components/ImportConfiguration.tsx
index 9105598..fa6292f 100644
--- a/frontend/src/pages/DataManagement/Detail/components/ImportConfiguration.tsx
+++ b/frontend/src/pages/DataManagement/Detail/components/ImportConfiguration.tsx
@@ -324,6 +324,14 @@ export default function ImportConfiguration({
setImportConfig((prev) => ({ ...prev, splitByLine: false }));
}, [form, hasNonTextFile, importConfig.files, importConfig.splitByLine]);
+ // 当 hasArchive 变为 true 时,自动关闭 splitByLine
+ useEffect(() => {
+ if (importConfig.hasArchive && importConfig.splitByLine) {
+ form.setFieldsValue({ splitByLine: false });
+ setImportConfig((prev) => ({ ...prev, splitByLine: false }));
+ }
+ }, [form, importConfig.hasArchive, importConfig.splitByLine]);
+
// Separate effect for fetching collection tasks when source changes
useEffect(() => {
if (open && importConfig.source === DataSource.COLLECTION) {
@@ -447,7 +455,7 @@ export default function ImportConfiguration({
name="splitByLine"
valuePropName="checked"
>
-