From c4a24790d651810fa6682bffced72f80be0411fe Mon Sep 17 00:00:00 2001 From: HONOR Date: Sun, 20 Sep 2026 10:58:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97:=20=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E5=90=8E=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/gui.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/gui.py b/src/ui/gui.py index b4b5161..3d823e9 100644 --- a/src/ui/gui.py +++ b/src/ui/gui.py @@ -454,13 +454,14 @@ class BatchTableExtractorApp: self.root.after(0, lambda: self.log("\n❌ 任务已被用户手动终止!")) break - base_name = os.path.splitext(os.path.basename(file_path))[0] + full_name = os.path.basename(file_path) + base_name = os.path.splitext(full_name)[0] target_excel = os.path.join(out_dir, f"{base_name}_表格.xlsx") conflict_action = self.conflict_action_var.get() if os.path.exists(target_excel): if conflict_action == "直接跳过": - self.root.after(0, lambda i=idx, t=total, name=base_name: self.log(f"[{i}/{t}] 跳过同名: {name}")) + self.root.after(0, lambda i=idx, t=total, name=full_name: self.log(f"[{i}/{t}] 跳过同名: {name}")) record_log(batch_id, "跳过", base_name, "-", 0, 0.0, file_path, "发现同名文件,跳过") def update_skip_btn(i=idx, t=total): self.btn_run.config_btn(text=f"提取中 {i}/{t} | 点击终止操作") @@ -476,7 +477,7 @@ class BatchTableExtractorApp: break counter += 1 - self.root.after(0, lambda i=idx, t=total, name=base_name: self.log(f"[{i}/{t}] 处理中: {name}")) + self.root.after(0, lambda i=idx, t=total, name=full_name: self.log(f"[{i}/{t}] 处理中: {name}")) import time t0 = time.time() try: @@ -540,9 +541,9 @@ class BatchTableExtractorApp: import traceback trace_str = traceback.format_exc() if self.debug_var.get(): - err_msg = f" ❌ 失败跳过 [{base_name}]: {e}\n{trace_str}" + err_msg = f" ❌ 失败跳过 [{full_name}]: {e}\n{trace_str}" else: - err_msg = f" ❌ 失败跳过 [{base_name}]: {e}" + err_msg = f" ❌ 失败跳过 [{full_name}]: {e}" self.root.after(0, lambda m=err_msg: self.log(m, tag="error")) record_log(batch_id, "失败", base_name, "-", 0, duration, file_path, f"{e}\n{trace_str}")