feat(shipping-notice): 完善发货通知自动推进与多库存源复核闭环

This commit is contained in:
hugo committed 2026-08-09 11:43:53 +08:00
1 parent cfa19a0b7b
commit 8e0bbf7a81
180 files changed
+31210 -1864

No files matched your search

@@ -67,8 +67,8 @@ const ACTION_CODE_TO_INTENT: Record<string, ShippingProcessingActionIntent> = {
const AUTOMATING_STATUSES = new Set(['processing', 'automating', 'queued']);
const NEEDS_ACTION_STATUSES = new Set([
'blocked', 'waiting_review', 'pending_review', 'failed', 'reparse_failed',
'manual_upload_pending', 'upload_rpa_failed',
'blocked', 'waiting_review', 'pending_review', 'waiting_human',
'failed', 'reparse_failed', 'manual_upload_pending', 'upload_rpa_failed',
]);
/** 永不升为主 CTA 的动作码(仍可作次要/溢出)。 */
const NEVER_PRIMARY_CODES = new Set(['cancel_task', 'cancel_run', 'view_details']);
@@ -217,7 +217,7 @@ export function resolveProcessingActionPresentation(
items.push(toItem(code, intent, surface));
};
pushCode(projection.currentGate?.nextActionCode);
pushCode(projection.primaryAction?.code || projection.currentGate?.nextActionCode);
// [ORDER-STABLE] 对 availableActions 标准化(去重 + 字典序排序),确保后端返回顺序不影响前端按钮顺序。
const normalizedAvailableActions = normalizeActionCodes(projection.availableActions || []);
for (const action of normalizedAvailableActions) {
@@ -250,7 +250,9 @@ export function resolveConversationTaskActionPresentation(
if (!task) return empty;
const surface = options?.surface || 'right';
const status = String(task.status_label || '').trim().toLowerCase();
const userStatus = String(task.userStatus ?? '').trim().toLowerCase();
const legacyStatus = String(task.status_label ?? '').trim().toLowerCase();
const status = userStatus || legacyStatus;
const isNeedsAction = task.group === 'needs_action' || NEEDS_ACTION_STATUSES.has(status);
const isProcessing = task.group === 'processing' || AUTOMATING_STATUSES.has(status);
if (task.group === 'history' || status === 'cancelled') {
@@ -270,7 +272,7 @@ export function resolveConversationTaskActionPresentation(
items.push(toItem(code, intent, surface));
};
pushCode(task.primary_action);
pushCode(task.primaryAction?.code || task.primary_action);
// [ORDER-STABLE] 对 available_actions 标准化排序,确保后端顺序变化不影响按钮渲染顺序。
const normalizedTaskActions = normalizeActionCodes(task.available_actions || []);
for (const action of normalizedTaskActions) {