import type {
  User,
  Task,
  Schedule,
  Vehicle,
  Personnel,
  Notification,
  Knowledge,
  FAQ
} from '@/types'

export const mockUsers: User[] = [
  {
    id: 'u1',
    name: '张销售',
    phone: '13800138001',
    avatar: '',
    role: 'sales',
    department: '销售部',
    status: 'active'
  },
  {
    id: 'u2',
    name: '李调度',
    phone: '13800138002',
    avatar: '',
    role: 'dispatch',
    department: '调度中心',
    status: 'active'
  },
  {
    id: 'u3',
    name: '张师傅',
    phone: '13800138003',
    avatar: '',
    role: 'construction',
    department: '施工部',
    team: '一班组',
    status: 'active'
  }
]

// 旧版演示数据（已不再被任何页面引用），字段沿用旧结构，故以 any[] 保留
export const mockProjects: any[] = [
  {
    id: 'p1',
    name: '绿城小区年度清洁服务',
    type: '包年',
    status: 'processing',
    customerName: '王经理',
    customerPhone: '13900139001',
    address: '杭州市西湖区绿城小区1-10栋',
    province: '浙江省',
    city: '杭州市',
    district: '西湖区',
    contacts: [
      { name: '王经理', phone: '13900139001', role: '物业经理' },
      { name: '李主任', phone: '13900139002', role: '工程主任' }
    ],
    servicePoints: [
      { id: 'sp1', name: '1栋地下车库', location: '绿城小区1栋', address: '绿城小区1栋地下车库', serviceType: '开荒保洁' },
      { id: 'sp2', name: '中心花园', location: '绿城小区中心', address: '绿城小区中心花园', serviceType: '日常保洁' }
    ],
    contractAmount: 120000,
    contractStartDate: '2026-01-01',
    contractEndDate: '2026-12-31',
    serviceCycle: '每周2次',
    remark: '包含地下车库、中心花园及公共区域清洁',
    location: { lat: 30.2741, lng: 120.1551 },
    createTime: '2026-01-15T09:30:00',
    updateTime: '2026-06-20T14:20:00'
  },
  {
    id: 'p2',
    name: '阿里巴巴园区单次深度清洁',
    type: '单次',
    status: 'confirmed',
    customerName: '赵主管',
    customerPhone: '13900139003',
    address: '杭州市余杭区文一西路969号',
    province: '浙江省',
    city: '杭州市',
    district: '余杭区',
    contacts: [
      { name: '赵主管', phone: '13900139003', role: '行政主管' }
    ],
    servicePoints: [
      { id: 'sp3', name: 'A区办公楼', location: '园区A区', address: '阿里巴巴园区A区办公楼', serviceType: '深度清洁' }
    ],
    contractAmount: 8000,
    serviceCycle: '单次',
    remark: '周末作业，避开办公高峰',
    createTime: '2026-06-18T10:00:00',
    updateTime: '2026-06-21T09:15:00'
  },
  {
    id: 'p3',
    name: '未来科技城季度保洁',
    type: '季度',
    status: 'pending',
    customerName: '陈总',
    customerPhone: '13900139005',
    address: '杭州市余杭区仓前街道',
    province: '浙江省',
    city: '杭州市',
    district: '余杭区',
    contacts: [
      { name: '陈总', phone: '13900139005', role: '总经理' },
      { name: '小刘', phone: '13900139006', role: '对接人' }
    ],
    servicePoints: [
      { id: 'sp4', name: '科技展厅', location: '未来科技城A座', address: '未来科技城A座展厅', serviceType: '展厅保洁' }
    ],
    contractAmount: 35000,
    contractStartDate: '2026-04-01',
    contractEndDate: '2026-09-30',
    serviceCycle: '每季度1次',
    createTime: '2026-06-20T16:00:00',
    updateTime: '2026-06-20T16:00:00'
  },
  {
    id: 'p4',
    name: '滨江月付写字楼保洁',
    type: '月付',
    status: 'completed',
    customerName: '孙经理',
    customerPhone: '13900139007',
    address: '杭州市滨江区江南大道',
    province: '浙江省',
    city: '杭州市',
    district: '滨江区',
    contacts: [
      { name: '孙经理', phone: '13900139007', role: '楼宇经理' }
    ],
    servicePoints: [
      { id: 'sp5', name: '1-5层办公区', location: '滨江写字楼', address: '滨江写字楼1-5层', serviceType: '日常保洁' }
    ],
    contractAmount: 18000,
    contractStartDate: '2026-03-01',
    contractEndDate: '2026-05-31',
    serviceCycle: '每月4次',
    createTime: '2026-03-01T08:00:00',
    updateTime: '2026-05-31T18:00:00'
  },
  {
    id: 'p5',
    name: '西湖景区包年环卫',
    type: '包年',
    status: 'processing',
    customerName: '周主任',
    customerPhone: '13900139008',
    address: '杭州市西湖区龙井路',
    province: '浙江省',
    city: '杭州市',
    district: '西湖区',
    contacts: [
      { name: '周主任', phone: '13900139008', role: '景区主任' }
    ],
    servicePoints: [
      { id: 'sp6', name: '断桥区域', location: '西湖断桥', address: '西湖断桥区域', serviceType: '环卫清洁' },
      { id: 'sp7', name: '苏堤区域', location: '西湖苏堤', address: '西湖苏堤区域', serviceType: '环卫清洁' }
    ],
    contractAmount: 200000,
    contractStartDate: '2026-02-01',
    contractEndDate: '2026-12-31',
    serviceCycle: '每日1次',
    remark: '景区节假日需加强保洁',
    createTime: '2026-02-10T10:30:00',
    updateTime: '2026-06-18T11:00:00'
  }
]

export const mockTasks: Task[] = [
  {
    id: 't1',
    projectId: 'p1',
    projectName: '绿城小区年度清洁服务',
    type: 'regular',
    status: 'constructing',
    urgent: 'normal',
    assignee: '张师傅',
    vehicle: '浙A·12345',
    team: '一班组',
    scheduledDate: '2026-06-22',
    createTime: '2026-06-20T09:00:00',
    timeline: [
      { time: '2026-06-20T09:00:00', action: '任务创建', operator: '张销售', role: 'sales' },
      { time: '2026-06-20T10:30:00', action: '任务确认', operator: '李调度', role: 'dispatch' },
      { time: '2026-06-21T16:00:00', action: '排班完成', operator: '李调度', role: 'dispatch' },
      { time: '2026-06-22T08:00:00', action: '出车出发', operator: '张师傅', role: 'construction' },
      { time: '2026-06-22T08:40:00', action: '到达现场', operator: '张师傅', role: 'construction' },
      { time: '2026-06-22T09:00:00', action: '开始施工', operator: '张师傅', role: 'construction' }
    ]
  },
  {
    id: 't2',
    projectId: 'p2',
    projectName: '阿里巴巴园区单次深度清洁',
    type: 'emergency',
    status: 'pending',
    urgent: 'high',
    createTime: '2026-06-22T07:30:00',
    timeline: [
      { time: '2026-06-22T07:30:00', action: '任务创建', operator: '张销售', role: 'sales' }
    ]
  },
  {
    id: 't3',
    projectId: 'p5',
    projectName: '西湖景区包年环卫',
    type: 'regular',
    status: 'scheduled',
    urgent: 'normal',
    assignee: '王师傅',
    vehicle: '浙A·67890',
    team: '二班组',
    scheduledDate: '2026-06-23',
    createTime: '2026-06-19T14:00:00',
    timeline: [
      { time: '2026-06-19T14:00:00', action: '任务创建', operator: '张销售', role: 'sales' },
      { time: '2026-06-19T15:00:00', action: '任务确认', operator: '李调度', role: 'dispatch' },
      { time: '2026-06-21T09:00:00', action: '排班完成', operator: '李调度', role: 'dispatch' }
    ]
  },
  {
    id: 't4',
    projectId: 'p1',
    projectName: '绿城小区年度清洁服务',
    type: 'regular',
    status: 'completed',
    urgent: 'normal',
    assignee: '张师傅',
    vehicle: '浙A·12345',
    team: '一班组',
    scheduledDate: '2026-06-15',
    createTime: '2026-06-10T10:00:00',
    timeline: [
      { time: '2026-06-10T10:00:00', action: '任务创建', operator: '张销售', role: 'sales' },
      { time: '2026-06-12T16:00:00', action: '施工完成', operator: '张师傅', role: 'construction' },
      { time: '2026-06-15T10:00:00', action: '验收通过', operator: '王经理', role: 'sales' }
    ]
  },
  {
    id: 't5',
    projectId: 'p3',
    projectName: '未来科技城季度保洁',
    type: 'regular',
    status: 'pending',
    urgent: 'normal',
    createTime: '2026-06-20T16:30:00',
    timeline: [
      { time: '2026-06-20T16:30:00', action: '任务创建', operator: '张销售', role: 'sales' }
    ]
  }
]

export const mockSchedules: Schedule[] = [
  { id: 's1', date: '2026-06-22', team: '一班组', taskId: 't1', taskName: '绿城小区年度清洁服务', status: 'scheduled' },
  { id: 's2', date: '2026-06-23', team: '二班组', taskId: 't3', taskName: '西湖景区包年环卫', status: 'scheduled' },
  { id: 's3', date: '2026-06-22', team: '三班组', taskId: 't2', taskName: '阿里巴巴园区单次深度清洁', status: 'scheduled' }
]

export const mockVehicles: Vehicle[] = [
  { id: 'v1', plateNumber: '浙A·12345', type: '清洁车', status: 'in_use', driver: '张师傅', driverPhone: '13800138003', size: '中型', loadCapacity: '5吨', capacity: '5m³', purchaseDate: '2022-03-15', mileage: 32000 },
  { id: 'v2', plateNumber: '浙A·67890', type: '垃圾清运车', status: 'in_use', driver: '王师傅', driverPhone: '13800138004', size: '大型', loadCapacity: '8吨', capacity: '8m³', purchaseDate: '2021-08-20', mileage: 48000 },
  { id: 'v3', plateNumber: '浙A·11111', type: '高压清洗车', status: 'available', driver: '李师傅', driverPhone: '13800138005', size: '中型', loadCapacity: '6吨', capacity: '6m³', purchaseDate: '2023-01-10', mileage: 15000 },
  { id: 'v4', plateNumber: '浙A·22222', type: '洒水车', status: 'maintenance', driver: '', size: '大型', loadCapacity: '10吨', capacity: '10m³', purchaseDate: '2020-11-05', mileage: 65000 },
  { id: 'v5', plateNumber: '浙A·33333', type: '清洁车', status: 'available', driver: '赵师傅', driverPhone: '13800138006', size: '小型', loadCapacity: '3吨', capacity: '3m³', purchaseDate: '2023-06-18', mileage: 8000 }
]

export const mockPersonnel: Personnel[] = [
  { id: 'pe1', name: '张师傅', phone: '13800138003', team: '一班组', status: 'working', position: '班长', skillLevel: '高级', qualifications: ['高空作业', '密闭空间'], workYears: 8 },
  { id: 'pe2', name: '王师傅', phone: '13800138004', team: '二班组', status: 'working', position: '驾驶员', skillLevel: '中级', qualifications: ['大型车辆', '高压清洗'], workYears: 5 },
  { id: 'pe3', name: '李师傅', phone: '13800138005', team: '三班组', status: 'idle', position: '操作手', skillLevel: '中级', qualifications: ['高压清洗'], workYears: 4 },
  { id: 'pe4', name: '赵师傅', phone: '13800138006', team: '三班组', status: 'idle', position: '驾驶员', skillLevel: '初级', qualifications: ['清洁车'], workYears: 2 },
  { id: 'pe5', name: '刘师傅', phone: '13800138007', team: '应急组', status: 'standby', position: '应急队长', skillLevel: '高级', qualifications: ['应急救援', '高空作业', '密闭空间'], workYears: 10 },
  { id: 'pe6', name: '陈师傅', phone: '13800138008', team: '应急组', status: 'standby', position: '应急队员', skillLevel: '中级', qualifications: ['应急救援', '高压清洗'], workYears: 6 },
  { id: 'pe7', name: '杨师傅', phone: '13800138009', team: '一班组', status: 'rest', position: '操作手', skillLevel: '初级', qualifications: ['清洁车'], workYears: 1 },
  { id: 'pe8', name: '黄师傅', phone: '13800138010', team: '二班组', status: 'rest', position: '操作手', skillLevel: '中级', qualifications: ['垃圾清运'], workYears: 3 }
]

export const mockNotifications: Notification[] = [
  {
    id: 'n1',
    title: '新任务提醒',
    content: '您有一个新的待确认任务：阿里巴巴园区单次深度清洁',
    type: 'task',
    read: false,
    createTime: '2026-06-22T07:35:00'
  },
  {
    id: 'n2',
    title: '系统维护通知',
    content: '系统将于今晚22:00-23:00进行例行维护，请提前保存工作数据。',
    type: 'system',
    read: false,
    createTime: '2026-06-21T18:00:00'
  },
  {
    id: 'n3',
    title: '任务完成审核',
    content: '绿城小区年度清洁服务任务已完成，请及时验收。',
    type: 'audit',
    read: true,
    createTime: '2026-06-15T11:00:00'
  },
  {
    id: 'n4',
    title: '应急任务',
    content: '西湖景区突发油污清理，请应急组尽快响应。',
    type: 'task',
    read: false,
    createTime: '2026-06-22T06:00:00'
  },
  {
    id: 'n5',
    title: '欢迎加入清道夫系统',
    content: '欢迎使用清道夫系统，如有问题请查看帮助中心。',
    type: 'system',
    read: true,
    createTime: '2026-06-01T09:00:00'
  }
]

export const mockKnowledges: Knowledge[] = [
  {
    id: 'k1',
    title: '高空作业安全规范',
    summary: '施工人员进行高空清洁作业时必须遵守的安全操作规范。',
    content: '1. 必须佩戴安全帽、安全带...',
    category: '安全规范',
    createTime: '2026-05-10T10:00:00'
  },
  {
    id: 'k2',
    title: '清洁剂使用指南',
    summary: '不同场景下清洁剂的选择与配比说明。',
    content: '1. 中性清洁剂适用于大理石地面...',
    category: '操作指南',
    createTime: '2026-05-15T14:00:00'
  },
  {
    id: 'k3',
    title: '设备日常保养手册',
    summary: '清洁车辆与设备的日常检查、保养要点。',
    content: '1. 每日出车前检查油量、水位...',
    category: '设备维护',
    createTime: '2026-05-20T09:00:00'
  }
]

export const mockFAQs: FAQ[] = [
  {
    id: 'f1',
    question: '如何新增一个项目？',
    answer: '进入销售端首页，点击"项目库"，再点击右下角"+"按钮，填写项目信息、服务点和联系人后保存。',
    category: 'sales'
  },
  {
    id: 'f2',
    question: '任务发布后可以修改吗？',
    answer: '任务在"待确认"状态前，可在任务详情中取消后重新发布；已确认任务请联系调度中心处理。',
    category: 'sales'
  },
  {
    id: 'f3',
    question: '如何查看任务进度？',
    answer: '销售端进入"任务"页，点击对应任务卡片即可查看当前进度、施工班组与车辆信息。',
    category: 'sales'
  },
  {
    id: 'f4',
    question: '如何审核任务？',
    answer: '调度端首页"待审核任务"或任务列表"待审核"标签进入详情，确认信息后安排班组与车辆，或填写驳回原因后驳回。',
    category: 'dispatch'
  },
  {
    id: 'f5',
    question: '排班时如何选择合适的车辆与班组？',
    answer: '可参考"在岗人员"查看人员技能与状态，"可用车辆"查看车辆载重与尺寸，确保资源匹配任务需求。',
    category: 'dispatch'
  },
  {
    id: 'f6',
    question: '应急任务如何快速响应？',
    answer: '调度端进入"应急待命"查看待命班组与车辆，点击电话联系后快速派单。',
    category: 'dispatch'
  },
  {
    id: 'f7',
    question: '施工人员如何确认任务？',
    answer: '施工端"任务"页进入待确认任务详情，查看项目与故障信息后点击"确认任务"，也可反馈问题或拒绝。',
    category: 'construction'
  },
  {
    id: 'f8',
    question: '每日车辆检查必须完成哪些项目？',
    answer: '每日任务页包含常规检查、设备检查、三大系统检查，所有项勾选并提交后才算完成。',
    category: 'construction'
  },
  {
    id: 'f9',
    question: '施工流程包含哪些步骤？',
    answer: '标准流程为：确认→出车→到达→勘验→施工→完成→清洗→验收，请在每个节点及时点击上报。',
    category: 'construction'
  },
  {
    id: 'f10',
    question: '忘记密码怎么办？',
    answer: '请联系管理员重置密码，或在个人中心"修改密码"中按提示操作。',
    category: 'common'
  },
  {
    id: 'f11',
    question: '任务状态有哪些？',
    answer: '任务状态包括：待确认、待排班、待出车、已出车、施工中、待验收、已完成、已取消、已驳回。',
    category: 'common'
  },
]
