feat(shipping-notice): 新增货代客户管理功能,支持客户导入、识别证据管理与客户确认
This commit is contained in:
1 parent
b595e157e9
commit
4fbaed2b4c
176 files changed
+14011
-994
No files matched your search
@@ -1,11 +1,10 @@
|
||||
/**
|
||||
* features/chat/shipping/shippingTaskId.ts
|
||||
* 用途:从消息或会话历史中识别发货任务编号(SN- 格式)。
|
||||
* 用途:从聊天消息中识别发货任务编号(SN- 格式)。
|
||||
* 依赖:constants/shipping.SHIPPING_TASK_ID_RE、chat.types。
|
||||
* 逻辑:useChatShipping 切换任务/恢复会话时调用。
|
||||
* 逻辑:useChatShipping 与 shipping refresh 只把这里作为消息级兜底,不再承担历史标题猜测。
|
||||
*/
|
||||
import { SHIPPING_TASK_ID_RE } from '../constants/shipping';
|
||||
import type { ChatSessionItem } from '../types/chat.types';
|
||||
|
||||
/** 从消息列表倒序查找最近出现的 SN- 任务编号。 */
|
||||
export function findLatestShippingTaskId(msgs: Array<{ content?: string }>): string {
|
||||
@@ -15,13 +14,3 @@ export function findLatestShippingTaskId(msgs: Array<{ content?: string }>): str
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/** 在侧栏历史中按标题模糊匹配含 taskId 的会话。 */
|
||||
export function findHistorySessionForShippingTask(
|
||||
history: ChatSessionItem[],
|
||||
taskId: string,
|
||||
): ChatSessionItem | null {
|
||||
const needle = taskId.trim().toUpperCase();
|
||||
if (!needle) return null;
|
||||
return history.find((item) => String(item.title || '').toUpperCase().includes(needle)) || null;
|
||||
}
|
||||
Reference in new issue
Block a user