refactor(shipping-ui): 收口订单复核与库存流程前端投影
This commit is contained in:
1 parent
265a6e179a
commit
4e8b2f8db2
27 files changed
+618
-407
No files matched your search
@@ -2,7 +2,8 @@
|
||||
* features/chat/shipping/orderExtractionProgressDisplay.ts
|
||||
* 用途:订单抽取进度展示的纯函数(阶段文案 key、耗时格式化),禁止前端发明阶段码。
|
||||
* 依赖:无;由 ShippingOrderExtractionCard / ShippingWorkflowTimeline 调用。
|
||||
* 逻辑:仅映射后端投影字段到 i18n key 与可读耗时;阈值与阶段判定一律以后端为准。
|
||||
* 逻辑:仅映射后端投影字段到 i18n key 与可读耗时;阈值与阶段判定一律以后端为准;
|
||||
* v2 新增 run 级阶段/状态 key 唯一出口(任务中心与聊天卡同源,输出不变契约见 spec §5.5)。
|
||||
*/
|
||||
|
||||
/** 将秒数格式化为「Xm Ys」风格;空值返回空串。 */
|
||||
@@ -35,3 +36,20 @@ export function resolveOrderExtractionUserStageKey(
|
||||
if (status) return `chat.shippingOrderExtractionDocumentStatus.${status}`;
|
||||
return 'chat.shippingOrderExtractionActivity.generic_processing';
|
||||
}
|
||||
|
||||
/**
|
||||
* run 级阶段/状态展示 key 的唯一出口(任务中心「我的识别」与聊天抽取卡同源消费)。
|
||||
* 核心逻辑:有 user_visible_stage → UserStage 短语文案族;否则回退 run status 的
|
||||
* CardTitle 文案族。仅做事实→key 的受控映射,禁止发明新阶段码。
|
||||
* @param userVisibleStage - 后端 current_activity.user_visible_stage
|
||||
* @param runStatus - 后端 run.status(queued/processing/completed/…)
|
||||
* @returns i18n key(输出不变契约:与改造前页面内联字面量逐字一致)
|
||||
*/
|
||||
export function resolveOrderExtractionRunStageKey(
|
||||
userVisibleStage: string | null | undefined,
|
||||
runStatus: string,
|
||||
): string {
|
||||
const stage = String(userVisibleStage || '').trim();
|
||||
if (stage) return `chat.shippingOrderExtractionUserStage.${stage}`;
|
||||
return `chat.shippingOrderExtractionCardTitle.${String(runStatus || '').trim()}`;
|
||||
}
|
||||
Reference in new issue
Block a user