/* * @Author: donghao donghao@supervision.ltd * @Date: 2024-02-22 13:38:04 * @LastEditors: donghao donghao@supervision.ltd * @LastEditTime: 2024-02-29 17:53:39 * @FilePath: \General-AI-Platform-Web-Client\mock\pools\alarmData.ts // * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ function generateRandomDateTime(year) { // 生成随机月份(1-12) const month = Math.floor(Math.random() * 12) + 1; // 生成随机日期(1-31) const day = Math.floor(Math.random() * 31) + 1; // 生成随机小时(0-23) const hour = Math.floor(Math.random() * 24); // 生成随机分钟(0-59) const minute = Math.floor(Math.random() * 60); // 生成随机秒钟(0-59) const second = Math.floor(Math.random() * 60); // 返回随机日期和时间的字符串 return `${year}-${month < 10 ? "0" : ""}${month}-${ day < 10 ? "0" : "" }${day} ${hour < 10 ? "0" : ""}${hour}:${minute < 10 ? "0" : ""}${minute}:${ second < 10 ? "0" : "" }${second}`; } function fetchList(): Record[] { const currList: Record[] = []; const nameArr = [ "摄像模组表面缺陷检测", "镜片表面缺陷检测", "中板表面缺陷检测", "Logo表面缺陷检测", "手机电池表面缺陷检测", "部件表面缺陷检测", "边距缺陷检测", "成品组装缺陷检测", "金属工件表面缺陷检测", "管材表面缺陷检测" ]; const codeArr = ["MSRF", "RL0F", "TLOC", "E1AIS"]; const deviceGroupArr = ["核心检测组", "无尘总装组", "送料监测线"]; for (let i = 0; i < 35; i++) { currList.push({ id: 1, createTime: generateRandomDateTime(2023), updateTime: "2023-10-17T02:35:41.14308Z", name: nameArr[Math.floor(Math.random() * 3)], code: codeArr[Math.floor(Math.random() * 4)] + "-" + i, level: Math.floor(Math.random() * 6) + 1, deviceGroup: deviceGroupArr[Math.floor(Math.random() * 3)] + (Math.floor(Math.random() * 3) + 1), remark: "" }); } return currList; } // 缺陷从EXL里选几个就好了 // 告警代码MSRF-0 RL0F HTFIF-02 TLOC-1 E1AIS-05 // 设备组:核心检测组001 无尘总装组005 送料监测线02 const currentData = fetchList(); export const alarmListData = { data: { list: currentData, total: currentData.length, page: 1, pageSize: 10 } };