refactor(shipping-notice): 统一料号字段,移除过时的 SKU 相关字段,更新相关逻辑以支持新字段命名

This commit is contained in:
hugo committed 2026-07-16 20:02:33 +08:00
1 parent dde25344ca
commit 46eb63f5bb
111 files changed
+3116 -1250

No files matched your search

@@ -10,6 +10,7 @@ import { copyTextToClipboard } from '@/shared/utils/clipboard';
import type { ChatMessage, ChatMessageAttachment } from '../types/chat.types';
import type { SendMessageLifecycleHooks } from '../composables/useChat';
import type { ChatUploadFileSpec } from '../types/shipping.types';
import type { ChatMessageSendResult } from '../types/chat-turn.types';
import type { ComputedRef, Ref } from 'vue';
const looksLikeCompletedAssistantReply = (content: string) => {
@@ -55,7 +56,7 @@ export interface ChatPageSendContext {
files: ChatUploadFileSpec[],
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; display_query?: string },
hooks?: SendMessageLifecycleHooks,
) => Promise<boolean | void>;
) => Promise<ChatMessageSendResult>;
refreshHistoryAfterSend: () => Promise<void>;
refreshConversationAfterSend?: () => Promise<void>;
tryHandleShippingAttachmentAutoFlow: (
@@ -133,7 +134,8 @@ export function createChatPageSendApi(ctx: ChatPageSendContext) {
}
}
if (typeof textOrEvent !== 'string') ctx.input.value = '';
const shouldClearInput = typeof textOrEvent !== 'string';
if (shouldClearInput) ctx.input.value = '';
const requestContent = trimmed || ctx.t('chat.attachment.defaultPrompt');
const sendContext = {
@@ -152,7 +154,10 @@ export function createChatPageSendApi(ctx: ChatPageSendContext) {
onAssistantMessageFinished: ctx.onAssistantMessageFinished,
},
);
if (sent === false) return;
if (!sent.accepted) {
if (shouldClearInput) ctx.input.value = content;
return;
}
ctx.clearAttachments();
await ctx.refreshHistoryAfterSend();
await ctx.refreshConversationAfterSend?.();