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.
General-AI-Platform-Web/mock/pools/businessModelData.ts

87 lines
2.6 KiB
TypeScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-24 17:51:07
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-25 15:19:23
* @FilePath: \general-ai-platform-web\mock\pools\businessModelData.ts
* @Description: mock 业务模型数据
*/
import { generateRandomString } from '../utils/mockHash';
import { generateRandomDateTimeByYear } from '../utils/mockMoment';
// 模型列表
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++) {
const isEnable = i === 0;
currList.push({
id: i + '1',
createTime: generateRandomDateTimeByYear(2022),
updateTime: generateRandomDateTimeByYear(2023),
industry: '通用',
name: nameArr[i],
deviceSort: '文字识别',
remark:
'光学字符识别OCR是可进行字体训练的工具用于自动识别字符。它可以防止误读、处理流程变化并提供轻松的字体管理。',
defaultVersionFkId: 'V1.6.25',
type: '经典算法',
provider: '苏胜天',
});
}
return {
count,
results: currList,
};
};
export const mockGetBusinessModelListData = {
data: {
next: null,
previous: null,
...JSON.parse(JSON.stringify(startBusinessModelList())),
},
};
// 基础模型列表
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 mockGetBaseBusinessModelListData = {
data: {
next: null,
previous: null,
...startBaseBusinessModelList(),
},
};