fix: 中文显示任务当前步骤 (#39)
This commit is contained in:
@@ -48,6 +48,19 @@ TASK_STATUS_TEXT = {
|
||||
TaskStatus.CANCELLED: "已取消",
|
||||
}
|
||||
|
||||
CURRENT_STEP_TEXT = {
|
||||
"open_goods": "正在打开商品页面",
|
||||
"collecting": "正在采集商品信息",
|
||||
"collect_skus": "正在采集颜色、价格和尺码",
|
||||
"select_options": "正在选择商品规格",
|
||||
"placing_order": "正在提交订单",
|
||||
"reconcile_order": "正在核对订单",
|
||||
"submit_result": "正在提交任务结果",
|
||||
"completed": "已完成",
|
||||
"failed": "执行失败",
|
||||
"interrupted": "上次执行中断",
|
||||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ColorPriceView:
|
||||
@@ -206,7 +219,11 @@ def build_task_detail_view_data(detail: TaskDetail) -> TaskDetailViewData:
|
||||
title=_non_empty_text(pdd_data.get("title")) or detail.title or "未采集",
|
||||
goods_id=_non_empty_text(pdd_data.get("goods_id")) or detail.goods_id or "—",
|
||||
goods_url=detail.goods_url,
|
||||
current_step=detail.current_step or "—",
|
||||
current_step=(
|
||||
CURRENT_STEP_TEXT.get(detail.current_step, "未知步骤")
|
||||
if detail.current_step
|
||||
else "—"
|
||||
),
|
||||
target_spec=target_spec,
|
||||
quantity=str(detail.quantity) if detail.quantity is not None else "—",
|
||||
updated_at=detail.updated_at,
|
||||
|
||||
Reference in New Issue
Block a user