|
|
/*
|
|
|
* @Author: donghao donghao@supervision.ltd
|
|
|
* @Date: 2024-02-22 13:38:04
|
|
|
* @LastEditors: donghao donghao@supervision.ltd
|
|
|
* @LastEditTime: 2025-03-13 14:35:20
|
|
|
* @FilePath: \General-AI-Platform-Web-Client\mock\pools\deviceStatusData.ts
|
|
|
* @Description: 设备状态数据
|
|
|
*/
|
|
|
import { generateRandomDateTimeByYear } from "../utils/mockMoment";
|
|
|
function fetchList(): Record<string, any>[] {
|
|
|
const currList: Record<string, any>[] = [];
|
|
|
const nameArr = [
|
|
|
"摄像模组表面缺陷检测设备",
|
|
|
"镜片表面缺陷检测设备",
|
|
|
"中板表面缺陷检测设备",
|
|
|
"Logo表面缺陷检测设备",
|
|
|
"手机电池表面缺陷检测设备",
|
|
|
"部件表面缺陷检测设备",
|
|
|
"边距缺陷检测设备",
|
|
|
"成品组装缺陷检测设备",
|
|
|
"金属工件表面缺陷检测设备",
|
|
|
"管材表面缺陷检测设备"
|
|
|
];
|
|
|
|
|
|
const codeArr = ["MSRF", "RL0F", "TLOC", "E1AIS", "CRM"];
|
|
|
const deviceGroupArr = ["立杆", "东西货区", "送料区"];
|
|
|
|
|
|
for (let i = 0; i < 35; i++) {
|
|
|
currList.push({
|
|
|
id: i,
|
|
|
createTime: generateRandomDateTimeByYear(2023),
|
|
|
updateTime: "2023-10-17T02:35:41.14308Z",
|
|
|
name: nameArr[Math.floor(Math.random() * 3)],
|
|
|
code: codeArr[Math.floor(Math.random() * 4)] + "-" + i,
|
|
|
deviceGroup:
|
|
|
deviceGroupArr[Math.floor(Math.random() * 3)] +
|
|
|
(Math.floor(Math.random() * 3) + 1),
|
|
|
status: Math.floor(Math.random() * 3) + 1,
|
|
|
remark: ""
|
|
|
});
|
|
|
}
|
|
|
return currList;
|
|
|
}
|
|
|
|
|
|
// 缺陷从EXL里选几个就好了
|
|
|
// 告警代码MSRF-0 RL0F HTFIF-02 TLOC-1 E1AIS-05
|
|
|
// 设备组:核心检测组001 无尘总装组005 送料监测线02
|
|
|
|
|
|
const mockHistroyData = [
|
|
|
{
|
|
|
id: 10,
|
|
|
key: "10",
|
|
|
video_url: "https://www.w3schools.com/html/mov_bbb.mp4",
|
|
|
created_at: "2025-03-12 14:53:36",
|
|
|
device: 1
|
|
|
},
|
|
|
{
|
|
|
id: 11,
|
|
|
key: "11",
|
|
|
video_url: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4",
|
|
|
created_at: "2025-03-12 15:20:15",
|
|
|
device: 1
|
|
|
},
|
|
|
{
|
|
|
id: 12,
|
|
|
key: "12",
|
|
|
video_url: "https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
|
|
|
created_at: "2025-03-13 09:45:22",
|
|
|
device: 1
|
|
|
},
|
|
|
{
|
|
|
id: 20,
|
|
|
key: "10",
|
|
|
video_url: "https://www.w3schools.com/html/mov_bbb.mp4",
|
|
|
created_at: "2025-03-12 14:53:36",
|
|
|
device: 1
|
|
|
},
|
|
|
{
|
|
|
id: 21,
|
|
|
key: "11",
|
|
|
video_url: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4",
|
|
|
created_at: "2025-03-12 15:20:15",
|
|
|
device: 1
|
|
|
},
|
|
|
{
|
|
|
id: 22,
|
|
|
key: "12",
|
|
|
video_url: "https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
|
|
|
created_at: "2025-03-13 09:45:22",
|
|
|
device: 1
|
|
|
},
|
|
|
// {
|
|
|
// id: 10,
|
|
|
// key: "10",
|
|
|
// video_url: "https://www.w3schools.com/html/mov_bbb.mp4",
|
|
|
// created_at: "2025-03-12 14:53:36",
|
|
|
// device: 1
|
|
|
// },
|
|
|
// {
|
|
|
// id: 11,
|
|
|
// key: "11",
|
|
|
// video_url: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4",
|
|
|
// created_at: "2025-03-12 15:20:15",
|
|
|
// device: 1
|
|
|
// },
|
|
|
// {
|
|
|
// id: 12,
|
|
|
// key: "12",
|
|
|
// video_url: "https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
|
|
|
// created_at: "2025-03-13 09:45:22",
|
|
|
// device: 1
|
|
|
// },
|
|
|
// {
|
|
|
// id: 10,
|
|
|
// key: "10",
|
|
|
// video_url: "https://www.w3schools.com/html/mov_bbb.mp4",
|
|
|
// created_at: "2025-03-12 14:53:36",
|
|
|
// device: 1
|
|
|
// },
|
|
|
// {
|
|
|
// id: 11,
|
|
|
// key: "11",
|
|
|
// video_url: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4",
|
|
|
// created_at: "2025-03-12 15:20:15",
|
|
|
// device: 1
|
|
|
// },
|
|
|
// {
|
|
|
// id: 12,
|
|
|
// key: "12",
|
|
|
// video_url: "https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
|
|
|
// created_at: "2025-03-13 09:45:22",
|
|
|
// device: 1
|
|
|
// },
|
|
|
// {
|
|
|
// id: 10,
|
|
|
// key: "10",
|
|
|
// video_url: "https://www.w3schools.com/html/mov_bbb.mp4",
|
|
|
// created_at: "2025-03-12 14:53:36",
|
|
|
// device: 1
|
|
|
// },
|
|
|
// {
|
|
|
// id: 11,
|
|
|
// key: "11",
|
|
|
// video_url: "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4",
|
|
|
// created_at: "2025-03-12 15:20:15",
|
|
|
// device: 1
|
|
|
// },
|
|
|
// {
|
|
|
// id: 12,
|
|
|
// key: "12",
|
|
|
// video_url: "https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
|
|
|
// created_at: "2025-03-13 09:45:22",
|
|
|
// device: 1
|
|
|
// }
|
|
|
];
|
|
|
|
|
|
|
|
|
const currentData = fetchList();
|
|
|
const currentHistroyData = mockHistroyData;
|
|
|
|
|
|
//
|
|
|
export const deviceStatusListData = {
|
|
|
data: {
|
|
|
data: currentData,
|
|
|
total: currentData.length,
|
|
|
current: 1,
|
|
|
pageSize: 10
|
|
|
}
|
|
|
};
|
|
|
|
|
|
export const deviceHistoryListData = {
|
|
|
data: currentHistroyData
|
|
|
}
|
|
|
|
|
|
|