This commit is contained in:
27942
2026-01-26 16:47:49 +08:00
parent 76c6fe4059
commit 03cc912bd5
303 changed files with 154 additions and 79 deletions

View File

@@ -1527,16 +1527,17 @@ class MainWindow(QMainWindow):
self.is_updating_table = False
def _set_checkbox_item(self, row, config_index):
"""设置勾选框列第0列"""
"""设置勾选框列第0列,勾选框在单元格内水平、垂直居中"""
checkbox = CheckBox()
checkbox.setChecked(self.configs[config_index].get('勾选', False)) # 默认不勾选
checkbox.stateChanged.connect(lambda state, idx=config_index: self._on_checkbox_changed(idx, state))
# 将勾选框居中显示
wrapper = QWidget()
layout = QHBoxLayout(wrapper)
layout.addWidget(checkbox)
layout.setAlignment(Qt.AlignCenter)
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
layout.addStretch()
layout.addWidget(checkbox, 0, Qt.AlignCenter)
layout.addStretch()
self.config_table.setCellWidget(row, 0, wrapper)
def _on_checkbox_changed(self, config_index, state):
@@ -2435,22 +2436,24 @@ class MainWindow(QMainWindow):
if row_idx >= 0 and row_idx < self.config_table.rowCount():
self.config_table.itemChanged.disconnect(self.on_table_item_changed)
try:
# 第8列是"情况"列
# 第8列是"情况"列,颜色与图标与 _set_status_item 一致
status_item = QTableWidgetItem(status)
status_item.setTextAlignment(Qt.AlignCenter)
status_item.setFlags(status_item.flags() & ~Qt.ItemIsEditable)
# 颜色逻辑
if status == "已完成":
status_item.setBackground(QColor("#D4EDDA"))
status_item.setForeground(QColor("#155724"))
status_item.setIcon(self.style().standardIcon(QStyle.SP_DialogApplyButton))
elif status == "失败":
status_item.setBackground(QColor("#F8D7DA"))
status_item.setForeground(QColor("#721C24"))
status_item.setIcon(self.style().standardIcon(QStyle.SP_MessageBoxCritical))
elif status == "执行中":
status_item.setBackground(QColor("#D1ECF1"))
status_item.setForeground(QColor("#0C5460"))
status_item.setIcon(self.style().standardIcon(QStyle.SP_MediaPlay))
else:
status_item.setIcon(self.style().standardIcon(QStyle.SP_FileDialogInfoView))
self.config_table.setItem(row_idx, 8, status_item)
finally:
self.config_table.itemChanged.connect(self.on_table_item_changed)
@@ -3156,7 +3159,7 @@ class MainWindow(QMainWindow):
'间隔时间': interval_value,
'达人链接': str(row.get('达人链接', '')).strip() if pd.notna(row.get('达人链接')) else '',
'执行人': str(row.get('执行人', '')).strip() if pd.notna(row.get('执行人')) else '',
'情况': str(row.get('情况', '待执行')).strip() if pd.notna(row.get('情况')) else '待执行',
'情况': '待执行', # 导入新Excel时强制重置为待执行不累计历史状态
'文件路径': '' # 文件路径字段初始为空,通过更新数据按钮填充
}
self.configs.append(config)
@@ -3722,6 +3725,8 @@ class MainWindow(QMainWindow):
# 开始新任务时重置当前批次状态(不累计历史数据)
self.set_status_cards(pending=0, running=0, success=0, failed=0)
self.batch_success_count = 0
self.batch_failed_count = 0
# 获取文件夹路径
folder_path = self.folder_path_input.text().strip()
@@ -3997,14 +4002,25 @@ class MainWindow(QMainWindow):
error_msg = f"启动任务失败: {str(e)}"
self.log_text.append(f"{error_msg}")
logger.error(error_msg, exc_info=True)
# 即使失败也继续下一个任务
self.batch_processed += task.get('count', 1)
self.batch_pending_tasks = max(self.batch_pending_tasks - task.get('count', 1), 0)
self.set_status_cards(pending=self.batch_pending_tasks)
# 即使失败也继续下一个任务,立即更新表格为失败并增加失败条数
count = task.get('count', 1)
config_indices = task.get('config_indices', [])
for cfg_idx in config_indices:
try:
self._update_table_status(cfg_idx, "失败", is_config_index=True)
except Exception:
pass
self.batch_failed_count += len(config_indices) if config_indices else 1
self.batch_processed += count
self.batch_pending_tasks = max(self.batch_pending_tasks - count, 0)
self.set_status_cards(
pending=self.batch_pending_tasks,
success=getattr(self, 'batch_success_count', 0),
failed=getattr(self, 'batch_failed_count', 0)
)
self.set_running_progress(self.batch_processed, self.batch_total_tasks)
self.current_batch_task_index += 1
# 继续处理下一个任务
QApplication.processEvents() # 处理GUI事件
QApplication.processEvents()
self._process_next_batch_task()
def _on_batch_task_finished(self, success, message):
@@ -4026,19 +4042,25 @@ class MainWindow(QMainWindow):
elif task_type == 'image_folder':
self.log_text.append(f" ✓ 图片文件夹上传完成")
# 更新状态为"已完成"
# 立即更新表格为"已完成",并增加成功条数
for cfg_idx in config_indices:
self._update_table_status(cfg_idx, "已完成", is_config_index=True)
self.batch_success_count += len(config_indices)
else:
self.log_text.append(f" ✗ 任务失败: {message}")
# 更新状态为"失败"
# 立即更新表格为"失败",并增加失败条数
for cfg_idx in config_indices:
self._update_table_status(cfg_idx, "失败", is_config_index=True)
self.batch_failed_count += len(config_indices)
# 更新统计
# 更新统计(完成一条就更新一条,成功/失败卡片实时刷新)
self.batch_processed += count
self.batch_pending_tasks = max(self.batch_pending_tasks - count, 0)
self.set_status_cards(pending=self.batch_pending_tasks)
self.set_status_cards(
pending=self.batch_pending_tasks,
success=self.batch_success_count,
failed=self.batch_failed_count
)
self.set_running_progress(self.batch_processed, self.batch_total_tasks)
# 移动到下一个任务

View File

@@ -15,5 +15,5 @@
"top_topics_and_observing_domains": [ ]
} ],
"hex_encoded_hmac_key": "434BF7DBD7DA573B45E0A11AD9045A61B6221D14AE2F9A341E2FEF659AF071F6",
"next_scheduled_calculation_time": "13414055093389451"
"next_scheduled_calculation_time": "13414055093389472"
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

View File

@@ -0,0 +1,3 @@
2026/01/26-11:19:53.288 6764 Reusing MANIFEST C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension Rules/MANIFEST-000001
2026/01/26-11:19:53.289 6764 Recovering log #3
2026/01/26-11:19:53.290 6764 Reusing old log C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension Rules/000003.log

View File

@@ -0,0 +1,3 @@
2026/01/26-11:19:03.567 8434 Reusing MANIFEST C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension Rules/MANIFEST-000001
2026/01/26-11:19:03.568 8434 Recovering log #3
2026/01/26-11:19:03.569 8434 Reusing old log C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension Rules/000003.log

View File

@@ -0,0 +1,3 @@
2026/01/26-11:19:53.303 6764 Reusing MANIFEST C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension Scripts/MANIFEST-000001
2026/01/26-11:19:53.303 6764 Recovering log #3
2026/01/26-11:19:53.304 6764 Reusing old log C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension Scripts/000003.log

View File

@@ -0,0 +1,3 @@
2026/01/26-11:19:03.588 8434 Reusing MANIFEST C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension Scripts/MANIFEST-000001
2026/01/26-11:19:03.589 8434 Recovering log #3
2026/01/26-11:19:03.591 8434 Reusing old log C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension Scripts/000003.log

View File

@@ -0,0 +1,3 @@
2026/01/26-11:22:08.918 33f0 Reusing MANIFEST C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension State/MANIFEST-000001
2026/01/26-11:22:08.919 33f0 Recovering log #3
2026/01/26-11:22:08.920 33f0 Reusing old log C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension State/000003.log

View File

@@ -0,0 +1,3 @@
2026/01/26-11:19:45.585 1964 Reusing MANIFEST C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension State/MANIFEST-000001
2026/01/26-11:19:45.586 1964 Recovering log #3
2026/01/26-11:19:45.587 1964 Reusing old log C:\Users\27942\Desktop\codesk\haha\user\user_data\Default\Extension State/000003.log

Some files were not shown because too many files have changed in this diff Show More