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.
102 lines
3.0 KiB
TypeScript
102 lines
3.0 KiB
TypeScript
/*
|
|
* @Author: donghao donghao@supervision.ltd
|
|
* @Date: 2024-04-24 17:51:07
|
|
* @LastEditors: donghao donghao@supervision.ltd
|
|
* @LastEditTime: 2024-05-10 16:45:05
|
|
* @FilePath: \general-ai-platform-web\mock\pools\businessModelData.ts
|
|
* @Description: mock 业务模型数据
|
|
*/
|
|
import { generateRandomString } from '../utils/mockHash';
|
|
import { generateRandomDateTimeByYear } from '../utils/mockMoment';
|
|
|
|
const generatrModels = () => {
|
|
const currList: Record<string, any>[] = [];
|
|
const count = 1 + Math.floor(Math.random() * 8);
|
|
for (let i = 0; i < count; i++) {
|
|
currList.push({
|
|
id: i + '1',
|
|
createTime: generateRandomDateTimeByYear(2022),
|
|
updateTime: generateRandomDateTimeByYear(2023),
|
|
name: '基础模型' + (i + 1), // 设备名称
|
|
});
|
|
}
|
|
return currList;
|
|
};
|
|
// 业务模型列表
|
|
const startBusinessModelList = () => {
|
|
const currList: Record<string, any>[] = [];
|
|
const nameArr = ['陌生人群检测', '在岗打瞌睡检测', '上班离岗检测'];
|
|
const count = nameArr.length;
|
|
const baseVersion = 'V' + Math.floor(Math.random() * 10);
|
|
const currFileTime = new Date().getTime();
|
|
const randomString = generateRandomString(20);
|
|
// const hash = generateHash(randomString)
|
|
for (let i = 0; i < count; i++) {
|
|
currList.push({
|
|
id: i + '1',
|
|
createTime: generateRandomDateTimeByYear(2022),
|
|
updateTime: generateRandomDateTimeByYear(2023),
|
|
isEnable: Math.floor(Math.random() * 8) % 2 === 0,
|
|
bussnessName: '目标检测',
|
|
industry: '通用',
|
|
name: nameArr[i],
|
|
deviceSort: '文字识别',
|
|
remark: '精确定位装配部件的中心位置并检测可能的缺陷,确保装配精度。',
|
|
defaultVersionFkId: 'V1.6.25',
|
|
type: '经典算法',
|
|
provider: '苏胜天',
|
|
linkModels: generatrModels(),
|
|
});
|
|
}
|
|
return {
|
|
count,
|
|
results: currList,
|
|
};
|
|
};
|
|
|
|
// 基础模型列表
|
|
const startBaseBusinessModelList = () => {
|
|
const currList: Record<string, any>[] = [];
|
|
const nameArr = ['玩手机识别', '打瞌睡识别', '离岗检测'];
|
|
const count = nameArr.length;
|
|
const baseVersion = 'V' + Math.floor(Math.random() * 10);
|
|
const currFileTime = new Date().getTime();
|
|
const randomString = generateRandomString(20);
|
|
// const hash = generateHash(randomString)
|
|
for (let i = 0; i < count; i++) {
|
|
const isEnable = i === 0;
|
|
currList.push({
|
|
id: i + '1',
|
|
createTime: generateRandomDateTimeByYear(2022),
|
|
updateTime: generateRandomDateTimeByYear(2023),
|
|
industry: '通用',
|
|
name: nameArr[i],
|
|
deviceSort: '文字识别',
|
|
defaultVersionFkId: 'V1.6.25',
|
|
type: '经典算法',
|
|
provider: '苏胜天',
|
|
});
|
|
}
|
|
return {
|
|
count,
|
|
results: currList,
|
|
};
|
|
};
|
|
|
|
// 业务模型
|
|
export const mockGetBusinessModelListData = {
|
|
data: {
|
|
next: null,
|
|
previous: null,
|
|
...JSON.parse(JSON.stringify(startBusinessModelList())),
|
|
},
|
|
};
|
|
// 基础模型
|
|
export const mockGetBaseBusinessModelListData = {
|
|
data: {
|
|
next: null,
|
|
previous: null,
|
|
...startBaseBusinessModelList(),
|
|
},
|
|
};
|