/**
 * Mock数据 - 设备管理
 */

// 设备状态枚举
export enum DeviceStatus {
  ONLINE = 1,       // 在线
  OFFLINE = 0,      // 离线
  MAINTENANCE = 2,  // 维护中
  ERROR = 3         // 故障
}

// 设备状态文字映射
export const DeviceStatusText: Record<number, string> = {
  [DeviceStatus.ONLINE]: '在线',
  [DeviceStatus.OFFLINE]: '离线',
  [DeviceStatus.MAINTENANCE]: '维护中',
  [DeviceStatus.ERROR]: '故障'
};

// 设备状态颜色映射
export const DeviceStatusColor: Record<number, string> = {
  [DeviceStatus.ONLINE]: '#52c41a',
  [DeviceStatus.OFFLINE]: '#999999',
  [DeviceStatus.MAINTENANCE]: '#faad14',
  [DeviceStatus.ERROR]: '#ff4d4f'
};

// 设备列表Mock数据
export const mockDeviceList = [
  {
    id: 1,
    deviceId: 'DEV001',
    name: '1号柜机',
    shopId: 1,
    shopName: '万达广场店',
    status: DeviceStatus.ONLINE,
    temperature: 8,
    volume: 75,
    lastOnlineTime: '2026-02-15 14:30:00',
    totalSales: 12560,
    todaySales: 680,
    inventory: 156,
    capacity: 200,
    createdAt: '2025-10-01 10:00:00'
  },
  {
    id: 2,
    deviceId: 'DEV002',
    name: '2号柜机',
    shopId: 2,
    shopName: '人民广场店',
    status: DeviceStatus.ONLINE,
    temperature: 7,
    volume: 80,
    lastOnlineTime: '2026-02-15 14:28:00',
    totalSales: 9820,
    todaySales: 520,
    inventory: 128,
    capacity: 200,
    createdAt: '2025-10-05 10:00:00'
  },
  {
    id: 3,
    deviceId: 'DEV003',
    name: '3号柜机',
    shopId: 3,
    shopName: '火车站店',
    status: DeviceStatus.OFFLINE,
    temperature: 0,
    volume: 0,
    lastOnlineTime: '2026-02-15 10:00:00',
    totalSales: 15680,
    todaySales: 0,
    inventory: 89,
    capacity: 200,
    createdAt: '2025-09-15 10:00:00'
  },
  {
    id: 4,
    deviceId: 'DEV004',
    name: '4号柜机',
    shopId: 4,
    shopName: '科技园店',
    status: DeviceStatus.MAINTENANCE,
    temperature: 6,
    volume: 60,
    lastOnlineTime: '2026-02-14 18:00:00',
    totalSales: 8960,
    todaySales: 0,
    inventory: 45,
    capacity: 150,
    createdAt: '2025-11-01 10:00:00'
  },
  {
    id: 5,
    deviceId: 'DEV005',
    name: '5号柜机',
    shopId: 1,
    shopName: '万达广场店',
    status: DeviceStatus.ONLINE,
    temperature: 9,
    volume: 70,
    lastOnlineTime: '2026-02-15 14:25:00',
    totalSales: 7680,
    todaySales: 380,
    inventory: 178,
    capacity: 200,
    createdAt: '2025-12-01 10:00:00'
  }
];

// 设备详情Mock数据
export const mockDeviceDetail = {
  id: 1,
  deviceId: 'DEV001',
  name: '1号柜机',
  shopId: 1,
  shopName: '万达广场店',
  shopAddress: '北京市朝阳区建国路93号万达广场B1层',
  status: DeviceStatus.ONLINE,
  temperature: 8,
  volume: 75,
  lastOnlineTime: '2026-02-15 14:30:00',
  totalSales: 12560,
  todaySales: 680,
  todayOrders: 23,
  inventory: 156,
  capacity: 200,
  // 库存预警
  lowStockItems: [
    { productName: '可口可乐', currentStock: 5, minStock: 10 },
    { productName: '矿泉水', currentStock: 3, minStock: 10 }
  ],
  // 最近订单
  recentOrders: [
    { orderNo: 'ORD202602150001', amount: 2560, time: '2026-02-15 14:30:25' },
    { orderNo: 'ORD202602150002', amount: 1880, time: '2026-02-15 13:20:15' },
    { orderNo: 'ORD202602150003', amount: 3200, time: '2026-02-15 12:15:30' }
  ],
  // 温度历史（最近24小时）
  temperatureHistory: [
    { time: '00:00', temperature: 7 },
    { time: '04:00', temperature: 8 },
    { time: '08:00', temperature: 7 },
    { time: '12:00', temperature: 8 },
    { time: '16:00', temperature: 9 },
    { time: '20:00', temperature: 8 }
  ],
  createdAt: '2025-10-01 10:00:00',
  updatedAt: '2026-02-15 14:30:00'
};
