feat(shipping-notice): 落地 XFA 统一视觉拆分确认门禁与处理投影收敛
闭合拆分预览令牌单次消费、样本 checksum 绑定与确认审计;正式提取改为 bindings-only。 同步统一标注工作台交互,并补齐进度投影/任务中心与迁移文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
d2b3d74def
commit
84a881b554
195 files changed
+20269
-3463
No files matched your search
@@ -116,6 +116,7 @@ export function useShippingNoticeWorkflow(
|
||||
let pollGeneration = 0;
|
||||
let requestController: AbortController | null = null;
|
||||
let requestGeneration = 0;
|
||||
let inFlightRefresh: { conversationId: string; promise: Promise<void> } | null = null;
|
||||
let failureCount = 0;
|
||||
let pollingStopped = false;
|
||||
|
||||
@@ -151,17 +152,10 @@ export function useShippingNoticeWorkflow(
|
||||
/**
|
||||
* 仅拉取统一 shipping-processing 投影。
|
||||
* 核心逻辑:work_items 非空时始终由 order_task 合成任务列表;embedded 仅补焦点元数据;
|
||||
* 新请求会中止旧请求,且只有最新一代请求可回写 loading / error / 会话数据。
|
||||
* 同会话在途请求合并;跨会话请求中止,且只有最新一代可回写页面数据。
|
||||
* @returns Promise<void>;可恢复网络失败写入 error,不向页面抛出。
|
||||
*/
|
||||
async function refresh(): Promise<void> {
|
||||
const conversationId = normalizedConversationId.value;
|
||||
if (!conversationId) {
|
||||
processing.value = null;
|
||||
processingWorkItems.value = [];
|
||||
error.value = null;
|
||||
return;
|
||||
}
|
||||
async function executeRefresh(conversationId: string): Promise<void> {
|
||||
const generation = ++requestGeneration;
|
||||
loading.value = true;
|
||||
const controller = createRequestController();
|
||||
@@ -196,6 +190,27 @@ export function useShippingNoticeWorkflow(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 拉取统一进度;同一会话已有请求时复用该 Promise,避免首屏触发源互相取消重发。
|
||||
*/
|
||||
function refresh(): Promise<void> {
|
||||
const conversationId = normalizedConversationId.value;
|
||||
if (!conversationId) {
|
||||
processing.value = null;
|
||||
processingWorkItems.value = [];
|
||||
error.value = null;
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (inFlightRefresh?.conversationId === conversationId) {
|
||||
return inFlightRefresh.promise;
|
||||
}
|
||||
const promise = executeRefresh(conversationId).finally(() => {
|
||||
if (inFlightRefresh?.promise === promise) inFlightRefresh = null;
|
||||
});
|
||||
inFlightRefresh = { conversationId, promise };
|
||||
return promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 focus/viewed/submit 写路径响应应用到本地 processing 与 work_items。
|
||||
* 核心逻辑:有 work_items 时用统一合成;否则仅回写 processing 兼容块。
|
||||
|
||||
Reference in new issue
Block a user