feat: 资源、设备mock数据完成
parent
9af58943f3
commit
a9134e7bf3
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-24 17:18:11
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 13:44:15
|
||||
* @FilePath: \general-ai-platform-web\mock\modelVersion.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
/**算法模型模块 mock */
|
||||
|
||||
import { mockGetAlgorithmModelFkSelectData , mockGetAlgorithmModelListData} from './pools/algorithmModelData';
|
||||
import { successMockApiProps } from './typing';
|
||||
import { fetchCurrPageByList, fetchMockSuccessFullByOther } from './utils/apiMock';
|
||||
export default {
|
||||
// 选择模型
|
||||
'POST /api/v1/algorithm_model/getAlgorithmModelFkSelect': async (req: Request, res: Response) => {
|
||||
const resData: successMockApiProps = {
|
||||
...fetchMockSuccessFullByOther(mockGetAlgorithmModelFkSelectData),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
// 模型列表
|
||||
'POST /api/v1/algorithm_model/getAlgorithmModelList': async (req: Request, res: Response) => {
|
||||
console.log(req, 'getModelVersionList_req')
|
||||
const { page , pageSize} = req.body;
|
||||
const resData: successMockApiProps = {
|
||||
...fetchCurrPageByList({...mockGetAlgorithmModelListData, data: {...mockGetAlgorithmModelListData.data, page, pageSize: pageSize || 10} }),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
};
|
@ -0,0 +1,28 @@
|
||||
|
||||
/**业务镜像模块 mock */
|
||||
|
||||
import { mockGetBusinessImageListData } from './pools/businessImageData';
|
||||
import { successMockApiProps } from './typing';
|
||||
import { fetchCurrPageByList } from './utils/apiMock';
|
||||
export default {
|
||||
// 业务镜像列表分页
|
||||
'POST /api/v1/business_image/getBusinessImageList': async (req: Request, res: Response) => {
|
||||
const { page, pageSize } = req.body;
|
||||
|
||||
const resData: successMockApiProps = {
|
||||
...fetchCurrPageByList({
|
||||
...mockGetBusinessImageListData,
|
||||
data: { ...mockGetBusinessImageListData.data, page, pageSize: pageSize || 10 },
|
||||
}),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
|
||||
// 选择模型
|
||||
// 'POST /api/v1/model_version/getModelVersionFkSelect': async (req: Request, res: Response) => {
|
||||
// const resData: successMockApiProps = {
|
||||
// ...fetchMockSuccessFullByOther(mockGetModelVersionFkSelect),
|
||||
// };
|
||||
// res.send(resData);
|
||||
// }
|
||||
};
|
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-25 16:53:15
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 17:29:39
|
||||
* @FilePath: \general-ai-platform-web\mock\deviceCategory.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
|
||||
/**设备组模块 mock */
|
||||
|
||||
import { mockGetDeviceListData } from './pools/deviceData';
|
||||
import { successMockApiProps } from './typing';
|
||||
import { fetchCurrPageByList , fetchMockSuccessFullByOther} from './utils/apiMock';
|
||||
export default {
|
||||
// 设备组列表分页
|
||||
'POST /api/v1/device/getDeviceList': async (req: Request, res: Response) => {
|
||||
const { page, pageSize } = req.body;
|
||||
|
||||
const resData: successMockApiProps = {
|
||||
...fetchCurrPageByList({
|
||||
...mockGetDeviceListData,
|
||||
data: { ...mockGetDeviceListData.data, page, pageSize: pageSize || 10 },
|
||||
}),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
|
||||
// 选择模型
|
||||
// 'POST /api/v1/model_version/12': async (req: Request, res: Response) => {
|
||||
// const resData: successMockApiProps = {
|
||||
// ...fetchMockSuccessFullByOther(mockGetDeviceGroupFkSelectData),
|
||||
// };
|
||||
// res.send(resData);
|
||||
// }
|
||||
};
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-25 16:53:15
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 17:29:25
|
||||
* @FilePath: \general-ai-platform-web\mock\deviceCategory.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
|
||||
/**设备组模块 mock */
|
||||
|
||||
import {
|
||||
mockGetDeviceCategoryFkSelectData,
|
||||
mockGetDeviceCategoryListData,
|
||||
} from './pools/deviceCategoryData';
|
||||
import { successMockApiProps } from './typing';
|
||||
import { fetchCurrPageByList , fetchMockSuccessFullByOther} from './utils/apiMock';
|
||||
export default {
|
||||
// 设备组列表分页
|
||||
'POST /api/v1/device_category/getDeviceCategoryList': async (req: Request, res: Response) => {
|
||||
const { page, pageSize } = req.body;
|
||||
|
||||
const resData: successMockApiProps = {
|
||||
...fetchCurrPageByList({
|
||||
...mockGetDeviceCategoryListData,
|
||||
data: { ...mockGetDeviceCategoryListData.data, page, pageSize: pageSize || 10 },
|
||||
}),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
|
||||
// 设备类别选项列表不分页
|
||||
'POST /api/v1/device_category/getDeviceCategoryFkSelect': async (req: Request, res: Response) => {
|
||||
const resData: successMockApiProps = {
|
||||
...fetchMockSuccessFullByOther(mockGetDeviceCategoryFkSelectData),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
};
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-25 16:53:15
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 17:40:01
|
||||
* @FilePath: \general-ai-platform-web\mock\deviceCategory.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
|
||||
/**设备组模块 mock */
|
||||
|
||||
import {
|
||||
mockGetDeviceGroupFkSelectData,
|
||||
mockGetDeviceGroupListData,
|
||||
mockGetDeviceGroupTreeData,
|
||||
} from './pools/deviceGroupData';
|
||||
import { successMockApiProps } from './typing';
|
||||
import { fetchCurrPageByList, fetchMockSuccessFullByOther } from './utils/apiMock';
|
||||
export default {
|
||||
// 设备组列表分页
|
||||
'POST /api/v1/device_group/getDeviceGroupList': async (req: Request, res: Response) => {
|
||||
const { page, pageSize } = req.body;
|
||||
|
||||
const resData: successMockApiProps = {
|
||||
...fetchCurrPageByList({
|
||||
...mockGetDeviceGroupListData,
|
||||
data: { ...mockGetDeviceGroupListData.data, page, pageSize: pageSize || 10 },
|
||||
}),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
|
||||
// 设备组网点选项列表
|
||||
'POST /api/v1/device_group/getDeviceGroupFkSelect': async (req: Request, res: Response) => {
|
||||
const resData: successMockApiProps = {
|
||||
...fetchMockSuccessFullByOther(mockGetDeviceGroupFkSelectData),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
// 设备组网点树列表
|
||||
'POST /api/v1/device_group/getDeviceGroupTree': async (req: Request, res: Response) => {
|
||||
const resData: successMockApiProps = {
|
||||
...fetchMockSuccessFullByOther(mockGetDeviceGroupTreeData),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
};
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-25 13:34:56
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 14:00:57
|
||||
* @FilePath: \general-ai-platform-web\mock\modelCategory.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
/**模型类别模块 mock */
|
||||
|
||||
import {
|
||||
mockGetModelCategoryFkSelectData,
|
||||
mockGetModelCategoryListData,
|
||||
} from './pools/modelCategoryData';
|
||||
import { successMockApiProps } from './typing';
|
||||
import { fetchMockSuccessFullByOther } from './utils/apiMock';
|
||||
export default {
|
||||
// 模型类别列表
|
||||
'POST /api/v1/model_category/getModelCategoryList': async (req: Request, res: Response) => {
|
||||
const resData: successMockApiProps = {
|
||||
...fetchMockSuccessFullByOther(mockGetModelCategoryListData),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
|
||||
// 模型类别列表
|
||||
'POST /api/v1/model_category/getModelCategoryFkSelect': async (req: Request, res: Response) => {
|
||||
const resData: successMockApiProps = {
|
||||
...fetchMockSuccessFullByOther(mockGetModelCategoryFkSelectData),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
};
|
@ -0,0 +1,15 @@
|
||||
/**模型镜像模块 mock */
|
||||
|
||||
import { mockGetModelImageListData } from './pools/modelImageData';
|
||||
import { successMockApiProps } from './typing';
|
||||
import { fetchCurrPageByList, fetchMockSuccessFullByOther } from './utils/apiMock';
|
||||
export default {
|
||||
|
||||
// 选择模型镜像列表
|
||||
'POST /api/v1/model_image/getModelImageList': async (req: Request, res: Response) => {
|
||||
const resData: successMockApiProps = {
|
||||
...fetchMockSuccessFullByOther(mockGetModelImageListData),
|
||||
};
|
||||
res.send(resData);
|
||||
}
|
||||
};
|
@ -1 +1,33 @@
|
||||
// 模型版本 mock
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-24 17:18:11
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 13:09:42
|
||||
* @FilePath: \general-ai-platform-web\mock\modelVersion.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
/**模型版本模块 mock */
|
||||
|
||||
import { mockGetModelVersionListData , mockGetModelVersionFkSelect} from './pools/modelVersionData';
|
||||
import { successMockApiProps } from './typing';
|
||||
import { fetchCurrPageByList, fetchMockSuccessFullByOther } from './utils/apiMock';
|
||||
export default {
|
||||
// 获取模型版本列表
|
||||
'POST /api/v1/model_version/getModelVersionList': async (req: Request, res: Response) => {
|
||||
console.log(req, 'getModelVersionList_req')
|
||||
const { page , pageSize} = req.body;
|
||||
|
||||
const resData: successMockApiProps = {
|
||||
...fetchCurrPageByList({...mockGetModelVersionListData, data: {...mockGetModelVersionListData.data, page, pageSize: pageSize || 10} }),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
|
||||
// 选择模型
|
||||
'POST /api/v1/model_version/getModelVersionFkSelect': async (req: Request, res: Response) => {
|
||||
const resData: successMockApiProps = {
|
||||
...fetchMockSuccessFullByOther(mockGetModelVersionFkSelect),
|
||||
};
|
||||
res.send(resData);
|
||||
}
|
||||
};
|
||||
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-25 16:35:15
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 16:45:13
|
||||
* @FilePath: \general-ai-platform-web\mock\pools\businessImageData.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
/**业务镜像- */
|
||||
|
||||
|
||||
// 业务镜像列表分页
|
||||
export const mockGetBusinessImageListData = {
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
createTime: '2024-01-25T16:36:06.575908+08:00',
|
||||
updateTime: '2024-01-25T16:36:06.575908+08:00',
|
||||
name: '测试123',
|
||||
version: 'v1',
|
||||
projectFkId: 38,
|
||||
path: 'http://jingxiang.com',
|
||||
startCode: '123',
|
||||
config: null,
|
||||
configHash: '',
|
||||
remark: '',
|
||||
},
|
||||
],
|
||||
total: 1,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
};
|
||||
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-25 16:53:24
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 17:34:49
|
||||
* @FilePath: \general-ai-platform-web\mock\pools\deviceCategoryData.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
|
||||
/**设备类别- */
|
||||
|
||||
// 设备类别列表分页
|
||||
export const mockGetDeviceCategoryListData = {
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
createTime: '2023-10-17T10:35:41.14308+08:00',
|
||||
updateTime: '2023-10-17T10:35:41.14308+08:00',
|
||||
name: '监控1',
|
||||
code: 'DC00002',
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
createTime: '2023-10-17T10:40:28.292883+08:00',
|
||||
updateTime: '2023-10-26T11:02:51.356036+08:00',
|
||||
name: '控制器',
|
||||
code: 'DC00003',
|
||||
remark: '',
|
||||
},
|
||||
],
|
||||
total: 2,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
};
|
||||
|
||||
// 设备类别选项列表不分页
|
||||
export const mockGetDeviceCategoryFkSelectData = {
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
name: '监控1',
|
||||
id: 1,
|
||||
},
|
||||
{
|
||||
name: '控制器',
|
||||
id: 2,
|
||||
},
|
||||
],
|
||||
}
|
||||
};
|
@ -0,0 +1,83 @@
|
||||
|
||||
/**设备- */
|
||||
|
||||
// 设备列表分页
|
||||
export const mockGetDeviceListData= {
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
id: 2,
|
||||
createTime: '2023-10-17T10:47:51.629494+08:00',
|
||||
updateTime: '2023-10-26T11:02:39.559715+08:00',
|
||||
name: '控制设备1',
|
||||
code: 'DEVICE00002',
|
||||
position: '',
|
||||
param: '',
|
||||
spec: '',
|
||||
categoryFkId: 2,
|
||||
groupFkId: 3,
|
||||
isEnable: true,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
createTime: '2023-10-17T14:59:28.10666+08:00',
|
||||
updateTime: '2023-12-28T16:15:37.839819+08:00',
|
||||
name: '监控2',
|
||||
code: 'DEVICE00003',
|
||||
position: '',
|
||||
param: 'rtsp://192.168.10.14:8554/mystream',
|
||||
spec: '',
|
||||
categoryFkId: 1,
|
||||
groupFkId: 3,
|
||||
isEnable: true,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
createTime: '2023-10-17T15:05:53.494168+08:00',
|
||||
updateTime: '2023-10-17T15:05:53.494168+08:00',
|
||||
name: '监控3',
|
||||
code: 'DEVICE00004',
|
||||
position: '',
|
||||
param: '',
|
||||
spec: '',
|
||||
categoryFkId: 1,
|
||||
groupFkId: 5,
|
||||
isEnable: true,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
createTime: '2023-10-18T17:08:22.249904+08:00',
|
||||
updateTime: '2023-10-18T17:08:22.249904+08:00',
|
||||
name: '监控1',
|
||||
code: 'DEVICE00005',
|
||||
position: '',
|
||||
param: 'rtsp://admin:123456abc@192.168.10.83',
|
||||
spec: '',
|
||||
categoryFkId: 1,
|
||||
groupFkId: 3,
|
||||
isEnable: true,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
createTime: '2023-10-25T14:05:16.797145+08:00',
|
||||
updateTime: '2023-10-25T15:59:06.907597+08:00',
|
||||
name: '监控5',
|
||||
code: 'DEVICE00006',
|
||||
position: '大厅1',
|
||||
param: 'rtsp://admin:@192.168.10.203',
|
||||
spec: '',
|
||||
categoryFkId: 1,
|
||||
groupFkId: 2,
|
||||
isEnable: true,
|
||||
remark: '',
|
||||
},
|
||||
],
|
||||
total: 5,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
};
|
@ -0,0 +1,174 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-25 16:32:31
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 17:33:13
|
||||
* @FilePath: \general-ai-platform-web\mock\pools\deviceGroupData.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
/**设备组- */
|
||||
// 设备组网点选项列表
|
||||
export const mockGetDeviceGroupFkSelectData = {
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
name: '南京网点',
|
||||
id: 1,
|
||||
},
|
||||
{
|
||||
name: '秦淮网点',
|
||||
id: 2,
|
||||
},
|
||||
{
|
||||
name: '江宁网点',
|
||||
id: 3,
|
||||
},
|
||||
{
|
||||
name: '安徽网点',
|
||||
id: 4,
|
||||
},
|
||||
{
|
||||
name: '合肥网点',
|
||||
id: 5,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
// 设备组网点树
|
||||
export const mockGetDeviceGroupTreeData = {
|
||||
data: {
|
||||
tree: [
|
||||
{
|
||||
title: '南京网点1',
|
||||
key: 1,
|
||||
children: [
|
||||
{
|
||||
title: '秦淮网点',
|
||||
key: 2,
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
title: '江宁网点',
|
||||
key: 3,
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '安徽网点',
|
||||
key: 4,
|
||||
children: [
|
||||
{
|
||||
title: '合肥网点',
|
||||
key: 5,
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
// 设备组列表分页
|
||||
export const mockGetDeviceGroupListData = {
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
createTime: '2023-10-17T10:43:31.254107+08:00',
|
||||
updateTime: '2023-10-17T10:45:25.030034+08:00',
|
||||
name: '南京网点',
|
||||
code: 'DG00002',
|
||||
address: '江苏省南京市南京市栖霞区紫东路南京紫东国际创意园',
|
||||
telephone: '12345',
|
||||
lon: '118.914349',
|
||||
lat: '32.086019',
|
||||
managerName: '张三',
|
||||
managerPhone: '111111111',
|
||||
isEnable: true,
|
||||
parentFkId: 0,
|
||||
remark: '',
|
||||
children: [
|
||||
{
|
||||
id: 2,
|
||||
createTime: '2023-10-17T13:37:31.758471+08:00',
|
||||
updateTime: '2023-10-17T13:39:31.530494+08:00',
|
||||
name: '秦淮网点',
|
||||
code: 'DG00003',
|
||||
address: '江苏省南京市秦淮区中山南路79号',
|
||||
telephone: '',
|
||||
lon: '118.791819',
|
||||
lat: '32.045002',
|
||||
managerName: '',
|
||||
managerPhone: '',
|
||||
isEnable: true,
|
||||
parentFkId: 1,
|
||||
remark: '',
|
||||
children: null,
|
||||
key: '2',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
createTime: '2023-10-17T13:40:28.823372+08:00',
|
||||
updateTime: '2023-10-17T13:40:28.823372+08:00',
|
||||
name: '江宁网点',
|
||||
code: 'DG00004',
|
||||
address: '江苏省南京市经济技术开发区双龙大道1680号',
|
||||
telephone: '',
|
||||
lon: '118.824682',
|
||||
lat: '31.937062',
|
||||
managerName: '',
|
||||
managerPhone: '',
|
||||
isEnable: true,
|
||||
parentFkId: 1,
|
||||
remark: '',
|
||||
children: null,
|
||||
key: '3',
|
||||
},
|
||||
],
|
||||
key: '1',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
createTime: '2023-10-17T15:02:30.725705+08:00',
|
||||
updateTime: '2023-10-17T15:02:30.725705+08:00',
|
||||
name: '安徽网点',
|
||||
code: 'DG00005',
|
||||
address: '',
|
||||
telephone: '',
|
||||
lon: '',
|
||||
lat: '',
|
||||
managerName: '',
|
||||
managerPhone: '',
|
||||
isEnable: true,
|
||||
parentFkId: 0,
|
||||
remark: '',
|
||||
children: [
|
||||
{
|
||||
id: 5,
|
||||
createTime: '2023-10-17T15:05:13.542992+08:00',
|
||||
updateTime: '2023-10-17T15:08:01.071315+08:00',
|
||||
name: '合肥网点',
|
||||
code: 'DG00006',
|
||||
address: '安徽省合肥市包河区马鞍山路130号',
|
||||
telephone: '',
|
||||
lon: '117.309214',
|
||||
lat: '31.862594',
|
||||
managerName: '',
|
||||
managerPhone: '',
|
||||
isEnable: true,
|
||||
parentFkId: 4,
|
||||
remark: '',
|
||||
children: null,
|
||||
key: '5',
|
||||
},
|
||||
],
|
||||
key: '4',
|
||||
},
|
||||
],
|
||||
total: 0,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
};
|
@ -0,0 +1,44 @@
|
||||
/**模型类别 */
|
||||
|
||||
// 模型列表列表分页
|
||||
export const mockGetModelCategoryListData = {
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
createTime: '2023-10-19T14:42:20.743086+08:00',
|
||||
updateTime: '2023-10-19T14:42:20.743086+08:00',
|
||||
name: 'ocr识别1',
|
||||
code: 'MC00001',
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
createTime: '2023-10-20T13:55:51.395842+08:00',
|
||||
updateTime: '2023-10-20T13:55:51.395842+08:00',
|
||||
name: '目标识别',
|
||||
code: 'MC00002',
|
||||
remark: '',
|
||||
},
|
||||
],
|
||||
total: 2,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
};
|
||||
|
||||
// 模型列表不分页
|
||||
export const mockGetModelCategoryFkSelectData = {
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
name: 'ocr识别1',
|
||||
id: 1,
|
||||
},
|
||||
{
|
||||
name: '目标识别',
|
||||
id: 2,
|
||||
},
|
||||
],
|
||||
}
|
||||
};
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-25 09:54:36
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 13:20:48
|
||||
* @FilePath: \general-ai-platform-web\mock\pools\modelImage.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
/**模型镜像-选择模型 */
|
||||
// 模型镜像列表
|
||||
export const mockGetModelImageListData = {
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
createTime: '2023-12-28T10:53:15.871746+08:00',
|
||||
updateTime: '2023-12-28T10:53:15.871746+08:00',
|
||||
name: 'ubuntu基础1',
|
||||
path: '192.168.10.60:5000/ubuntu:v1',
|
||||
startCode: '',
|
||||
remark: '',
|
||||
},
|
||||
],
|
||||
total: 1,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
};
|
@ -0,0 +1,487 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-25 16:43:31
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 17:43:43
|
||||
* @FilePath: \general-ai-platform-web\mock\pools\projectData.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
/**项目- */
|
||||
|
||||
// 项目选项 (不分页)
|
||||
export const mockGetProjectFkSelectData = {
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
name: '玩手机1',
|
||||
id: 38,
|
||||
},
|
||||
{
|
||||
name: '离岗检测',
|
||||
id: 40,
|
||||
},
|
||||
{
|
||||
name: '打瞌睡检测',
|
||||
id: 39,
|
||||
},
|
||||
{
|
||||
name: '测试',
|
||||
id: 42,
|
||||
},
|
||||
{
|
||||
name: '测试1',
|
||||
id: 43,
|
||||
},
|
||||
{
|
||||
name: '测试2',
|
||||
id: 44,
|
||||
},
|
||||
{
|
||||
name: '测试4',
|
||||
id: 46,
|
||||
},
|
||||
{
|
||||
name: '测试5',
|
||||
id: 47,
|
||||
},
|
||||
{
|
||||
name: '测试6',
|
||||
id: 48,
|
||||
},
|
||||
{
|
||||
name: '测试7',
|
||||
id: 49,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
// 项目列表 分页
|
||||
export const mockGetProjectListData = {
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
id: 38,
|
||||
createTime: '2023-10-24T14:03:52.959113+08:00',
|
||||
updateTime: '2023-10-24T14:03:52.959113+08:00',
|
||||
name: '玩手机1',
|
||||
code: 'XM00038',
|
||||
info: '玩手机',
|
||||
projectFilePath:
|
||||
'uploads/file/project/files/da9c3e5bd8bdf5026aa47bee87e81ccc_20231024140343.zip',
|
||||
inferConfig: {
|
||||
models: [5],
|
||||
params: [],
|
||||
},
|
||||
isEnable: true,
|
||||
groupIds: null,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 39,
|
||||
createTime: '2023-10-25T13:06:28.092394+08:00',
|
||||
updateTime: '2023-10-25T13:06:28.092394+08:00',
|
||||
name: '打瞌睡检测',
|
||||
code: 'XM00039',
|
||||
info: '打瞌睡',
|
||||
projectFilePath: '',
|
||||
inferConfig: {
|
||||
models: [7],
|
||||
params: [],
|
||||
},
|
||||
isEnable: true,
|
||||
groupIds: null,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 40,
|
||||
createTime: '2023-10-25T14:01:24.985459+08:00',
|
||||
updateTime: '2023-10-25T14:01:24.985459+08:00',
|
||||
name: '离岗检测',
|
||||
code: 'XM00040',
|
||||
info: '离岗检测',
|
||||
projectFilePath: '',
|
||||
inferConfig: {
|
||||
models: [8],
|
||||
params: [],
|
||||
},
|
||||
isEnable: true,
|
||||
groupIds: null,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 42,
|
||||
createTime: '2023-11-06T10:11:06.735872+08:00',
|
||||
updateTime: '2023-11-06T10:11:06.735872+08:00',
|
||||
name: '测试',
|
||||
code: 'XM00042',
|
||||
info: '测试1',
|
||||
projectFilePath: '',
|
||||
inferConfig: {
|
||||
models: [1],
|
||||
params: [
|
||||
{
|
||||
name: 'model',
|
||||
default: './model_file/yolov5_phone.onnx',
|
||||
},
|
||||
{
|
||||
name: 'model_cache',
|
||||
default: './tensort_cache/yolov5_phone.trt',
|
||||
},
|
||||
{
|
||||
name: 'model_parameter',
|
||||
default: {
|
||||
device: 'gpu',
|
||||
confidence: 0.2,
|
||||
label_names: ['Keypad', 'hands', 'keyboard', 'mouse', 'phone'],
|
||||
object_num_min: false,
|
||||
relevancy_para: 0.001,
|
||||
compara_relevancy: 'overlap',
|
||||
compara_label_names: ['hands', 'phone'],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'save_path',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'test_path',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_path_original',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_annotations',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_videos',
|
||||
default: './video_save_path/hands',
|
||||
},
|
||||
{
|
||||
name: 'detect_time',
|
||||
default: 300,
|
||||
},
|
||||
{
|
||||
name: 'detect_time_small',
|
||||
default: 20,
|
||||
},
|
||||
{
|
||||
name: 'detect_ratio',
|
||||
default: 0.5,
|
||||
},
|
||||
],
|
||||
},
|
||||
isEnable: true,
|
||||
groupIds: null,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 43,
|
||||
createTime: '2023-11-06T13:40:16.031088+08:00',
|
||||
updateTime: '2023-11-06T13:40:16.031088+08:00',
|
||||
name: '测试1',
|
||||
code: 'XM00043',
|
||||
info: '测试1',
|
||||
projectFilePath: '',
|
||||
inferConfig: {
|
||||
models: [1],
|
||||
params: [
|
||||
{
|
||||
name: 'model',
|
||||
default: './model_file/yolov5_phone.onnx',
|
||||
},
|
||||
{
|
||||
name: 'model_cache',
|
||||
default: './tensort_cache/yolov5_phone.trt',
|
||||
},
|
||||
{
|
||||
name: 'model_parameter',
|
||||
default: {
|
||||
device: 'gpu',
|
||||
confidence: 0.2,
|
||||
label_names: ['Keypad', 'hands', 'keyboard', 'mouse', 'phone'],
|
||||
object_num_min: false,
|
||||
relevancy_para: 0.001,
|
||||
compara_relevancy: 'overlap',
|
||||
compara_label_names: ['hands', 'phone'],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'save_path',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'test_path',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_path_original',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_annotations',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_videos',
|
||||
default: './video_save_path/hands',
|
||||
},
|
||||
{
|
||||
name: 'detect_time',
|
||||
default: 300,
|
||||
},
|
||||
{
|
||||
name: 'detect_time_small',
|
||||
default: 20,
|
||||
},
|
||||
{
|
||||
name: 'detect_ratio',
|
||||
default: 0.5,
|
||||
},
|
||||
{
|
||||
name: 'test',
|
||||
default: [
|
||||
{
|
||||
eee: 'eee',
|
||||
},
|
||||
{
|
||||
bbb: 'bbb',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
isEnable: true,
|
||||
groupIds: null,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 44,
|
||||
createTime: '2023-11-06T13:41:20.873017+08:00',
|
||||
updateTime: '2023-11-06T13:41:20.873017+08:00',
|
||||
name: '测试2',
|
||||
code: 'XM00044',
|
||||
info: '测试2',
|
||||
projectFilePath: '',
|
||||
inferConfig: {
|
||||
models: [1],
|
||||
params: [
|
||||
{
|
||||
name: 'model',
|
||||
default: './model_file/yolov5_phone.onnx',
|
||||
},
|
||||
{
|
||||
name: 'model_cache',
|
||||
default: './tensort_cache/yolov5_phone.trt',
|
||||
},
|
||||
{
|
||||
name: 'save_path',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'test_path',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_path_original',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_annotations',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_videos',
|
||||
default: './video_save_path/hands',
|
||||
},
|
||||
{
|
||||
name: 'detect_time',
|
||||
default: 300,
|
||||
},
|
||||
{
|
||||
name: 'detect_time_small',
|
||||
default: 20,
|
||||
},
|
||||
{
|
||||
name: 'detect_ratio',
|
||||
default: 0.5,
|
||||
},
|
||||
],
|
||||
},
|
||||
isEnable: true,
|
||||
groupIds: null,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 46,
|
||||
createTime: '2023-11-06T16:20:16.19561+08:00',
|
||||
updateTime: '2023-11-06T16:20:16.19561+08:00',
|
||||
name: '测试4',
|
||||
code: 'XM00046',
|
||||
info: '测试4',
|
||||
projectFilePath: '',
|
||||
inferConfig: {
|
||||
models: [8],
|
||||
params: [
|
||||
{
|
||||
name: 'model',
|
||||
default: './model_file/yolov5_phone.onnx',
|
||||
},
|
||||
{
|
||||
name: 'model_cache',
|
||||
default: './tensort_cache/yolov5_phone.trt',
|
||||
},
|
||||
{
|
||||
name: 'save_path',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'test_path',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_path_original',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_annotations',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_videos',
|
||||
default: './video_save_path/hands',
|
||||
},
|
||||
{
|
||||
name: 'detect_time',
|
||||
default: 300,
|
||||
},
|
||||
{
|
||||
name: 'detect_time_small',
|
||||
default: 20,
|
||||
},
|
||||
{
|
||||
name: 'detect_ratio',
|
||||
default: 0.5,
|
||||
},
|
||||
],
|
||||
},
|
||||
isEnable: true,
|
||||
groupIds: null,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 47,
|
||||
createTime: '2023-11-06T16:29:11.765524+08:00',
|
||||
updateTime: '2023-11-06T16:29:11.765524+08:00',
|
||||
name: '测试5',
|
||||
code: 'XM00047',
|
||||
info: '测试5',
|
||||
projectFilePath: '',
|
||||
inferConfig: {
|
||||
models: [7, 6],
|
||||
params: [
|
||||
{
|
||||
name: 'model',
|
||||
default: './model_file/yolov5_phone.onnx',
|
||||
},
|
||||
{
|
||||
name: 'model_cache',
|
||||
default: './tensort_cache/yolov5_phone.trt',
|
||||
},
|
||||
{
|
||||
name: 'save_path',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'test_path',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_path_original',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_annotations',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
name: 'save_videos',
|
||||
default: './video_save_path/hands',
|
||||
},
|
||||
{
|
||||
name: 'detect_time',
|
||||
default: 300,
|
||||
},
|
||||
{
|
||||
name: 'detect_time_small',
|
||||
default: 20,
|
||||
},
|
||||
{
|
||||
name: 'detect_ratio',
|
||||
default: 0.5,
|
||||
},
|
||||
],
|
||||
},
|
||||
isEnable: true,
|
||||
groupIds: null,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 48,
|
||||
createTime: '2023-11-07T16:17:51.448947+08:00',
|
||||
updateTime: '2023-11-07T16:17:51.448947+08:00',
|
||||
name: '测试6',
|
||||
code: 'XM00048',
|
||||
info: '测试6',
|
||||
projectFilePath: '',
|
||||
inferConfig: {
|
||||
models: [8, 7, 6],
|
||||
params: [
|
||||
{
|
||||
name: 'model',
|
||||
default: './model_file/yolov5_phone.onnx',
|
||||
},
|
||||
{
|
||||
name: 'model_cache',
|
||||
default: './tensort_cache/yolov5_phone.trt',
|
||||
},
|
||||
],
|
||||
},
|
||||
isEnable: true,
|
||||
groupIds: null,
|
||||
remark: '',
|
||||
},
|
||||
{
|
||||
id: 49,
|
||||
createTime: '2023-11-07T16:22:03.174411+08:00',
|
||||
updateTime: '2023-11-07T16:22:03.174411+08:00',
|
||||
name: '测试7',
|
||||
code: 'XM00049',
|
||||
info: '测试7',
|
||||
projectFilePath: '',
|
||||
inferConfig: {
|
||||
models: [8, 7, 6],
|
||||
params: [
|
||||
{
|
||||
name: 'model',
|
||||
default: './model_file/yolov5_phone.onnx',
|
||||
},
|
||||
{
|
||||
name: 'model_cache',
|
||||
default: './tensort_cache/yolov5_phone.trt',
|
||||
},
|
||||
],
|
||||
},
|
||||
isEnable: true,
|
||||
groupIds: null,
|
||||
remark: '',
|
||||
},
|
||||
],
|
||||
total: 27,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
};
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* @Author: donghao donghao@supervision.ltd
|
||||
* @Date: 2024-01-25 14:07:33
|
||||
* @LastEditors: donghao donghao@supervision.ltd
|
||||
* @LastEditTime: 2024-01-25 17:43:22
|
||||
* @FilePath: \general-ai-platform-web\mock\project.ts
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
/**项目模块 mock */
|
||||
|
||||
import { mockGetProjectFkSelectData, mockGetProjectListData } from './pools/projectData';
|
||||
import { successMockApiProps } from './typing';
|
||||
import { fetchCurrPageByList, fetchMockSuccessFullByOther } from './utils/apiMock';
|
||||
export default {
|
||||
// 项目选项
|
||||
'POST /api/v1/project/getProjectFkSelect': async (req: Request, res: Response) => {
|
||||
const resData: successMockApiProps = {
|
||||
...fetchMockSuccessFullByOther(mockGetProjectFkSelectData),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
|
||||
// 项目列表分页
|
||||
'POST /api/v1/project/getProjectList': async (req: Request, res: Response) => {
|
||||
const { page, pageSize } = req.body;
|
||||
|
||||
const resData: successMockApiProps = {
|
||||
...fetchCurrPageByList({
|
||||
...mockGetProjectListData,
|
||||
data: { ...mockGetProjectListData.data, page, pageSize: pageSize || 10 },
|
||||
}),
|
||||
};
|
||||
res.send(resData);
|
||||
},
|
||||
};
|
Loading…
Reference in New Issue