feat(shipping-notice): 增加发货通知建单幂等性支持及内容哈希校验

This commit is contained in:
hugo committed 2026-07-14 00:28:52 +08:00
1 parent 0a9bd6415d
commit 143e054d86
39 files changed
+1750 -80

No files matched your search

@@ -61,6 +61,7 @@ export interface ShippingSendHandlerContext {
handleShippingMenuAction: (action: ShippingActionButton | { id?: string; message: string; label?: string; source_code?: string }) => Promise<void>;
handleShippingAutoUploadFile: (file: File) => Promise<void>;
handleShippingAutoUploadNoticeBatch: (files: File[]) => Promise<void>;
isShippingNoticeBatchSubmitting?: () => boolean;
refreshShippingActions: () => Promise<void>;
shippingSuggestedPrompt: ComputedRef<string>;
isShippingShortageQueryIntent: (text: string) => boolean;
@@ -189,6 +190,10 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
if (!(ctx.shippingAutoFlowRequested.value || !trimmed)) return false;
if (!ctx.isShippingNoticeAgent.value || ctx.attachments.value.length === 0) return false;
if (ctx.isThinking.value || ctx.isUploadingAttachments.value) return false;
if (ctx.isShippingNoticeBatchSubmitting?.()) {
ctx.msg.info(ctx.t('chat.shippingNoticeBatchSubmitting'));
return true;
}
const requestedAutoFlow = ctx.shippingAutoFlowRequested.value;
ctx.shippingAutoFlowRequested.value = false;
const localFiles = ctx.attachments.value.filter((a) => a.kind === 'local') as Array<Extract<PendingAttachment, { kind: 'local' }>>;