餐饮油烟智能监测与监管一体化平台
riku
2026-03-20 59af55dc3e72f8f2655ae06af9d1b6f766bac423
src/debug/debugdata.js
@@ -68,6 +68,12 @@
  // 先添加指定的店铺
  specifiedShops.forEach((name, index) => {
    // 随机生成在线状态(80%概率在线)
    const isOnline = Math.random() < 0.8
    // 随机生成异常状态(只有在线时才可能有异常)
    // 0: 油烟浓度超标, 1: 供电异常, 2: 设备或网络异常, 3: 无异常
    const exceptionStatus = isOnline ? Math.floor(Math.random() * 4) : 2 // 离线时默认为设备或网络异常
    shops.push({
      shop: {
        name: name,
@@ -76,6 +82,8 @@
        longitude: 121.45 + Math.random() * 0.1,
        ringCodeLevel: ringCodeLevels[Math.floor(Math.random() * ringCodeLevels.length)],
        ringCodePublishTime: '2023-03-16 10:00:00',
        isOnline: isOnline,
        exceptionStatus: exceptionStatus,
      },
      recentData: generateRecentData(),
    })
@@ -88,6 +96,12 @@
    const suffix = nameSuffixes[Math.floor(Math.random() * nameSuffixes.length)]
    const randomName = `${prefix}${cuisine}${suffix}${i}`
    // 随机生成在线状态(80%概率在线)
    const isOnline = Math.random() < 0.8
    // 随机生成异常状态(只有在线时才可能有异常)
    // 0: 油烟浓度超标, 1: 供电异常, 2: 设备或网络异常, 3: 无异常
    const exceptionStatus = isOnline ? Math.floor(Math.random() * 4) : 2 // 离线时默认为设备或网络异常
    shops.push({
      shop: {
        name: randomName,
@@ -96,6 +110,8 @@
        longitude: 121.41 + Math.random() * 0.1,
        ringCodeLevel: ringCodeLevels[Math.floor(Math.random() * ringCodeLevels.length)],
        ringCodePublishTime: '2023-03-16 10:00:00',
        isOnline: isOnline,
        exceptionStatus: exceptionStatus,
      },
      recentData: generateRecentData(),
    })
@@ -113,7 +129,7 @@
    const time = new Date(now.getTime() - i * 10 * 60 * 1000)
    data.push({
      sampleTime: time.toISOString().slice(0, 19).replace('T', ' '),
      oilSmokeConcentration: (Math.random() * 5).toFixed(2),
      oilSmokeConcentration: (Math.random() * 2).toFixed(2),
      purifierCurrent: (Math.random() * 10).toFixed(2),
      fanCurrent: (Math.random() * 15).toFixed(2),
    })