feat(history): add multi-account and WhatsApp foundation

This commit is contained in:
wmq
2026-07-30 00:14:32 +08:00
parent 7f09132fad
commit 9804341463
43 changed files with 7484 additions and 290 deletions
+6 -6
View File
@@ -70,7 +70,7 @@ export function InsightPanel({
conversationId: conversation.id,
ownerId: user?.id || '',
dueAt: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
note: `由 AI 客户洞察建议创建:${title}`,
note: `由客户洞察建议创建:${title}`,
}),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['tasks'] })
@@ -84,7 +84,7 @@ export function InsightPanel({
try {
const result = await analyzeConversation(conversation.id)
setAnalysis(result.summary)
toast.success('AI 分析完成', `意向评分 ${result.intentScore} · ${INTENT_LEVELS.find(l => l.value === result.intentLevel)?.label}`)
toast.success('会话分析完成', `意向评分 ${result.intentScore} · ${INTENT_LEVELS.find(l => l.value === result.intentLevel)?.label}`)
} catch {
toast.error('分析失败,请稍后重试')
} finally { setAnalyzing(false) }
@@ -180,8 +180,8 @@ export function InsightPanel({
<div className="rounded-2xl border border-slate-200/80 bg-white p-4">
<div className="flex items-center justify-between">
<div>
<p className="text-sm font-semibold tracking-tight text-slate-900">AI 洞察摘要</p>
<p className="text-[11px] text-slate-400">基于完整对话实时更新</p>
<p className="text-sm font-semibold tracking-tight text-slate-900">会话摘要</p>
<p className="text-[11px] text-slate-400">根据已同步的会话内容生成</p>
</div>
<Button variant="ghost" size="sm" onClick={handleAnalyze} disabled={analyzing}>
{analyzing ? <Spinner className="h-3 w-3" /> : '重新分析'}
@@ -193,7 +193,7 @@ export function InsightPanel({
<span className="ml-2 text-sm text-muted-foreground">正在分析会话上下文…</span>
</div>
) : (
<p className="mt-3 text-xs leading-6 text-slate-600">{analysis || 'AI 正在根据会话完善客户画像。'}</p>
<p className="mt-3 text-xs leading-6 text-slate-600">{analysis || '收到更多客户消息后将补充客户画像。'}</p>
)}
{/* AI 提取关键信息 */}
{Object.values(customer.aiProfile || {}).some(Boolean) && (
@@ -240,7 +240,7 @@ export function InsightPanel({
{/* 推荐动作 */}
<div className="p-4">
<h4 className="text-xs font-semibold text-slate-500">AI 推荐下一步</h4>
<h4 className="text-xs font-semibold text-slate-500">下一步建议</h4>
<div className="mt-2 space-y-2">
{customer.aiProfile.nextActions.map((a) => (
<button