diff --git a/src/postprocessing/report_word.py b/src/postprocessing/report_word.py index 8d57cf2..ef3a022 100644 --- a/src/postprocessing/report_word.py +++ b/src/postprocessing/report_word.py @@ -956,14 +956,14 @@ class WaterQualityReportGenerator: else: output_path = Path(output_path) - # 扫描实际数据量 + # 扫描实际数据量,计算进度脉冲数(非数据量本身) csv_files = sorted(csv_dir.glob("*.csv")) if csv_dir.is_dir() else [] tif_files = (sorted(thematic_dir.glob("*.tif")) + sorted(thematic_dir.glob("*.png")) ) if thematic_dir.is_dir() else [] n_csv = len(csv_files) - n_maps = min(len(tif_files), 20) # 最多展示 20 张 - n_fixed = 4 # 封面 + 背景 + 预处理 + 总结 - total_steps = n_fixed + n_csv + n_maps + n_maps = min(len(tif_files), 20) + n_csv_pulses = max(1, n_csv // 10) # 每 10 个 CSV 一次脉冲 + total_steps = 4 + n_csv_pulses + n_maps # 固定章节 + 统计脉冲 + 每张专题图 print(f"[公式报告] 数据: {n_csv} CSV, {len(tif_files)} 专题图 → 总步数 {total_steps}") progress = self._create_progress(total=total_steps, desc="生成公式报告", on_step=on_progress)