Compare commits
2 Commits
600400a4d9
...
6f4717662a
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f4717662a | |||
| 8f01624171 |
@ -153,42 +153,56 @@ class Step7InversionPanel(QWidget):
|
|||||||
right_layout.setContentsMargins(0, 0, 0, 0)
|
right_layout.setContentsMargins(0, 0, 0, 0)
|
||||||
right_layout.setSpacing(8)
|
right_layout.setSpacing(8)
|
||||||
|
|
||||||
# 按钮工具栏
|
# 按钮工具栏(拆分为两行,防止控件挤在一行撑宽面板)
|
||||||
btn_layout = QHBoxLayout()
|
btn_wrapper = QVBoxLayout()
|
||||||
btn_layout.setContentsMargins(0, 0, 0, 0)
|
btn_wrapper.setContentsMargins(0, 0, 0, 0)
|
||||||
btn_layout.setSpacing(10)
|
btn_wrapper.setSpacing(5)
|
||||||
|
|
||||||
btn_layout.addWidget(QLabel("按类别筛选:"))
|
# 第1行:[按类别筛选:] [下拉框] [全选] [清空]
|
||||||
|
row1 = QHBoxLayout()
|
||||||
|
row1.setContentsMargins(0, 0, 0, 0)
|
||||||
|
row1.setSpacing(10)
|
||||||
|
|
||||||
|
row1.addWidget(QLabel("按类别筛选:"))
|
||||||
self.category_combo = QComboBox()
|
self.category_combo = QComboBox()
|
||||||
self.category_combo.setStyleSheet("""
|
self.category_combo.setStyleSheet("""
|
||||||
QComboBox { padding: 4px 8px; border: 1px solid #C0C0C0; border-radius: 4px; min-height: 24px; }
|
QComboBox { padding: 4px 8px; border: 1px solid #C0C0C0; border-radius: 4px; min-height: 24px; }
|
||||||
""")
|
""")
|
||||||
self.category_combo.currentIndexChanged.connect(self._on_category_changed)
|
self.category_combo.currentIndexChanged.connect(self._on_category_changed)
|
||||||
btn_layout.addWidget(self.category_combo)
|
row1.addWidget(self.category_combo)
|
||||||
btn_layout.addSpacing(10)
|
row1.addSpacing(10)
|
||||||
|
|
||||||
self.btn_select_all = QPushButton("全选")
|
self.btn_select_all = QPushButton("全选")
|
||||||
self.btn_select_none = QPushButton("清空")
|
self.btn_select_none = QPushButton("清空")
|
||||||
|
for btn in [self.btn_select_all, self.btn_select_none]:
|
||||||
|
btn.setStyleSheet(ModernStylesheet.get_button_stylesheet('normal'))
|
||||||
|
btn.setFixedHeight(30)
|
||||||
|
row1.addWidget(btn)
|
||||||
|
row1.addStretch()
|
||||||
|
|
||||||
|
# 第2行:[仅比值型] [仅浓度型] [重新加载库] [已选: N]
|
||||||
|
row2 = QHBoxLayout()
|
||||||
|
row2.setContentsMargins(0, 0, 0, 0)
|
||||||
|
row2.setSpacing(10)
|
||||||
|
|
||||||
self.btn_select_ratio = QPushButton("仅比值型")
|
self.btn_select_ratio = QPushButton("仅比值型")
|
||||||
self.btn_select_conc = QPushButton("仅浓度型")
|
self.btn_select_conc = QPushButton("仅浓度型")
|
||||||
self.btn_reload = QPushButton("重新加载库")
|
self.btn_reload = QPushButton("重新加载库")
|
||||||
|
for btn in [self.btn_select_ratio, self.btn_select_conc, self.btn_reload]:
|
||||||
for btn in [self.btn_select_all, self.btn_select_none,
|
btn.setStyleSheet(ModernStylesheet.get_button_stylesheet('normal') +
|
||||||
self.btn_select_ratio, self.btn_select_conc, self.btn_reload]:
|
"\nQPushButton { padding-left: 14px; padding-right: 14px; }")
|
||||||
base_style = ModernStylesheet.get_button_stylesheet('normal')
|
|
||||||
btn.setStyleSheet(base_style + "\nQPushButton { padding-left: 14px; padding-right: 14px; }")
|
|
||||||
btn.setFixedHeight(30)
|
btn.setFixedHeight(30)
|
||||||
btn.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
|
row2.addWidget(btn)
|
||||||
btn_layout.addWidget(btn)
|
|
||||||
|
|
||||||
btn_layout.addStretch()
|
|
||||||
|
|
||||||
self.formula_count_label = QLabel("已选: 0 | 显示: 0 / 共 0 个")
|
self.formula_count_label = QLabel("已选: 0 | 显示: 0 / 共 0 个")
|
||||||
self.formula_count_label.setStyleSheet(
|
self.formula_count_label.setStyleSheet(
|
||||||
"color: #666666; font-size: 13px; font-weight: bold; padding-right: 10px;")
|
"color: #666666; font-size: 13px; font-weight: bold; padding-right: 10px;")
|
||||||
btn_layout.addWidget(self.formula_count_label)
|
row2.addWidget(self.formula_count_label)
|
||||||
|
row2.addStretch()
|
||||||
|
|
||||||
right_layout.addLayout(btn_layout)
|
btn_wrapper.addLayout(row1)
|
||||||
|
btn_wrapper.addLayout(row2)
|
||||||
|
right_layout.addLayout(btn_wrapper)
|
||||||
|
|
||||||
# 列表框
|
# 列表框
|
||||||
self.formula_list = NoScrollPassListWidget()
|
self.formula_list = NoScrollPassListWidget()
|
||||||
|
|||||||
@ -1107,8 +1107,7 @@ class WaterQualityReportGenerator:
|
|||||||
figure_num += 1
|
figure_num += 1
|
||||||
maps_found = 0
|
maps_found = 0
|
||||||
if tif_files:
|
if tif_files:
|
||||||
n_show = min(len(tif_files), 20)
|
for i_t, tf in enumerate(tif_files):
|
||||||
for i_t, tf in enumerate(tif_files[:n_show]):
|
|
||||||
try:
|
try:
|
||||||
param_name = tf.stem.split('_')[0] if '_' in tf.stem else tf.stem
|
param_name = tf.stem.split('_')[0] if '_' in tf.stem else tf.stem
|
||||||
caption = f"图{figure_num} {param_name} 空间分布图"
|
caption = f"图{figure_num} {param_name} 空间分布图"
|
||||||
@ -1122,9 +1121,7 @@ class WaterQualityReportGenerator:
|
|||||||
maps_found += 1
|
maps_found += 1
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
doc.add_paragraph(f"[专题图插入失败: {tf.name} — {e}]")
|
doc.add_paragraph(f"[专题图插入失败: {tf.name} — {e}]")
|
||||||
_next(f"专题图 {i_t+1}/{n_show}")
|
_next(f"专题图 {i_t+1}/{len(tif_files)}")
|
||||||
if len(tif_files) > 20:
|
|
||||||
doc.add_paragraph(f"... 共 {len(tif_files)} 张专题图,此处仅展示前 20 张。")
|
|
||||||
else:
|
else:
|
||||||
doc.add_paragraph(f"(未找到专题图目录: {thematic_dir})")
|
doc.add_paragraph(f"(未找到专题图目录: {thematic_dir})")
|
||||||
if maps_found == 0:
|
if maps_found == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user