chore: initial baseline with P0-safety .gitignore
This commit is contained in:
@@ -0,0 +1,846 @@
|
||||
// =============================================================================
|
||||
// IT智能服务台 — 统一模拟数据源
|
||||
// =============================================================================
|
||||
// 说明:为所有模块提供丰富的 mock 数据,覆盖各种状态/优先级/边界场景
|
||||
// 当后端 API 不可用时,Store 可回退使用此数据,确保前端可独立运行和演示
|
||||
// =============================================================================
|
||||
|
||||
import type { Conversation, ConversationListData } from '../api/conversation'
|
||||
import type { Message, MessageListData } from '../api/message'
|
||||
import type { TodoItemData, TodoItemListData } from '../api/todo'
|
||||
import type { Agent, AgentListData, LoginData } from '../api/agent'
|
||||
import type { DraftResult, SummaryResult, TagsResult } from '../api/wingman'
|
||||
|
||||
// =========================================================================
|
||||
// 1. 会话列表 mock — 10条,覆盖全部状态/优先级/标记组合
|
||||
// =========================================================================
|
||||
|
||||
const now = new Date('2026-06-06T10:30:00+08:00')
|
||||
const min = (n: number) => new Date(now.getTime() - n * 60000).toISOString()
|
||||
const hour = (n: number) => new Date(now.getTime() - n * 3600000).toISOString()
|
||||
|
||||
export const mockConversations: Conversation[] = [
|
||||
// --- 我的会话 (is_mine=true) ---
|
||||
{
|
||||
id: 'conv-001',
|
||||
employee_id: 'zhangwei',
|
||||
employee_name: '张伟',
|
||||
department: '研发一部',
|
||||
position: '高级工程师',
|
||||
level: 'gold',
|
||||
status: 'serving',
|
||||
is_vip: true,
|
||||
is_pinned: false,
|
||||
is_todo: false,
|
||||
urgency_score: 5,
|
||||
tags: {
|
||||
hand_raise: true,
|
||||
need_intervene: false,
|
||||
emotion: 'anxious',
|
||||
emotion_keywords: ['试了3次', '都不行', '紧急'],
|
||||
repeat_count: 3,
|
||||
},
|
||||
assigned_agent_id: 'agent-1',
|
||||
last_message_at: min(2).toString(),
|
||||
last_message_summary: '按你说的操作了,已经可以正常连接了',
|
||||
created_at: hour(1).toString(),
|
||||
updated_at: min(2).toString(),
|
||||
is_mine: true,
|
||||
assigned_agent_name: '宋献',
|
||||
can_grab: false,
|
||||
collaborating_agent_ids: [],
|
||||
collaborating_agent_names: {},
|
||||
is_collaborator: false,
|
||||
impact_scope: 12,
|
||||
is_blocking: true,
|
||||
emotion_state: 'anxious',
|
||||
participants: [],
|
||||
},
|
||||
{
|
||||
id: 'conv-002',
|
||||
employee_id: 'chenfang',
|
||||
employee_name: '陈芳',
|
||||
department: '市场部',
|
||||
position: '部门经理',
|
||||
level: 'silver',
|
||||
status: 'serving',
|
||||
is_vip: false,
|
||||
is_pinned: false,
|
||||
is_todo: false,
|
||||
urgency_score: 4,
|
||||
tags: {
|
||||
hand_raise: false,
|
||||
need_intervene: false,
|
||||
emotion: 'worried',
|
||||
emotion_keywords: ['着急', '客户等着'],
|
||||
repeat_count: 1,
|
||||
},
|
||||
assigned_agent_id: 'agent-1',
|
||||
last_message_at: min(8).toString(),
|
||||
last_message_summary: '好的,我等您排查结果',
|
||||
created_at: hour(2).toString(),
|
||||
updated_at: min(8).toString(),
|
||||
is_mine: true,
|
||||
assigned_agent_name: '宋献',
|
||||
can_grab: false,
|
||||
collaborating_agent_ids: [],
|
||||
collaborating_agent_names: {},
|
||||
is_collaborator: false,
|
||||
impact_scope: 3,
|
||||
is_blocking: false,
|
||||
emotion_state: 'worried',
|
||||
participants: [],
|
||||
},
|
||||
{
|
||||
id: 'conv-003',
|
||||
employee_id: 'lina',
|
||||
employee_name: '李娜',
|
||||
department: '行政部',
|
||||
position: '行政专员',
|
||||
level: 'bronze',
|
||||
status: 'queued',
|
||||
is_vip: false,
|
||||
is_pinned: false,
|
||||
is_todo: false,
|
||||
urgency_score: 2,
|
||||
tags: {
|
||||
hand_raise: false,
|
||||
need_intervene: false,
|
||||
emotion: 'calm',
|
||||
emotion_keywords: [],
|
||||
repeat_count: 0,
|
||||
},
|
||||
assigned_agent_id: null,
|
||||
last_message_at: min(15).toString(),
|
||||
last_message_summary: '打印机卡纸了,怎么处理?',
|
||||
created_at: min(15).toString(),
|
||||
updated_at: min(15).toString(),
|
||||
is_mine: true,
|
||||
assigned_agent_name: null,
|
||||
can_grab: false,
|
||||
collaborating_agent_ids: [],
|
||||
collaborating_agent_names: {},
|
||||
is_collaborator: false,
|
||||
impact_scope: 1,
|
||||
is_blocking: false,
|
||||
emotion_state: 'calm',
|
||||
participants: [],
|
||||
},
|
||||
{
|
||||
id: 'conv-004',
|
||||
employee_id: 'wanglei',
|
||||
employee_name: '王磊',
|
||||
department: '财务部',
|
||||
position: '财务主管',
|
||||
level: 'silver',
|
||||
status: 'serving',
|
||||
is_vip: false,
|
||||
is_pinned: false,
|
||||
is_todo: false,
|
||||
urgency_score: 5,
|
||||
tags: {
|
||||
hand_raise: true,
|
||||
need_intervene: true,
|
||||
emotion: 'urgent',
|
||||
emotion_keywords: ['报税截止', '马上', '很急'],
|
||||
repeat_count: 5,
|
||||
},
|
||||
assigned_agent_id: 'agent-1',
|
||||
last_message_at: min(5).toString(),
|
||||
last_message_summary: '税控系统还是登录不上,下午要报税了',
|
||||
created_at: hour(3).toString(),
|
||||
updated_at: min(5).toString(),
|
||||
is_mine: true,
|
||||
assigned_agent_name: '宋献',
|
||||
can_grab: false,
|
||||
collaborating_agent_ids: [],
|
||||
collaborating_agent_names: {},
|
||||
is_collaborator: false,
|
||||
impact_scope: 8,
|
||||
is_blocking: true,
|
||||
emotion_state: 'urgent',
|
||||
participants: [],
|
||||
},
|
||||
{
|
||||
id: 'conv-005',
|
||||
employee_id: 'liuyang',
|
||||
employee_name: '刘洋',
|
||||
department: '销售部',
|
||||
position: '销售总监',
|
||||
level: 'platinum',
|
||||
status: 'serving',
|
||||
is_vip: true,
|
||||
is_pinned: true,
|
||||
is_todo: false,
|
||||
urgency_score: 5,
|
||||
tags: {
|
||||
hand_raise: true,
|
||||
need_intervene: false,
|
||||
emotion: 'angry',
|
||||
emotion_keywords: ['太慢了', '耽误时间', '投诉'],
|
||||
repeat_count: 4,
|
||||
},
|
||||
assigned_agent_id: 'agent-1',
|
||||
last_message_at: min(3).toString(),
|
||||
last_message_summary: '这个问题已经拖了三天了,请尽快解决',
|
||||
created_at: hour(24).toString(),
|
||||
updated_at: min(3).toString(),
|
||||
is_mine: true,
|
||||
assigned_agent_name: '宋献',
|
||||
can_grab: false,
|
||||
collaborating_agent_ids: ['agent-2'],
|
||||
collaborating_agent_names: { 'agent-2': '刘明' },
|
||||
is_collaborator: false,
|
||||
impact_scope: 20,
|
||||
is_blocking: true,
|
||||
emotion_state: 'angry',
|
||||
participants: [
|
||||
{ id: 'zhaoliu', name: '赵六', department: '人力资源部', type: 'employee', avatar: '', joined: true, joined_at: min(10).toString() },
|
||||
{ id: 'qianqi', name: '钱七', department: '财务部', type: 'employee', avatar: '', joined: false },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'conv-006',
|
||||
employee_id: 'sunli',
|
||||
employee_name: '孙丽',
|
||||
department: '法务部',
|
||||
position: '法务专员',
|
||||
level: 'bronze',
|
||||
status: 'queued',
|
||||
is_vip: false,
|
||||
is_pinned: false,
|
||||
is_todo: false,
|
||||
urgency_score: 3,
|
||||
tags: {
|
||||
hand_raise: false,
|
||||
need_intervene: false,
|
||||
emotion: 'confused',
|
||||
emotion_keywords: ['不懂', '怎么操作'],
|
||||
repeat_count: 2,
|
||||
},
|
||||
assigned_agent_id: null,
|
||||
last_message_at: min(20).toString(),
|
||||
last_message_summary: '合同管理系统登录后看不到审批列表',
|
||||
created_at: min(20).toString(),
|
||||
updated_at: min(20).toString(),
|
||||
is_mine: true,
|
||||
assigned_agent_name: null,
|
||||
can_grab: false,
|
||||
collaborating_agent_ids: [],
|
||||
collaborating_agent_names: {},
|
||||
is_collaborator: false,
|
||||
impact_scope: 1,
|
||||
is_blocking: false,
|
||||
emotion_state: 'confused',
|
||||
participants: [],
|
||||
},
|
||||
// --- 同事会话 (is_collaborator=true 或 由其他坐席处理) ---
|
||||
{
|
||||
id: 'conv-007',
|
||||
employee_id: 'zhaomin',
|
||||
employee_name: '赵敏',
|
||||
department: '人力资源部',
|
||||
position: 'HR经理',
|
||||
level: 'silver',
|
||||
status: 'ai_handling',
|
||||
is_vip: false,
|
||||
is_pinned: false,
|
||||
is_todo: false,
|
||||
urgency_score: 2,
|
||||
tags: {
|
||||
hand_raise: false,
|
||||
need_intervene: false,
|
||||
emotion: 'calm',
|
||||
emotion_keywords: [],
|
||||
repeat_count: 0,
|
||||
},
|
||||
assigned_agent_id: 'agent-2',
|
||||
last_message_at: min(30).toString(),
|
||||
last_message_summary: '新员工入职需要开通账号权限',
|
||||
created_at: min(30).toString(),
|
||||
updated_at: min(30).toString(),
|
||||
is_mine: false,
|
||||
assigned_agent_name: '刘明',
|
||||
can_grab: true,
|
||||
collaborating_agent_ids: [],
|
||||
collaborating_agent_names: {},
|
||||
is_collaborator: false,
|
||||
impact_scope: 0,
|
||||
is_blocking: false,
|
||||
emotion_state: 'calm',
|
||||
participants: [],
|
||||
},
|
||||
{
|
||||
id: 'conv-008',
|
||||
employee_id: 'huangqiang',
|
||||
employee_name: '黄强',
|
||||
department: '产品部',
|
||||
position: '产品经理',
|
||||
level: 'bronze',
|
||||
status: 'ai_handling',
|
||||
is_vip: false,
|
||||
is_pinned: false,
|
||||
is_todo: false,
|
||||
urgency_score: 2,
|
||||
tags: {
|
||||
hand_raise: true,
|
||||
need_intervene: false,
|
||||
emotion: 'neutral',
|
||||
emotion_keywords: [],
|
||||
repeat_count: 1,
|
||||
},
|
||||
assigned_agent_id: null,
|
||||
last_message_at: min(25).toString(),
|
||||
last_message_summary: 'Figma 插件无法安装,需要管理员权限',
|
||||
created_at: min(25).toString(),
|
||||
updated_at: min(25).toString(),
|
||||
is_mine: false,
|
||||
assigned_agent_name: null,
|
||||
can_grab: true,
|
||||
collaborating_agent_ids: [],
|
||||
collaborating_agent_names: {},
|
||||
is_collaborator: false,
|
||||
impact_scope: 0,
|
||||
is_blocking: false,
|
||||
emotion_state: 'neutral',
|
||||
participants: [],
|
||||
},
|
||||
{
|
||||
id: 'conv-009',
|
||||
employee_id: 'chenjing_collab',
|
||||
employee_name: '周杰',
|
||||
department: '运维部',
|
||||
position: '运维工程师',
|
||||
level: 'gold',
|
||||
status: 'serving',
|
||||
is_vip: false,
|
||||
is_pinned: false,
|
||||
is_todo: false,
|
||||
urgency_score: 3,
|
||||
tags: {
|
||||
hand_raise: false,
|
||||
need_intervene: false,
|
||||
emotion: 'calm',
|
||||
emotion_keywords: [],
|
||||
repeat_count: 0,
|
||||
},
|
||||
assigned_agent_id: 'agent-3',
|
||||
last_message_at: min(10).toString(),
|
||||
last_message_summary: '内网服务器 SSH 连接超时',
|
||||
created_at: min(10).toString(),
|
||||
updated_at: min(10).toString(),
|
||||
is_mine: false,
|
||||
assigned_agent_name: '陈静',
|
||||
can_grab: true,
|
||||
collaborating_agent_ids: ['agent-1'],
|
||||
collaborating_agent_names: { 'agent-1': '宋献' },
|
||||
is_collaborator: true,
|
||||
impact_scope: 5,
|
||||
is_blocking: false,
|
||||
emotion_state: 'calm',
|
||||
participants: [
|
||||
{ id: 'sunba', name: '孙八', department: '产品部', type: 'employee', avatar: '', joined: true, joined_at: min(8).toString() },
|
||||
],
|
||||
},
|
||||
// --- 历史会话 ---
|
||||
{
|
||||
id: 'conv-010',
|
||||
employee_id: 'wuming',
|
||||
employee_name: '吴明',
|
||||
department: '客服部',
|
||||
position: '客服专员',
|
||||
level: 'bronze',
|
||||
status: 'resolved',
|
||||
is_vip: false,
|
||||
is_pinned: false,
|
||||
is_todo: false,
|
||||
urgency_score: 2,
|
||||
tags: {
|
||||
hand_raise: false,
|
||||
need_intervene: false,
|
||||
emotion: 'calm',
|
||||
emotion_keywords: [],
|
||||
repeat_count: 0,
|
||||
},
|
||||
assigned_agent_id: 'agent-1',
|
||||
last_message_at: hour(2).toString(),
|
||||
last_message_summary: '耳机没声音,重装驱动后已恢复',
|
||||
created_at: hour(3).toString(),
|
||||
updated_at: hour(2).toString(),
|
||||
is_mine: true,
|
||||
assigned_agent_name: '宋献',
|
||||
can_grab: false,
|
||||
collaborating_agent_ids: [],
|
||||
collaborating_agent_names: {},
|
||||
is_collaborator: false,
|
||||
impact_scope: 1,
|
||||
is_blocking: false,
|
||||
emotion_state: 'calm',
|
||||
participants: [],
|
||||
},
|
||||
]
|
||||
|
||||
// =========================================================================
|
||||
// 2. 聊天消息 mock — 12条,覆盖多种 msg_type 和 sender_type
|
||||
// =========================================================================
|
||||
|
||||
const MSG = (id: string, created_at: string): Pick<Message, 'id' | 'conversation_id' | 'created_at'> => ({
|
||||
id,
|
||||
conversation_id: 'conv-001',
|
||||
created_at,
|
||||
})
|
||||
|
||||
export const mockMessages: Message[] = [
|
||||
{
|
||||
...MSG('msg-01', min(55)),
|
||||
sender_type: 'system',
|
||||
sender_id: 'system',
|
||||
sender_name: '系统',
|
||||
content: '',
|
||||
msg_type: 'text',
|
||||
ai_suggestion: false,
|
||||
is_read: true,
|
||||
extra_data: { system_notice: '2026年6月6日 10:25 — 会话开始' },
|
||||
},
|
||||
{
|
||||
...MSG('msg-02', min(54)),
|
||||
sender_type: 'employee',
|
||||
sender_id: 'zhangwei',
|
||||
sender_name: '张伟',
|
||||
content: 'VPN连接失败了,一直提示"无法连接到服务器",已经试了3次都不行。需要访问内网OA系统处理紧急审批。',
|
||||
msg_type: 'text',
|
||||
ai_suggestion: false,
|
||||
is_read: true,
|
||||
},
|
||||
{
|
||||
...MSG('msg-03', min(50)),
|
||||
sender_type: 'agent',
|
||||
sender_id: 'agent-1',
|
||||
sender_name: '宋献',
|
||||
content: '您好张工,请问您使用的是 AnyConnect 客户端还是 SSL VPN 网页版?方便的话请提供一下您的客户端版本号,我帮您排查。',
|
||||
msg_type: 'text',
|
||||
ai_suggestion: false,
|
||||
is_read: true,
|
||||
},
|
||||
{
|
||||
...MSG('msg-04', min(48)),
|
||||
sender_type: 'employee',
|
||||
sender_id: 'zhangwei',
|
||||
sender_name: '张伟',
|
||||
content: 'AnyConnect 4.10,上个月刚升级的。用同事电脑试了也不行,应该不是客户端的问题吧?',
|
||||
msg_type: 'text',
|
||||
ai_suggestion: false,
|
||||
is_read: true,
|
||||
},
|
||||
{
|
||||
...MSG('msg-05', min(45)),
|
||||
sender_type: 'ai',
|
||||
sender_id: 'wingman-ai',
|
||||
sender_name: 'AI助手',
|
||||
content: '系统检测到 AnyConnect 4.10 版本存在已知证书兼容性问题。根据知识库记录,建议升级到 4.14 版本或使用 SSL VPN 网页版作为临时方案。',
|
||||
msg_type: 'text',
|
||||
ai_suggestion: true,
|
||||
is_read: true,
|
||||
},
|
||||
{
|
||||
...MSG('msg-06', min(42)),
|
||||
sender_type: 'agent',
|
||||
sender_id: 'agent-1',
|
||||
sender_name: '宋献',
|
||||
content: '收到。4.10 版本确实有个已知的证书兼容性问题,会导致连接超时。我先远程帮您排查一下,请先在电脑上允许远程桌面连接。',
|
||||
msg_type: 'text',
|
||||
ai_suggestion: false,
|
||||
is_read: true,
|
||||
},
|
||||
{
|
||||
...MSG('msg-07', min(40)),
|
||||
sender_type: 'employee',
|
||||
sender_id: 'zhangwei',
|
||||
sender_name: '张伟',
|
||||
content: '好的,远程需要什么连接码?',
|
||||
msg_type: 'text',
|
||||
ai_suggestion: false,
|
||||
is_read: true,
|
||||
},
|
||||
{
|
||||
...MSG('msg-08', min(38)),
|
||||
sender_type: 'agent',
|
||||
sender_id: 'agent-1',
|
||||
sender_name: '宋献',
|
||||
content: '远程连接码:RD-8862,请在企业微信上确认远程协助请求。',
|
||||
msg_type: 'text',
|
||||
ai_suggestion: false,
|
||||
is_read: true,
|
||||
},
|
||||
{
|
||||
...MSG('msg-09', min(35)),
|
||||
sender_type: 'employee',
|
||||
sender_id: 'zhangwei',
|
||||
sender_name: '张伟',
|
||||
content: '[图片] 截图发你了,这个报错提示你看一下',
|
||||
msg_type: 'image',
|
||||
ai_suggestion: false,
|
||||
is_read: true,
|
||||
media_url: 'https://via.placeholder.com/800x600/202030/00d4ff?text=VPN+Error+Screenshot',
|
||||
extra_data: { thumbnail_url: 'https://via.placeholder.com/200x150/202030/00d4ff?text=VPN+Error' },
|
||||
},
|
||||
{
|
||||
...MSG('msg-10', min(30)),
|
||||
sender_type: 'agent',
|
||||
sender_id: 'agent-1',
|
||||
sender_name: '宋献',
|
||||
content: '看到了,错误码 ERR_CERT_EXPIRED 确实是证书过期导致的。请按以下步骤操作:\n1. 打开控制面板 → Internet选项 → 内容 → 清除SSL状态\n2. 打开 AnyConnect → 设置 → 清除缓存\n3. 重启 AnyConnect 客户端\n4. 如果还不行,我帮您推远程升级包到 4.14 版本',
|
||||
msg_type: 'text',
|
||||
ai_suggestion: false,
|
||||
is_read: true,
|
||||
},
|
||||
{
|
||||
...MSG('msg-11', min(25)),
|
||||
sender_type: 'employee',
|
||||
sender_id: 'zhangwei',
|
||||
sender_name: '张伟',
|
||||
content: '按你说的操作了!清除SSL状态后重新连接成功了!太感谢了!',
|
||||
msg_type: 'text',
|
||||
ai_suggestion: false,
|
||||
is_read: true,
|
||||
},
|
||||
{
|
||||
...MSG('msg-12', min(20)),
|
||||
sender_type: 'system',
|
||||
sender_id: 'system',
|
||||
sender_name: '系统',
|
||||
content: '会话已解决,满意度评价待用户反馈。',
|
||||
msg_type: 'text',
|
||||
ai_suggestion: false,
|
||||
is_read: true,
|
||||
extra_data: { system_notice: '会话状态: resolved | 处理时长: 35分钟' },
|
||||
},
|
||||
]
|
||||
|
||||
// =========================================================================
|
||||
// 3. 坐席信息 mock — 5人
|
||||
// =========================================================================
|
||||
|
||||
export const mockCurrentAgent: Agent = {
|
||||
id: 'agent-1',
|
||||
user_id: 'songxian',
|
||||
name: '宋献',
|
||||
status: 'online',
|
||||
current_load: 3,
|
||||
max_load: 5,
|
||||
created_at: hour(720).toString(),
|
||||
updated_at: min(5).toString(),
|
||||
}
|
||||
|
||||
export const mockAgentList: Agent[] = [
|
||||
mockCurrentAgent,
|
||||
{
|
||||
id: 'agent-2',
|
||||
user_id: 'liuming',
|
||||
name: '刘明',
|
||||
status: 'busy',
|
||||
current_load: 5,
|
||||
max_load: 5,
|
||||
created_at: hour(700).toString(),
|
||||
updated_at: min(5).toString(),
|
||||
},
|
||||
{
|
||||
id: 'agent-3',
|
||||
user_id: 'chenjing',
|
||||
name: '陈静',
|
||||
status: 'online',
|
||||
current_load: 2,
|
||||
max_load: 5,
|
||||
created_at: hour(680).toString(),
|
||||
updated_at: min(5).toString(),
|
||||
},
|
||||
{
|
||||
id: 'agent-4',
|
||||
user_id: 'zhaolei',
|
||||
name: '赵磊',
|
||||
status: 'online',
|
||||
current_load: 1,
|
||||
max_load: 5,
|
||||
created_at: hour(600).toString(),
|
||||
updated_at: min(5).toString(),
|
||||
},
|
||||
{
|
||||
id: 'agent-5',
|
||||
user_id: 'wangfang',
|
||||
name: '王芳',
|
||||
status: 'offline',
|
||||
current_load: 0,
|
||||
max_load: 5,
|
||||
created_at: hour(500).toString(),
|
||||
updated_at: hour(1).toString(),
|
||||
},
|
||||
]
|
||||
|
||||
export const mockLoginData: LoginData = {
|
||||
...mockCurrentAgent,
|
||||
token: 'mock-jwt-token-session-20260606',
|
||||
}
|
||||
|
||||
/** 坐席统计(从列表派生) */
|
||||
export function getAgentStats() {
|
||||
const all = mockAgentList
|
||||
return {
|
||||
onlineAgents: all.filter(a => a.status === 'online').length,
|
||||
busyAgents: all.filter(a => a.status === 'busy').length,
|
||||
offlineAgents: all.filter(a => a.status === 'offline').length,
|
||||
}
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 4. 待办列表 mock — 5条,覆盖 3 种类型 + 3 种优先级
|
||||
// =========================================================================
|
||||
|
||||
export const mockTodos: TodoItemData[] = [
|
||||
{
|
||||
id: 'todo-001',
|
||||
type: 'ticket',
|
||||
title: 'CEO办公室 — 投屏设备故障',
|
||||
priority: 'urgent',
|
||||
description: {
|
||||
ticket_id: 'TKT-20260606001',
|
||||
reporter: '王莉',
|
||||
reporter_title: '张总秘书',
|
||||
reporter_dept: 'CEO办公室',
|
||||
issue_type: '硬件故障',
|
||||
detail: 'CEO办公室会议室的投屏设备无法连接,下午2点有重要客户演示。已尝试重启设备3次,仍无法投屏。急需IT人员到现场处理。',
|
||||
sla_deadline: new Date(now.getTime() + 12 * 60000).toISOString(),
|
||||
location: '12楼 CEO会议室',
|
||||
},
|
||||
status: 'pending',
|
||||
assigned_agent_id: null,
|
||||
corp_id: 'corp-001',
|
||||
created_at: min(5).toString(),
|
||||
updated_at: min(5).toString(),
|
||||
},
|
||||
{
|
||||
id: 'todo-002',
|
||||
type: 'ticket',
|
||||
title: '财务部 — 税控系统无法登录',
|
||||
priority: 'urgent',
|
||||
description: {
|
||||
ticket_id: 'TKT-20260606002',
|
||||
reporter: '王磊',
|
||||
reporter_title: '财务主管',
|
||||
reporter_dept: '财务部',
|
||||
issue_type: '系统登录',
|
||||
detail: '财务部税控系统(eTax)自今早9点起无法登录,提示"证书验证失败"。今天是报税截止日,下午3点前必须完成申报,否则会产生滞纳金。已联系税局客服,确认非税局端问题。',
|
||||
sla_deadline: new Date(now.getTime() + 180 * 60000).toISOString(),
|
||||
affected_users: 8,
|
||||
},
|
||||
status: 'pending',
|
||||
assigned_agent_id: null,
|
||||
corp_id: 'corp-001',
|
||||
created_at: min(12).toString(),
|
||||
updated_at: min(12).toString(),
|
||||
},
|
||||
{
|
||||
id: 'todo-003',
|
||||
type: 'approval',
|
||||
title: 'IT采购申请 — 研发部笔记本电脑',
|
||||
priority: 'high',
|
||||
description: {
|
||||
approval_id: 'APP-20260606003',
|
||||
applicant: '李研发经理',
|
||||
applicant_dept: '研发一部',
|
||||
approval_type: 'IT设备采购',
|
||||
budget: 86400,
|
||||
budget_currency: 'CNY',
|
||||
items: [
|
||||
{ name: 'MacBook Pro 14" M4 Pro', qty: 6, unit_price: 12999, subtotal: 77994 },
|
||||
{ name: 'USB-C 扩展坞', qty: 6, unit_price: 899, subtotal: 5394 },
|
||||
{ name: '内胆包', qty: 6, unit_price: 169, subtotal: 1014 },
|
||||
],
|
||||
reason: '新入职 Python 后端团队标配开发机,替代旧的 ThinkPad T480(已服役4年)',
|
||||
attachments: ['采购清单_20260606.xlsx', '报价单_Apple授权经销商.pdf'],
|
||||
approver_chain: ['直属上级', 'IT总监', '财务审批'],
|
||||
},
|
||||
status: 'pending',
|
||||
assigned_agent_id: 'agent-1',
|
||||
corp_id: 'corp-001',
|
||||
created_at: min(28).toString(),
|
||||
updated_at: min(28).toString(),
|
||||
},
|
||||
{
|
||||
id: 'todo-004',
|
||||
type: 'device',
|
||||
title: '会议室A — 投影仪离线告警',
|
||||
priority: 'high',
|
||||
description: {
|
||||
device_id: 'DEV-20260606007',
|
||||
device_name: '会议室A-投影仪',
|
||||
model: 'Epson CB-W42',
|
||||
serial_number: 'X3KP-78901234',
|
||||
location: '6楼 会议室A',
|
||||
ip: '192.168.10.88',
|
||||
mac: '00:1B:44:11:3A:B7',
|
||||
status: 'offline',
|
||||
last_online: hour(2).toString(),
|
||||
alert_count: 3,
|
||||
alert_message: '设备连续3次 ping 不通,疑似网络或电源问题',
|
||||
},
|
||||
status: 'pending',
|
||||
assigned_agent_id: 'agent-1',
|
||||
corp_id: 'corp-001',
|
||||
created_at: min(45).toString(),
|
||||
updated_at: min(30).toString(),
|
||||
},
|
||||
{
|
||||
id: 'todo-005',
|
||||
type: 'approval',
|
||||
title: '新员工入职 — 设备申领审批',
|
||||
priority: 'normal',
|
||||
description: {
|
||||
approval_id: 'APP-20260606008',
|
||||
applicant: '赵敏',
|
||||
applicant_dept: '人力资源部',
|
||||
approval_type: '新员工设备申领',
|
||||
budget: 15000,
|
||||
budget_currency: 'CNY',
|
||||
items: [
|
||||
{ name: 'ThinkPad X1 Carbon Gen 12', qty: 1, unit_price: 10999, subtotal: 10999 },
|
||||
{ name: 'Dell 27" 4K 显示器 U2723QE', qty: 1, unit_price: 3599, subtotal: 3599 },
|
||||
{ name: '罗技 MX Keys 键盘 + MX Master 3S 鼠标', qty: 1, unit_price: 1299, subtotal: 1299 },
|
||||
],
|
||||
reason: '下周一(6月9日)新入职市场总监,需提前准备办公设备',
|
||||
new_hire_name: '林峰',
|
||||
new_hire_position: '市场总监',
|
||||
onboard_date: '2026-06-09',
|
||||
},
|
||||
status: 'pending',
|
||||
assigned_agent_id: 'agent-1',
|
||||
corp_id: 'corp-001',
|
||||
created_at: min(35).toString(),
|
||||
updated_at: min(35).toString(),
|
||||
},
|
||||
]
|
||||
|
||||
// =========================================================================
|
||||
// 5. 用户画像 mock — 张伟完整信息
|
||||
// =========================================================================
|
||||
|
||||
export interface EmployeeProfile {
|
||||
name: string
|
||||
department: string
|
||||
position: string
|
||||
it_level: string
|
||||
it_level_name: string
|
||||
it_level_lv: number
|
||||
it_level_desc: string
|
||||
vip: boolean
|
||||
emotion_state: string
|
||||
emotion_desc: string
|
||||
tags: {
|
||||
repeat_count: number
|
||||
is_repeated: boolean
|
||||
period_days: number
|
||||
hand_raise: boolean
|
||||
need_intervene: boolean
|
||||
}
|
||||
impact_scope: number
|
||||
is_blocking: boolean
|
||||
notes: string
|
||||
monthly_tickets: Array<{ type: string; count: number }>
|
||||
total_tickets_30d: number
|
||||
join_date: string
|
||||
device_model: string
|
||||
preferred_contact_time: string
|
||||
}
|
||||
|
||||
export const mockEmployeeProfile: EmployeeProfile = {
|
||||
name: '张伟',
|
||||
department: '研发一部',
|
||||
position: '高级工程师',
|
||||
it_level: 'gold',
|
||||
it_level_name: '黄金',
|
||||
it_level_lv: 3,
|
||||
it_level_desc: '具备基础排障能力,能独立完成常规IT操作',
|
||||
vip: true,
|
||||
emotion_state: 'anxious',
|
||||
emotion_desc: '语气急促,多次提到"紧急"和"试了很多次"',
|
||||
tags: {
|
||||
repeat_count: 3,
|
||||
is_repeated: true,
|
||||
period_days: 7,
|
||||
hand_raise: true,
|
||||
need_intervene: false,
|
||||
},
|
||||
impact_scope: 12,
|
||||
is_blocking: true,
|
||||
notes: '孕晚期(37周),远程办公;偏好下午14:00-16:00沟通;遇到技术问题时容易焦虑,需要耐心引导和清晰的分步指导',
|
||||
monthly_tickets: [
|
||||
{ type: 'VPN', count: 2 },
|
||||
{ type: '企业邮箱', count: 1 },
|
||||
],
|
||||
total_tickets_30d: 3,
|
||||
join_date: '2023-03-15',
|
||||
device_model: 'ThinkPad X1 Carbon Gen 11',
|
||||
preferred_contact_time: '14:00-16:00',
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 6. AI 推荐补充 mock
|
||||
// =========================================================================
|
||||
|
||||
export const mockAiPanelDrafts: DraftResult[] = [
|
||||
{
|
||||
content: '您好!VPN连接问题通常有以下几种可能:\n1. 客户端版本兼容性问题(AnyConnect 4.10 有已知Bug)\n2. SSL证书缓存过期\n3. 网络配置变更\n请先提供您的客户端版本号,我来帮您逐步排查。',
|
||||
confidence: 0.92,
|
||||
reasoning: '基于用户描述的VPN连接失败关键词和历史工单分析',
|
||||
},
|
||||
{
|
||||
content: '建议方案:\n1. 按 Win+R 打开运行 → 输入 inetcpl.cpl → 内容 → 清除SSL状态\n2. 打开 AnyConnect → 设置 → Diagnostics → Clear Caches\n3. 重启 AnyConnect 重新连接\n如果以上步骤无效,请告知,我将远程协助。',
|
||||
confidence: 0.88,
|
||||
reasoning: '匹配知识库"AnyConnect 4.10 证书兼容性问题"方案',
|
||||
},
|
||||
{
|
||||
content: '您好!邮箱登录异常通常有以下原因:\n1. 密码过期(90天强制更换)\n2. 账号被临时锁定(多次密码错误)\n3. 客户端配置错误\n请先确认是否收到密码过期提醒邮件?',
|
||||
confidence: 0.88,
|
||||
reasoning: '匹配知识库"企业邮箱登录异常"常用排查流程',
|
||||
},
|
||||
{
|
||||
content: '打印驱动重装步骤:\n1. 打开"设置 → 蓝牙和其他设备 → 打印机和扫描仪"\n2. 找到问题打印机 → 删除设备\n3. 访问 \\\\print-server\\drivers 下载最新驱动\n4. 安装后重新添加打印机\n需要我远程协助吗?',
|
||||
confidence: 0.78,
|
||||
reasoning: '匹配知识库"打印机驱动重装"标准流程',
|
||||
},
|
||||
]
|
||||
|
||||
export const mockAiSummary: SummaryResult = {
|
||||
problem: 'AnyConnect VPN 客户端无法连接内网,提示"无法连接到服务器"',
|
||||
cause: '客户端版本为 4.10,存在已知的 SSL 证书兼容性问题,导致证书链验证失败后连接超时',
|
||||
solution: '指导用户清除 SSL 状态缓存后重新连接成功。建议后续统一推送升级至 4.14 版本避免类似问题。',
|
||||
}
|
||||
|
||||
export const mockAiTags: TagsResult = {
|
||||
suggested_tags: ['VPN', '版本兼容', '远程排查', '证书问题'],
|
||||
category: '办公网络',
|
||||
priority: 'high',
|
||||
}
|
||||
|
||||
// =========================================================================
|
||||
// 7. 导出聚合列表类型
|
||||
// =========================================================================
|
||||
|
||||
export const mockConversationListData: ConversationListData = {
|
||||
items: mockConversations,
|
||||
total: mockConversations.length,
|
||||
}
|
||||
|
||||
export const mockMessageListData: MessageListData = {
|
||||
items: mockMessages,
|
||||
has_more: false,
|
||||
}
|
||||
|
||||
export const mockTodoListData: TodoItemListData = {
|
||||
items: mockTodos,
|
||||
total: mockTodos.length,
|
||||
}
|
||||
|
||||
export const mockAgentListData: AgentListData = {
|
||||
items: mockAgentList,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user