feat(schedule): 新增平台任务参数契约与动态选项支持

This commit is contained in:
hugo committed 2026-07-09 13:19:36 +08:00
1 parent 2ce1aca023
commit 8b5b0b49bf
76 files changed
+7103 -1203

No files matched your search

@@ -3,6 +3,7 @@
* 用途:发货通知聊天编排入口,组合 shipping/* 子模块并对 ChatView 暴露统一交互能力。
* 依赖:shipping.api、shipping/ 下各 handler 工厂、chat.deps、chat.types、Vue refs/computed/watch。
* 逻辑:上游由 ChatView/ChatPage 调用本 composable;本文件再把任务状态、动作刷新、文件上传、决策与发送拦截分发给 shipping 子模块。
* 批次「重试所有失败」成功后不弹居中 msg.success,由页面级 toast 展示 started/skipped。
*/
import {
@@ -816,25 +817,35 @@ export function useChatShipping(options: UseChatShippingOptions) {
return true;
};
const retryCurrentShippingBatchPendingTasks = async () => {
/**
* 重试当前聚焦批次中可恢复的失败/排队任务。
* 核心逻辑:调 workspace retry-pending → 刷新会话工作台/批次摘要/动作;成功反馈交给页面级非阻塞 toast,避免居中成功弹窗。
* @returns 成功时返回 started/skipped;失败或跳过时返回 null
*/
const retryCurrentShippingBatchPendingTasks = async (): Promise<{
started: number;
skipped: number;
} | null> => {
const batchNo = getActiveShippingBatchNo();
if (!batchNo || retryingShippingPendingTasks.value) return false;
if (!batchNo || retryingShippingPendingTasks.value) return null;
if (isShippingActionBusy.value) {
msg.warning(t('chat.shippingNoticeUi.actionBusyHint'));
return false;
return null;
}
retryingShippingPendingTasks.value = true;
try {
const { retryWorkspaceShippingBatchPending } = await import('@/features/chat/api/shipping.api');
const result = await retryWorkspaceShippingBatchPending(batchNo);
msg.success(result.message || t('chat.shippingNoticeUi.retryPendingDone'));
await syncShippingConversationWorkspace();
await syncShippingBatchSummary(batchNo);
await refreshShippingActions();
return true;
return {
started: Number(result.started ?? 0),
skipped: Number(result.skipped ?? 0),
};
} catch (error) {
msg.error(error instanceof Error ? error.message : t('chat.shippingNoticeUi.retryFailed'));
return false;
return null;
} finally {
retryingShippingPendingTasks.value = false;
}