You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.3 KiB
TypeScript

/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-26 16:18:26
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-10 17:13:03
* @FilePath: \general-ai-platform-web\mock\pools\deviceData.ts
* @Description: mock 设备数据
*/
// 节点下设备列表数据
// 节点设备列表
import { generateRandomDateTimeByYear } from '../utils/mockMoment';
const fetchAllDeviceListByGroup = () => {
const nameArr = [
'海康威视球形摄像头',
'海康威视摄像头',
'大华摄像头',
'宝盈监控摄像头',
'安迅达监控摄像头',
'华为监控摄像头',
'海思监控摄像头',
'中维监控摄像头',
'罗普斯金监控摄像头',
'美电贝斯监控摄像头',
'索尼监控摄像头',
'松下监控摄像头',
'三星监控摄像头',
'小米监控摄像头',
'TP-Link监控摄像头',
'Vivotek监控摄像头',
'网视通监控摄像头',
'微拓监控摄像头',
'云从监控摄像头',
'摩托罗拉监控摄像头',
'新大陆监控摄像头',
];
const count = 1 + Math.floor(Math.random() * (nameArr.length - 1));
let currList = [];
for (let i = 0; i < count; i++) {
const ip1 = Math.floor(Math.random() * 255);
const ip2 = Math.floor(Math.random() * 255);
const port = 80;
currList.push({
id: i + '1',
createTime: generateRandomDateTimeByYear(2022),
updateTime: generateRandomDateTimeByYear(2023),
name: nameArr[i], // 设备名称
deviceType: '摄像头', // 设备类型
isEnable: true, // 是否部署
deviceSite: '东区左侧', // 设备位置
deviceModel: 'video_2024', // 设备型号
deviceParams: '627663_aduh237298', // 设备参数
remark: '精确定位装配部件的中心位置并检测可能的缺陷,确保装配精度。', // 备注
});
}
return {
count: currList.length,
results: currList,
};
};
export const mockGetAllDeviceList = {
data: {
...fetchAllDeviceListByGroup(),
},
};
export const mockGetDeviceListByGroup = {
data: {
count: 2,
results: [
{
id: '10001',
name: '海康威视环球摄像头', // 设备名称
bussnessName: '装配目标检测',
deviceType: '摄像头', // 设备类型
isEnable: true, // 是否部署
createTime: '2023-12-17T13:37:31.758471+08:00',
updateTime: '2024-04-25T15:22:16.530494+08:00',
deviceSite: '东区左侧', // 设备位置
deviceModel: 'haikang_video_2024', // 设备型号
deviceParams: '627663_aduh237298', // 设备参数
remark: '精确定位装配部件的中心位置并检测可能的缺陷,确保装配精度。', // 备注
},
{
id: '10002',
name: '海康威视环球摄像头',
bussnessName: '控制目标检测',
deviceType: '控制器',
isEnable: false,
createTime: '2023-12-17T13:37:31.758471+08:00',
updateTime: '2024-04-25T15:22:16.530494+08:00',
deviceSite: '南区前侧',
deviceModel: 'haikang_video_2024',
deviceParams: '627663_aduh237298',
remark: '精确定位装配部件的中心位置并检测可能的缺陷,确保装配精度。',
},
],
page: 1,
pageSize: 10,
},
};