refactor(shipping-ui): 收口订单复核与库存流程前端投影

This commit is contained in:
hugo committed 2026-09-04 21:01:59 +08:00
1 parent 265a6e179a
commit 4e8b2f8db2
27 files changed
+618 -407

No files matched your search

@@ -25,6 +25,12 @@ const TERMINAL_STATUSES = new Set([
'completed',
'cancelled',
]);
/** 用户态“中断/失败/等待人工”状态:结果不会自行变化,停止轮询(约定:中断不轮询)。 */
const INTERRUPTED_USER_STATUSES = new Set([
'waiting_human',
'failed',
'interrupted',
]);
export type ShippingProcessingWorkItemTypeArg = 'order_intake' | 'order_task';
@@ -115,7 +121,12 @@ export function useShippingProcessingWorkItem(
error.value = null;
clearTimer();
const next = projection.value;
if (continuousPolling && next && !TERMINAL_STATUSES.has(next.status) && !stopped) {
const userStatus = String(next?.userStatus || '').trim().toLowerCase();
const stoppedByState = Boolean(next) && (
TERMINAL_STATUSES.has(next!.status)
|| INTERRUPTED_USER_STATUSES.has(userStatus)
);
if (continuousPolling && next && !stoppedByState && !stopped) {
timer = window.setTimeout(() => {
void refresh();
}, pollMs);