fix(任务面板): 轻量轮询下任务开始/结束时间恒显 -- 的显示修复
F5 轻量化轮询改造后,light 端点白名单不含 createdAt/finishedAt, 任务快照只含 id/status,三个直接读快照时间的页面(产品风险/店铺匹配/跟价) 任务卡片开始/结束时间恒为 '-'。 后端 /history 的 buildHistoryItemVo 本就由任务实体填充这两个字段, 前端历史项字段兜底即可,无需动 JAR。同时在轮询适配器注释中固化该前提, 防止后续页面再裸读快照时间。
This commit is contained in:
@@ -9,6 +9,8 @@ import { getModuleProgressLight, type ProgressLightModule } from './progress-lig
|
||||
*
|
||||
* 安全前提(务必确认后再接入):
|
||||
* 1. 调用方只用 task.id / task.status / missingTaskIds(轻量白名单覆盖的字段);
|
||||
* createdAt/finishedAt 不在白名单内——展示这两个时间的页面必须用历史项字段兜底
|
||||
* (后端 /history 由任务实体填充,见各模块 buildHistoryItemVo),否则任务卡片恒显 "-";
|
||||
* 2. 调用方把结果**部分合并**到已有完整快照上(`{...prev.task, ...detail.task}`),
|
||||
* 这样缺失字段由旧快照兜底,不会把页面数据抹空。
|
||||
*
|
||||
|
||||
@@ -49,6 +49,9 @@ export interface PriceTrackHistoryItem {
|
||||
loopRunId?: number;
|
||||
roundIndex?: number;
|
||||
shopName?: string;
|
||||
/** 任务创建时间(后端历史装配由任务实体填充;轻量轮询不含此字段,仅作兜底显示) */
|
||||
createdAt?: string;
|
||||
finishedAt?: string;
|
||||
shopMallName?: string;
|
||||
shopId?: number | string | null;
|
||||
platform?: string;
|
||||
|
||||
@@ -67,6 +67,9 @@ export interface ProductRiskHistoryItem {
|
||||
resultId?: number;
|
||||
taskId?: number;
|
||||
shopName?: string;
|
||||
/** 任务创建时间(后端 buildHistoryItemVo 由任务实体填充;快照路径为 null) */
|
||||
createdAt?: string;
|
||||
finishedAt?: string;
|
||||
shopId?: string;
|
||||
platform?: string;
|
||||
companyName?: string;
|
||||
|
||||
Reference in New Issue
Block a user