feat(collect): show skipped reason summaries

This commit is contained in:
chengma
2026-07-13 14:31:58 +08:00
parent a7ac8522bf
commit 0a3a6b99a1
7 changed files with 239 additions and 15 deletions
+17 -5
View File
@@ -2,7 +2,11 @@
from __future__ import annotations
from .. import diagnostics
from ..collect_skip import skipped_stage_text
from .widgets import *
class TaskTableModel(QAbstractTableModel):
"""Table model for task rows shared by workflow tabs."""
@@ -88,11 +92,15 @@ class TaskTableModel(QAbstractTableModel):
if role == Qt.ForegroundRole and index.column() == 3:
return self._stage_color(task)
if role == Qt.ToolTipRole:
if self.is_unmatched(task):
return "别名未匹配账号,采集时将略过"
error = getattr(task, "last_error", "") or ""
if self.is_unmatched(task) or getattr(task, "status", "") == "skipped":
if error:
return diagnostics.redact_log_text(str(error))
if self.is_unmatched(task):
return "别名未匹配账号,采集时将略过"
return "未记录具体略过原因"
if error:
return str(error)
return diagnostics.redact_log_text(str(error))
return None
def flags(self, index):
@@ -124,8 +132,12 @@ class TaskTableModel(QAbstractTableModel):
return bool(error) and any(marker.lower() in error for marker in self.PRODUCT_UNAVAILABLE_MARKERS)
def _stage_text(self, task) -> str:
if self.is_unmatched(task):
return "略过"
unmatched = self.is_unmatched(task)
if unmatched or getattr(task, "status", "") == "skipped":
return skipped_stage_text(
getattr(task, "last_error", ""),
alias_matched=not unmatched,
)
if self._is_product_unavailable(task):
return "商品失效"
if task.status in self.STATUS_TEXT and task.status != "pending":