feat(shipping-notice): 完成货代发货通知全流程开发与代码重构
- 新增PO号提取、预约ID解析(支持`PR@xxx`格式)工具,完善库存匹配逻辑 - 新增库存映射缓存、匹配/解析结果格式化摘要,优化用户提示 - 修复数据库迁移脚本未检查表存在的问题,避免全新部署失败 - 新增路径工具类统一管理相对路径,优化配置文件处理逻辑 - 归档旧文档,将部署、Dify配置合并到`shipping_notice.md` - 新增完整单元测试与集成测试覆盖核心流程 - 更新前端国际化与会话管理逻辑,优化界面交互
This commit is contained in:
1 parent
b62082758b
commit
8deae3146b
65 files changed
+6477
-1937
No files matched your search
@@ -22,7 +22,7 @@ interface ChatMessage {
|
||||
// 对话消息结构:用户/助手文本 + 可选的来源与归因信息
|
||||
role: 'user' | 'assistant';
|
||||
content: string;
|
||||
type?: 'text' | 'leave-form' | 'leave-confirmation' | 'leave-result';
|
||||
type?: 'text' | 'leave-form' | 'leave-confirmation' | 'leave-result' | 'shipping-inventory-mapping';
|
||||
retriever_resources?: RetrieverResource[];
|
||||
attribution_parts?: string[];
|
||||
chat_log_id?: number;
|
||||
@@ -174,6 +174,14 @@ export function useChat() {
|
||||
activeRunId.value = null;
|
||||
};
|
||||
|
||||
const loadConversationState = (id: string, nextMessages: ChatMessage[]) => {
|
||||
viewId.value += 1;
|
||||
activeRunId.value = null;
|
||||
isThinking.value = false;
|
||||
messages.value = nextMessages;
|
||||
conversationId.value = id;
|
||||
};
|
||||
|
||||
/**
|
||||
* sendMessage
|
||||
* 用途:发送消息并处理 SSE 流式响应
|
||||
@@ -402,5 +410,5 @@ export function useChat() {
|
||||
return text.replace(/\\n/g, '\n');
|
||||
};
|
||||
|
||||
return { messages, isThinking, conversationId, runs, activeRunId, activateRun, createNewChatView, sendMessage };
|
||||
return { messages, isThinking, conversationId, runs, activeRunId, activateRun, createNewChatView, loadConversationState, sendMessage };
|
||||
}
|
||||
Reference in new issue
Block a user