feat: 业务模型静态交互完成

develop2
donghao 1 year ago
parent 6653b56737
commit bc48347bb1

@ -2,7 +2,7 @@
* @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-13 14:19:57
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-18 16:47:39
* @LastEditTime: 2024-04-25 16:25:44
* @FilePath: \general-ai-platform-web\config\defaultForm.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE2
*/
@ -42,7 +42,7 @@ export const proFormItemStyleProps: Record<string, any> = {
};
// max 968
export const proFormMaxModelWidth: number = 968;
export const proFormMaxModelWidth: number = 920;
export const proFormMaxItemStyleProps: Record<string, any> = {
width: proFormMaxModelWidth - formBoxMargin,
column2Width: (proFormMaxModelWidth - formBoxMargin - formItemGap) / 2, // 两列

@ -0,0 +1,40 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-24 17:57:58
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-25 15:20:55
* @FilePath: \general-ai-platform-web\mock\businessModel.ts
* @Description: mock api
*/
import {
mockGetBaseBusinessModelListData,
mockGetBusinessModelListData,
} from './pools/businessModelData';
import { successMockApiProps } from './typing';
import { fetchCurrPageByList } from './utils/apiMock';
export default {
// 企业业务模型列表
'GET /api/businessModel/list': async (req: Request, res: Response) => {
// get 使用 query 读取参数
const { page, pageSize } = req.query;
const resData: successMockApiProps = {
...fetchCurrPageByList({
...mockGetBusinessModelListData,
data: { ...mockGetBusinessModelListData.data, page, pageSize: pageSize || 10 },
}),
};
res.json(resData);
},
// 企业基础业务模型列表
'GET /api/businessModel/base/list': async (req: Request, res: Response) => {
// get 使用 query 读取参数
const { page, pageSize } = req.query;
const resData: successMockApiProps = {
...fetchCurrPageByList({
...mockGetBaseBusinessModelListData,
data: { ...mockGetBaseBusinessModelListData.data, page, pageSize: pageSize || 10 },
}),
};
res.json(resData);
},
};

@ -1,38 +0,0 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-02 16:28:13
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-02 17:53:29
* @FilePath: \uighur-recognition-web2\mock\device.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/**告警列表模块 mock */
import { mockGetDeviceData, mockGetUploadDeviceData } from './pools/deviceData';
import { successMockApiProps } from './typing';
import { fetchCurrPageByList } from './utils/apiMock';
export default {
// 实时分析告警列表分页
'GET /api/device/': async (req: Request, res: Response) => {
// get 使用 query 读取参数
const { page, pageSize } = req.query;
const resData: successMockApiProps = {
...fetchCurrPageByList({
...mockGetDeviceData,
data: { ...mockGetDeviceData.data, page, pageSize: pageSize || 10 },
}),
};
res.json(resData);
},
// 离线分析告警列表分页
'GET /api/upload_device/': async (req: Request, res: Response) => {
// get 使用 query 读取参数
const { page, pageSize } = req.query;
const resData: successMockApiProps = {
...fetchCurrPageByList({
...mockGetUploadDeviceData,
data: { ...mockGetUploadDeviceData.data, page, pageSize: pageSize || 10 },
}),
};
res.json(resData);
},
};

@ -0,0 +1,67 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-01-25 16:53:15
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-25 15:50:16
* @FilePath: \general-ai-platform-web\mock\deviceGroup.ts
* @Description: mock
*/
import {
mockGetDeviceGroupData1,
mockGetDeviceGroupData2,
mockGetDeviceGroupData3,
mockGetDeviceGroupFkSelectData,
mockGetDeviceGroupListData,
mockGetDeviceGroupTreeData,
} from './pools/deviceGroupData';
import { successMockApiProps } from './typing';
import { fetchCurrPageByList, fetchMockSuccessFullByOther } from './utils/apiMock';
export default {
// 设备组列表分页
'GET /api/device_group/getDeviceGroupList': async (req: Request, res: Response) => {
const { page, pageSize } = req.query;
const resData: successMockApiProps = {
...fetchCurrPageByList({
...mockGetDeviceGroupListData,
data: { ...mockGetDeviceGroupListData.data, page, pageSize: pageSize || 10 },
}),
};
res.json(resData);
},
// 设备组网点选项列表
'GET /api/device_group/getDeviceGroupFkSelect': async (req: Request, res: Response) => {
const resData: successMockApiProps = {
...fetchMockSuccessFullByOther(mockGetDeviceGroupFkSelectData),
};
res.json(resData);
},
// 设备组网点树列表
'GET /api/device_group/getDeviceGroupTree': async (req: Request, res: Response) => {
const resData: successMockApiProps = {
...fetchMockSuccessFullByOther(mockGetDeviceGroupTreeData),
};
res.json(resData);
},
// 设备组详情
'GET /api/device_group/getDeviceGroupById': async (req: Request, res: Response) => {
const { id } = req.query;
let currRes = {};
switch (Number(id)) {
case 2:
currRes = mockGetDeviceGroupData1;
break;
case 3:
currRes = mockGetDeviceGroupData2;
break;
case 5:
currRes = mockGetDeviceGroupData3;
break;
}
const resData: successMockApiProps = {
...fetchMockSuccessFullByOther(currRes),
};
res.json(resData);
},
};

@ -2,9 +2,9 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-11 14:13:34
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-18 09:10:26
* @LastEditTime: 2024-04-24 17:58:27
* @FilePath: \general-ai-manage\mock\model.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: mock api
*/
/**模型管理模块 mock */

@ -0,0 +1,86 @@
/*
* @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(),
},
};

@ -1,159 +0,0 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-02 15:42:40
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-02 17:48:37
* @FilePath: \uighur-recognition-web2\mock\pools\warningRuleData.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/**@实时分析设备列表模块 */
// 设备列表分页
export const mockGetDeviceData = {
data: {
count: 3,
next: null,
previous: null,
results: [
{
id: 3,
device_name: '东大街西',
device_code: null,
device_api: 'test2',
is_use: 0,
device_status: 1,
note: null,
test_time: '2024-03-25T14:46:59.254201',
test_result: 1,
device_ip: '192.168.10.28',
device_port: null,
create_time: '2024-02-26T14:12:21.632020',
update_time: '2024-03-25T14:46:59.256200',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
appear_time: '2024-04-02T10:05:19',
},
{
id: 2,
device_name: '东大街南',
device_code: null,
device_api: 'test',
is_use: 0,
device_status: 1,
note: null,
test_time: '2024-03-22T13:28:38.741433',
test_result: 1,
device_ip: '192.168.10.10',
device_port: null,
create_time: '2024-02-26T09:59:36.599018',
update_time: '2024-03-22T13:28:38.743432',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
appear_time: '2024-04-02T10:05:19',
},
{
id: 1,
device_name: '东大街东',
device_code: null,
device_api: null,
is_use: 0,
device_status: 1,
note: null,
test_time: '2024-03-22T13:33:21.783679',
test_result: 1,
device_ip: '192.168.10.28',
device_port: null,
create_time: '2024-02-26T09:57:25',
update_time: '2024-03-22T13:33:21.786678',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
appear_time: '2024-04-02T10:05:19',
},
],
},
msg: null,
success: true,
status: 200,
};
/**@离线分析设备列表模块 */
// 设备列表分页
export const mockGetUploadDeviceData = {
data: {
count: 3,
next: null,
previous: null,
results: [
{
id: 3,
device_name: 'test2',
device_uuid: '098eea8c_c649_4a6a_8a39_4f4b9c4c1cc0',
upload_or_download: 1,
operate_mode: 2,
device_ip: '127.0.0.1',
device_port: 80,
device_username: 'admin',
device_password: 'admin',
source_directory: null,
destination_directory: '/home\\098eea8c_c649_4a6a_8a39_4f4b9c4c1cc0',
access_key_id: null,
access_key_secret: null,
bucket: null,
is_use: 1,
device_status: 1,
note: 'test23',
test_time: null,
test_result: null,
create_time: '2024-04-02T16:42:14.596765',
update_time: '2024-04-02T17:19:50.855507',
},
{
id: 2,
device_name: 'test1',
device_uuid: '430bce6b_4df5_4dfa_a64c_776934746069',
upload_or_download: 2,
operate_mode: 3,
device_ip: 'test1',
device_port: null,
device_username: null,
device_password: null,
source_directory: null,
destination_directory: '/home\\430bce6b_4df5_4dfa_a64c_776934746069',
access_key_id: '112233',
access_key_secret: '332211',
bucket: '123456',
is_use: 1,
device_status: 1,
note: '654321',
test_time: null,
test_result: null,
create_time: '2024-04-02T16:06:32.241551',
update_time: '2024-04-02T17:20:40.696287',
},
{
id: 1,
device_name: 'test',
device_uuid: '252f9533_fd3f_4282_aafe_dadc9b3044c4',
upload_or_download: 2,
operate_mode: 1,
device_ip: '192.10.10.1',
device_port: 8080,
device_username: 'test',
device_password: '123456',
source_directory: 'test1',
destination_directory: '/home\\252f9533_fd3f_4282_aafe_dadc9b3044c4',
access_key_id: null,
access_key_secret: null,
bucket: null,
is_use: 1,
device_status: 1,
note: 'test1',
test_time: null,
test_result: null,
create_time: '2024-04-02T15:47:37.276475',
update_time: '2024-04-02T17:24:02.682003',
},
],
},
msg: null,
success: true,
status: 200,
};

@ -0,0 +1,241 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-01-25 16:32:31
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-25 15:51:57
* @FilePath: \general-ai-platform-web\mock\pools\deviceGroupData.ts
* @Description:
*/
// 设备组节点选项列表
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: '南京节点',
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,
},
};
// 设备组详情
export const mockGetDeviceGroupData1 = {
data: {
deviceGroup: {
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: '',
},
},
};
export const mockGetDeviceGroupData2 = {
data: {
deviceGroup: {
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: '',
},
},
};
export const mockGetDeviceGroupData3 = {
data: {
deviceGroup: {
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: '',
},
},
};

@ -3217,7 +3217,6 @@ export const mockGetModelRuntimeLibFilesListData = {
},
};
// 模型版本
const startModelVersionList = () => {
const currList: Record<string, any>[] = [];
const count = Math.floor(Math.random() * 100) + 1;

@ -1,281 +0,0 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-02 14:04:18
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-02 17:05:46
* @FilePath: \uighur-recognition-web2\mock\pools\recognitionPeopleData.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/**@实时分析告警汇总模块 */
// 告警汇总列表分页
export const mockGetRecognitionPeopleData = {
data: {
count: 12,
next: null,
previous: null,
results: [
{
id: 3,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 0,
classify_time: '2024-03-25T13:55:00.394393',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-25T13:55:00.396393',
device_id: 3,
device_name: 'cam03',
appear_time: '2024-04-02T10:05:19',
},
{
id: 2,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27914',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 1,
classify_time: '2024-03-08T15:41:08.170979',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-08T15:41:08.171978',
device_id: 2,
device_name: 'cam02',
appear_time: '2024-04-02T10:05:19',
},
{
id: 1,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27913',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 0,
classify_time: '2024-03-25T13:51:08.471682',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-25T13:51:08.472683',
device_id: 1,
device_name: 'cam01',
appear_time: '2024-04-02T10:05:19',
},
{
id: 30,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 0,
classify_time: '2024-03-25T13:55:00.394393',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-25T13:55:00.396393',
device_id: 3,
device_name: 'cam03',
appear_time: '2024-04-02T10:05:19',
},
{
id: 32,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27914',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 1,
classify_time: '2024-03-08T15:41:08.170979',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-08T15:41:08.171978',
device_id: 2,
device_name: 'cam02',
appear_time: '2024-04-02T10:05:19',
},
{
id: 31,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27913',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 0,
classify_time: '2024-03-25T13:51:08.471682',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-25T13:51:08.472683',
device_id: 1,
device_name: 'cam01',
appear_time: '2024-04-02T10:05:19',
},
{
id: 23,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 0,
classify_time: '2024-03-25T13:55:00.394393',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-25T13:55:00.396393',
device_id: 3,
device_name: 'cam03',
appear_time: '2024-04-02T10:05:19',
},
{
id: 22,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27914',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 1,
classify_time: '2024-03-08T15:41:08.170979',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-08T15:41:08.171978',
device_id: 2,
device_name: 'cam02',
appear_time: '2024-04-02T10:05:19',
},
{
id: 21,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27913',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 0,
classify_time: '2024-03-25T13:51:08.471682',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-25T13:51:08.472683',
device_id: 1,
device_name: 'cam01',
appear_time: '2024-04-02T10:05:19',
},
{
id: 13,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 0,
classify_time: '2024-03-25T13:55:00.394393',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-25T13:55:00.396393',
device_id: 3,
device_name: 'cam03',
appear_time: '2024-04-02T10:05:19',
},
{
id: 12,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27914',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 1,
classify_time: '2024-03-08T15:41:08.170979',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-08T15:41:08.171978',
device_id: 2,
device_name: 'cam02',
appear_time: '2024-04-02T10:05:19',
},
{
id: 11,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27913',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 0,
classify_time: '2024-03-25T13:51:08.471682',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-25T13:51:08.472683',
device_id: 1,
device_name: 'cam01',
appear_time: '2024-04-02T10:05:19',
},
],
},
msg: null,
success: true,
status: 200,
};
/**@离线分析告警汇总模块 */
// 告警汇总列表分页
export const mockGetUploadRecognitionPeopleData = {
data: {
count: 3,
next: null,
previous: null,
results: [
{
id: 3,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 1,
classify_time: '2024-03-25T14:47:22.991546',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-25T14:47:22.993546',
video_id: '2',
video_name: 'test.mp4',
relative_time: 712,
analyse_time: '2024-03-20T15:11:48',
},
{
id: 2,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27914',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 1,
classify_time: '2024-03-25T13:57:00.222531',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-25T13:57:00.224531',
video_id: '1',
video_name: 'test.mp4',
relative_time: 512,
analyse_time: '2024-03-20T15:11:48',
},
{
id: 1,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27913',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
classify: 1,
classify_time: '2024-03-26T13:14:25.219923',
similar_person_pk: null,
status: 1,
note: null,
create_time: '2024-03-04T10:24:13',
update_time: '2024-03-26T13:14:25.221925',
video_id: '1',
video_name: 'test.mp4',
relative_time: 512,
analyse_time: '2024-03-20T15:11:48',
},
],
},
msg: null,
success: true,
status: 200,
};
// upload_recognition_people

@ -1,322 +0,0 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-02 14:05:08
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-02 17:08:19
* @FilePath: \uighur-recognition-web2\mock\pools\travelTrackData.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/**@实时分析告警追踪模块 */
// 告警追踪列表分页
export const mockGetTravelTrackData = {
data: {
count: 20,
next: 'http://192.168.10.21:8000/api/travel_track/?page=2&pageSize=10&person_id=0df18ed7-d6e7-445f-824d-6b3942c27915',
previous: null,
results: [
{
id: 15,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
device_id: 3,
device_name: '东大街西',
appear_time: '2024-04-02T10:05:19',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-02-27T14:36:37.505000',
update_time: '2024-03-04T11:35:18.704087',
person_classify: 0,
device_note: null,
},
{
id: 16,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
device_id: 3,
device_name: '东大街西',
appear_time: '2024-04-02T10:05:19',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-02-27T14:36:37.505000',
update_time: '2024-03-04T11:35:18.704087',
person_classify: 0,
device_note: null,
},
{
id: 17,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
device_id: 3,
device_name: '东大街西',
appear_time: '2024-04-02T10:05:19',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-02-27T14:36:37.505000',
update_time: '2024-03-04T11:35:18.704087',
person_classify: 0,
device_note: null,
},
{
id: 18,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
device_id: 3,
device_name: '东大街西',
appear_time: '2024-04-02T10:05:19',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-02-27T14:36:37.505000',
update_time: '2024-03-04T11:35:18.704087',
person_classify: 0,
device_note: null,
},
{
id: 19,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
device_id: 3,
device_name: '东大街西',
appear_time: '2024-04-02T10:05:19',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-02-27T14:36:37.505000',
update_time: '2024-03-04T11:35:18.704087',
person_classify: 0,
device_note: null,
},
{
id: 20,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
device_id: 3,
device_name: '东大街西',
appear_time: '2024-04-02T10:05:19',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-02-27T14:36:37.505000',
update_time: '2024-03-04T11:35:18.704087',
person_classify: 0,
device_note: null,
},
{
id: 21,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
device_id: 3,
device_name: '东大街西',
appear_time: '2024-04-02T10:05:19',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-02-27T14:36:37.505000',
update_time: '2024-03-04T11:35:18.704087',
person_classify: 0,
device_note: null,
},
{
id: 22,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
device_id: 3,
device_name: '东大街西',
appear_time: '2024-04-02T10:05:19',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-02-27T14:36:37.505000',
update_time: '2024-03-04T11:35:18.704087',
person_classify: 0,
device_note: null,
},
{
id: 23,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
device_id: 3,
device_name: '东大街西',
appear_time: '2024-04-02T10:05:19',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-02-27T14:36:37.505000',
update_time: '2024-03-04T11:35:18.704087',
person_classify: 0,
device_note: null,
},
{
id: 24,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
device_id: 3,
device_name: '东大街西',
appear_time: '2024-04-02T10:05:19',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-02-27T14:36:37.505000',
update_time: '2024-03-04T11:35:18.704087',
person_classify: 0,
device_note: null,
},
],
},
msg: null,
success: true,
status: 200,
};
/**@离线分析告警追踪模块 */
// 告警追踪列表分页
export const mockGetUploadTravelTrackData = {
data: {
count: 9,
next: null,
previous: null,
results: [
{
id: 15,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
video_id: '2',
video_name: 'test.mp4',
relative_time: '11分52秒',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-03-20T15:11:48',
update_time: '2024-03-20T15:11:50',
person_classify: 1,
video_length: '1时53分20秒',
},
{
id: 14,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
video_id: '2',
video_name: 'test.mp4',
relative_time: '10分12秒',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-03-20T15:11:48',
update_time: '2024-03-20T15:11:50',
person_classify: 1,
video_length: '1时53分20秒',
},
{
id: 13,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
video_id: '2',
video_name: 'test.mp4',
relative_time: '8分32秒',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-03-20T15:11:48',
update_time: '2024-03-20T15:11:50',
person_classify: 1,
video_length: '1时53分20秒',
},
{
id: 12,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
video_id: '2',
video_name: 'test.mp4',
relative_time: '6分52秒',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-03-20T15:11:48',
update_time: '2024-03-20T15:11:50',
person_classify: 1,
video_length: '1时53分20秒',
},
{
id: 11,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
video_id: '2',
video_name: 'test.mp4',
relative_time: '5分12秒',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-03-20T15:11:48',
update_time: '2024-03-20T15:11:50',
person_classify: 1,
video_length: '1时53分20秒',
},
{
id: 10,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
video_id: '1',
video_name: 'test.mp4',
relative_time: '10分12秒',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-03-20T15:11:48',
update_time: '2024-03-20T15:11:50',
person_classify: 1,
video_length: '1时3分20秒',
},
{
id: 9,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
video_id: '1',
video_name: 'test.mp4',
relative_time: '8分32秒',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-03-20T15:11:48',
update_time: '2024-03-20T15:11:50',
person_classify: 1,
video_length: '1时3分20秒',
},
{
id: 8,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
video_id: '1',
video_name: 'test.mp4',
relative_time: '6分52秒',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-03-20T15:11:48',
update_time: '2024-03-20T15:11:50',
person_classify: 1,
video_length: '1时3分20秒',
},
{
id: 7,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
video_id: '1',
video_name: 'test.mp4',
relative_time: '5分12秒',
picture_path:
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
is_ignore: 0,
cancel_trip: null,
create_time: '2024-03-20T15:11:48',
update_time: '2024-03-20T15:11:50',
person_classify: 1,
video_length: '1时3分20秒',
},
],
},
msg: null,
success: true,
status: 200,
};

@ -1,224 +0,0 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-01 20:26:23
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-02 17:10:20
* @FilePath: \uighur-recognition-web2\mock\pools\warningInfoData.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/**@实时分析告警模块 */
// 告警列表分页
export const mockGetWarningInfoData = {
data: {
results: [
{
warning_name: '单人徘徊',
picture_path: [
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
],
person_classify: 0,
device_name: '东大街东',
device_note: null,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27913',
trigger_time: '2024-04-02T09:43:38.581250',
},
{
warning_name: '单人徘徊',
picture_path: [
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
],
person_classify: 1,
device_name: '东大街东',
device_note: null,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27914',
trigger_time: '2024-04-02T09:43:38.584291',
},
{
warning_name: '单人徘徊',
picture_path: [
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
],
person_classify: 0,
device_name: '东大街东',
device_note: null,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
trigger_time: '2024-04-02T09:43:38.588170',
},
{
warning_name: '单人徘徊',
picture_path: [
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
],
person_classify: 1,
device_name: '东大街南',
device_note: null,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27914',
trigger_time: '2024-04-02T09:43:38.592134',
},
{
warning_name: '单人徘徊',
picture_path: [
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
],
person_classify: 0,
device_name: '东大街西',
device_note: null,
person_id: '0df18ed7-d6e7-445f-824d-6b3942c27915',
trigger_time: '2024-04-02T09:43:38.596134',
},
],
count: 5,
},
};
/**@离线分析告警模块 */
// 告警列表分页
export const mockGetUploadWarningInfoData = {
data: {
count: 5,
next: null,
previous: null,
results: [
{
id: 11,
video_id: '2',
start_result_id: '14',
warning_name: '单人徘徊',
warning_type: 1,
origin: 'test2.mp4',
trigger_time: '2024-04-01 16:25:38.113472',
person_id_list: '["0df18ed7-d6e7-445f-824d-6b3942c27915"]',
is_ignore: 0,
create_time: '2024-04-01T16:25:38.115472',
update_time: '2024-04-01T16:25:38.115472',
picture_path: [
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
],
person_list: [
[
'0df18ed7-d6e7-445f-824d-6b3942c27915',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
1,
],
],
video_length: '1时53分20秒',
upload_time: '2024-03-20T15:10:17',
video_start: '10分12秒',
},
{
id: 10,
video_id: '2',
start_result_id: '11',
warning_name: '单人徘徊',
warning_type: 1,
origin: 'test2.mp4',
trigger_time: '2024-04-01 16:25:38.104473',
person_id_list: '["0df18ed7-d6e7-445f-824d-6b3942c27915"]',
is_ignore: 0,
create_time: '2024-04-01T16:25:38.107473',
update_time: '2024-04-01T16:25:38.107473',
picture_path: [
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
],
person_list: [
[
'0df18ed7-d6e7-445f-824d-6b3942c27915',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
1,
],
],
video_length: '1时53分20秒',
upload_time: '2024-03-20T15:10:17',
video_start: '5分12秒',
},
{
id: 8,
video_id: '1',
start_result_id: '7',
warning_name: '单人徘徊',
warning_type: 1,
origin: 'test.mp4',
trigger_time: '2024-04-01 16:24:09.085472',
person_id_list: '["0df18ed7-d6e7-445f-824d-6b3942c27915"]',
is_ignore: 0,
create_time: '2024-04-01T16:24:09.087472',
update_time: '2024-04-01T16:24:09.087472',
picture_path: [
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
],
person_list: [
[
'0df18ed7-d6e7-445f-824d-6b3942c27915',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
1,
],
],
video_length: '1时3分20秒',
upload_time: '2024-03-20T15:10:17',
video_start: '5分12秒',
},
{
id: 7,
video_id: '1',
start_result_id: '4',
warning_name: '单人徘徊',
warning_type: 1,
origin: 'test.mp4',
trigger_time: '2024-04-01 16:24:09.080472',
person_id_list: '["0df18ed7-d6e7-445f-824d-6b3942c27914"]',
is_ignore: 0,
create_time: '2024-04-01T16:24:09.082472',
update_time: '2024-04-01T16:24:09.082472',
picture_path: [
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
],
person_list: [
[
'0df18ed7-d6e7-445f-824d-6b3942c27914',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
1,
],
],
video_length: '1时3分20秒',
upload_time: '2024-03-20T15:10:17',
video_start: '5分12秒',
},
{
id: 6,
video_id: '1',
start_result_id: '1',
warning_name: '单人徘徊',
warning_type: 1,
origin: 'test.mp4',
trigger_time: '2024-04-01 16:24:09.072472',
person_id_list: '["0df18ed7-d6e7-445f-824d-6b3942c27913"]',
is_ignore: 0,
create_time: '2024-04-01T16:24:09.075472',
update_time: '2024-04-01T16:24:09.075472',
picture_path: [
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
],
person_list: [
[
'0df18ed7-d6e7-445f-824d-6b3942c27913',
'http://192.168.10.82:8080/UR_face/2024-02-27/normal/cam01_AZ8478568_20240206140518032_FACE_SNAP_4098.jpg',
1,
],
],
video_length: '1时3分20秒',
upload_time: '2024-03-20T15:10:17',
video_start: '5分12秒',
},
],
},
msg: null,
success: true,
status: 200,
};

@ -1,107 +0,0 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-02 15:42:40
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-02 15:45:45
* @FilePath: \uighur-recognition-web2\mock\pools\warningRuleData.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/**@实时分析告警规则模块 */
// 告警规则分页
export const mockGetWarningRuleData = {
data: {
count: 3,
next: null,
previous: null,
results: [
{
id: 3,
warning_name: '敏感时间',
warning_level: 3,
warning_type: 3,
is_use: 1,
person_number: 1,
appear_number: 1,
time_interval: null,
time_period: null,
trigger_start_time: '09:09:16',
trigger_end_time: '18:00:00',
create_time: null,
update_time: '2024-04-01T17:53:40.998904',
},
{
id: 2,
warning_name: '多人聚集',
warning_level: 2,
warning_type: 2,
is_use: 1,
person_number: 3,
appear_number: 1,
time_interval: 1,
time_period: null,
trigger_start_time: null,
trigger_end_time: null,
create_time: '2024-01-22T10:59:37',
update_time: '2024-04-01T17:53:54.752905',
},
{
id: 1,
warning_name: '单人徘徊',
warning_level: 1,
warning_type: 1,
is_use: 1,
person_number: 1,
appear_number: 2,
time_interval: 1,
time_period: 10,
trigger_start_time: null,
trigger_end_time: null,
create_time: '2024-01-22T10:58:57',
update_time: '2024-04-01T17:54:01.945906',
},
],
},
msg: null,
success: true,
status: 200,
};
/**@离线分析告警规则模块 */
// 告警规则分页
export const mockGetUploadWarningRuleData = {
data: {
count: 2,
next: null,
previous: null,
results: [
{
id: 2,
warning_name: '多人聚集',
warning_level: 2,
warning_type: 2,
is_use: 1,
person_number: 3,
appear_number: 1,
time_interval: 5,
time_period: null,
create_time: '2024-04-01T16:15:05',
update_time: '2024-04-02T14:25:10.087767',
},
{
id: 1,
warning_name: '单人徘徊',
warning_level: 1,
warning_type: 1,
is_use: 1,
person_number: 1,
appear_number: 2,
time_interval: 1,
time_period: 10,
create_time: '2024-04-01T16:14:35',
update_time: '2024-04-02T14:25:16.505613',
},
],
},
msg: null,
success: true,
status: 200,
};

@ -153,7 +153,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
</div>
<div className="page_body">
<div className="flex items-center justify-between body_nav_bar">
<span>
<span className="head4">
{currMenu?.name &&
intl.formatMessage({ id: `menu.${currMenu?.name}`, defaultMessage: '首页' })}
</span>

@ -12,7 +12,7 @@
color: #999999;
}
.bg_active_1 {
background: #EBF3FF;
background: #ebf3ff;
}
/* 标题 */
.h1 {
@ -25,6 +25,16 @@
text-align: left;
text-transform: none;
}
.head4 {
color: #333333;
font-weight: bold;
font-size: 18px;
font-family: PingFang SC, PingFang SC;
font-style: normal;
line-height: 22px;
text-align: left;
text-transform: none;
}
.head5 {
color: #333333;
font-weight: bold;

@ -29,6 +29,16 @@
text-transform: none;
}
.head4 {
color: #333333;
font-weight: bold;
font-size: 18px;
font-family: PingFang SC, PingFang SC;
font-style: normal;
line-height: 22px;
text-align: left;
text-transform: none;
}
.head5 {
color: #333333;
font-weight: bold;

@ -2,7 +2,7 @@
* @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-14 15:49:36
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-19 09:20:27
* @LastEditTime: 2024-04-25 11:33:25
* @FilePath: \general-ai-platform-web\src\components\TableActionCard\index.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@ -62,7 +62,7 @@ const TableActionCard: React.FC<TableActionItemProps> = (props) => {
}, [props.renderActions]);
return (
<div className={`${props?.listType ? props?.listType : 'proTable'}ActionBox`}>
<div className="flex items-center">
{prevActions.map((item, index) => {
return (
<span

@ -67,10 +67,10 @@ ol {
}
/* Card */
.gn_card > .ant-pro-card-header {
height: 54px;
margin: 0;
padding: 10px 16px;
height: 54px;
border-bottom: 1px solid #E0E0E0;
border-bottom: 1px solid #e0e0e0;
}
.gn_card > .ant-pro-card-body {
margin: 0;
@ -97,6 +97,72 @@ ol {
.gn_table_query_filter .ant-pro-form .ant-form-item {
margin: 0;
}
.gn_model_steps_form .ant-pro-steps-form-step {
margin: 0;
}
.gn_model_steps_form .ant-steps {
margin: 12px 0 20px;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item {
flex: auto;
margin-right: 12px;
background: #f5f5f5;
border: 1px solid rgba(21, 77, 221, 0.1);
border-radius: 4px;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item:last-child {
margin-right: 0;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item .ant-steps-item-container {
display: flex;
align-items: center;
justify-content: center;
margin: 8px 0;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item .ant-steps-item-tail {
display: none;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item .ant-steps-item-icon {
margin: 0 8px;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item .ant-steps-item-content {
margin: 0;
text-align: left;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item .ant-steps-item-title {
color: #333333;
font-size: 14px;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item .ant-steps-item-description {
color: #666666;
font-size: 12px;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item-finish {
background: #e5edff;
border: 1px solid #154ddd;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item-finish .ant-steps-item-icon {
background-color: #154ddd;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item-finish .ant-steps-item-icon .ant-steps-icon {
color: white;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item-finish .ant-steps-item-title {
color: #154ddd;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item-finish .ant-steps-item-description {
color: #154ddd;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item-active {
background: #e5edff;
border: 1px solid #154ddd;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item-active .ant-steps-item-title {
color: #154ddd;
}
.gn_model_steps_form .ant-modal-content .ant-modal-body .ant-steps .ant-steps-item-active .ant-steps-item-description {
color: #154ddd;
}
/* Descriptions */
.gn_table_descriptions {
padding: 16px 16px 0;
@ -141,7 +207,7 @@ ol {
/* 限制显示的行数 */
}
.ant-pro-layout .ant-pro-layout-bg-list {
background: #F8FAFD;
background: #f8fafd;
}
::-webkit-scrollbar-track-piece {
-webkit-border-radius: 0;

@ -126,8 +126,85 @@ ol {
}
}
// 分步表单
.gn_model_steps_form {
.ant-pro-steps-form-step {
margin: 0;
}
.ant-steps {
margin: 12px 0 20px;
}
// 步骤条
.ant-modal-content .ant-modal-body .ant-steps {
.ant-steps-item {
flex: auto;
margin-right: 12px;
background: #f5f5f5;
border: 1px solid rgba(21, 77, 221, 0.1);
border-radius: 4px;
&:last-child {
margin-right: 0;
}
.ant-steps-item-container {
display: flex;
align-items: center;
justify-content: center;
margin: 8px 0;
}
.ant-steps-item-tail {
display: none;
}
.ant-steps-item-icon {
margin: 0 8px;
}
.ant-steps-item-content {
margin: 0;
text-align: left;
}
.ant-steps-item-title {
color: #333333;
font-size: 14px;
}
.ant-steps-item-description {
color: #666666;
font-size: 12px;
}
}
// 已完成
.ant-steps-item-finish {
background: #e5edff;
border: 1px solid #154ddd;
.ant-steps-item-icon {
background-color: #154ddd;
.ant-steps-icon {
color: white;
}
}
.ant-steps-item-title {
color: #154ddd;
}
.ant-steps-item-description {
color: #154ddd;
}
}
// 当前选中
.ant-steps-item-active {
background: #e5edff;
border: 1px solid #154ddd;
.ant-steps-item-title {
color: #154ddd;
}
.ant-steps-item-description {
color: #154ddd;
}
}
}
}
/* Descriptions */
// 筛选表单
// 描述展示
.gn_table_descriptions {
padding: 16px 16px 0;
background: #ffffff;

@ -51,4 +51,5 @@ export default {
'common.delete': '删除',
'common.okText': '确认',
'common.cancelText': '取消',
'common.form.required': '此项为必填项',
};

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-10 17:21:34
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-18 17:13:31
* @LastEditTime: 2024-04-25 15:54:52
* @FilePath: \general-ai-manage\src\locales\zh-CN\model.ts
* @Description:
*/
@ -68,7 +68,8 @@ export const model_version: { [key: string]: string } = {
'model_detail.version.stepForm.project_file.description': '上传模型文件',
'model_detail.version.stepForm.config': '参数配置',
'model_detail.version.stepForm.config.description': '模型参数配置',
'model_detail.version.stepForm.group': '关联节点',
'model_detail.version.stepForm.group.description': '关联相关设备节点',
'model_detail.version.form.modelFkId': '模型',
'model_detail.version.form.name': '版本号',
'model_detail.version.form.required.name': '请填写版本号',
@ -79,8 +80,26 @@ export const model_version: { [key: string]: string } = {
'model_detail.version.table.rule.required.path': '模型地址为必填项',
};
// 企业项目列表
export const business_project_list: { [key: string]: string } = {};
// 业务模型
export const business_project_list: { [key: string]: string } = {
'business_model.table.title': '业务模型列表',
'business_model.table.list.add.name': '创建模型',
'business_model.table.list.name': '业务模型名称',
'business_model.table.list.createTime': '创建时间',
'business_model.stepForm.base': '基本信息',
'business_model.stepForm.base.description': '填写基础信息',
'business_model.stepForm.baseModel': '关联模型',
'business_model.stepForm.baseModel.description': '关联基础模型',
'business_model.stepForm.project_file': '业务代码',
'business_model.stepForm.project_file.description': '上传业务代码',
'business_model.stepForm.config': '参数配置',
'business_model.stepForm.config.description': '配置业务参数',
'business_model.form.modelFkId': '业务模型名称',
'business_model.form.remark': '简介',
'business_model.form.name': '版本号',
'business_model.form.required.name': '请填写版本号',
};
// 未启用
export const business_image: { [key: string]: string } = {

@ -0,0 +1,489 @@
import {
ProForm,
ProFormInstance,
ProFormList,
ProFormSelect,
ProFormText,
ProFormTextArea,
ProFormUploadDragger,
StepsForm,
} from '@ant-design/pro-components';
import { FormListActionType } from '@ant-design/pro-form/lib';
import { getBaseBusinessModelList } from '@/services/testApi/businessModel';
import { getDeviceGroupTree } from '@/services/testApi/deviceGroup';
import { FormattedMessage, useIntl } from '@umijs/max';
import { Modal, Transfer, Tree, UploadFile, message } from 'antd';
import yaml from 'js-yaml';
import React, { useEffect, useRef, useState } from 'react';
import {
proFormMaxItemStyleProps,
proFormMaxModelWidth,
proFormStepsFormProps,
} from '../../../../../config/defaultForm';
// import {beforeUploadFile} from "@/utils/common";
// @ts-ignore
import cookie from 'react-cookies';
export type FormValueType = {
target?: string;
template?: string;
type?: string;
time?: string;
frequency?: string;
} & Partial<API.ModelVersion>;
export type CreateFormProps = {
createModalOpen: boolean;
handleModal: () => void;
values: Partial<API.ModelVersion>;
reload: any;
currentDefaultFieldsData?: Record<string, any>;
};
const waitTime = (time: number = 100) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, time);
});
};
// interface ProjectConfig {
// params: Array<object>;
// }
const CreateForm: React.FC<CreateFormProps> = (props) => {
const actionFormListRef = useRef<
FormListActionType<{
name: string;
}>
>();
const intl = useIntl();
const [isHasModelFkId, setIsHasModelFkId] = useState<boolean>(false);
const [dataFormList] = useState<any>([]);
const dataFormListRef = useRef(dataFormList);
const [fileList, setFileList] = useState<UploadFile<any>[]>([]);
// 关联模型state
const [modalData, setModalData] = useState<RecordType[]>([]);
const [targetKeys, setTargetKeys] = useState<string[]>([]);
// 关联节点state
const [treeData, setTreeData] = React.useState<DataNode[]>([]);
const [selectKeys, setSelectKeys] = useState([]);
// const [form] = Form.useForm<API.ModelVersion>();
const [current, setCurrent] = useState(0);
const formRef = useRef<ProFormInstance>();
const [filePath, setFilePath] = useState('');
const handleFileChange = ({ file }: { file: UploadFile }) => {
let curFile: any;
switch (file.status) {
case 'uploading':
case 'done':
curFile = [file];
break;
case 'removed':
default:
curFile = [];
break;
}
setFileList([...curFile]);
};
// todo disabled: !v?.defaultVersionFkId,设置 暂时设置为false 创建成功后报error
const getModelData = () => {
getBaseBusinessModelList({ keyword: '', page: 1, pageSize: 100 }).then((res) => {
console.log(66666, res.data);
let result = (res.data?.results || []).map((v: any) => {
console.log(v);
return {
key: v.id,
title: v.name,
chosen: false,
disabled: false,
};
});
setModalData(result);
});
// setMockData(tempMockData);
// setTargetKeys(tempTargetKeys);
};
const handleChange = (newTargetKeys: string[]) => {
setTargetKeys(newTargetKeys);
};
useEffect(() => {
setTargetKeys([]);
console.log('selectKeys', selectKeys);
if (props.createModalOpen) {
getModelData();
getDeviceGroupTree()
.then((resp: API.Response) => {
setTreeData(resp.data.tree);
})
.catch(() => {});
} else {
formRef.current?.resetFields();
}
}, [props.createModalOpen]);
useEffect(() => {
if (props.currentDefaultFieldsData) {
// 如果是在模型详情新增版本ModelFkId不可编辑
console.log(props.values, isHasModelFkId, 'currentDefaultFieldsData');
setIsHasModelFkId(true);
} else {
setIsHasModelFkId(false);
}
}, []);
return (
<div>
<StepsForm<{
name: string;
}>
stepsProps={proFormStepsFormProps.stepsProps}
current={current}
onCurrentChange={setCurrent}
formProps={{
validateMessages: {
required: `${intl.formatMessage({
id: 'common.form.required',
defaultMessage: '此项为必填项',
})}`,
},
}}
stepsFormRender={(dom, submitter) => {
return (
<Modal
className="gn_model_steps_form"
title={
<FormattedMessage id="business_model.table.list.add.name" defaultMessage="新增" />
}
width={proFormMaxModelWidth}
onCancel={() => {
setCurrent(0);
formRef.current?.resetFields();
setFileList([]);
props.handleModal();
}}
open={props.createModalOpen}
footer={submitter}
destroyOnClose
>
{dom}
</Modal>
);
}}
>
{/* 基本信息 数据创建 */}
<StepsForm.StepForm<{
name: string;
}>
className="gn_form"
name="base"
formRef={formRef}
title={<FormattedMessage id="business_model.stepForm.base" defaultMessage="基本信息" />}
stepProps={{
description: (
<FormattedMessage
id="business_model.stepForm.base.description"
defaultMessage="填写基础信息"
/>
),
}}
onFinish={async () => {
// setFormData(formRef.current?.getFieldsValue());
await waitTime(500);
return true;
}}
>
<ProForm.Group>
{/* //TODO 默认填充模型 无需选择 */}
<ProFormSelect
width={proFormMaxItemStyleProps.width}
name="modelFkId"
label={<FormattedMessage id="business_model.form.modelFkId" defaultMessage="$$$" />}
placeholder={`${intl.formatMessage({
id: 'common.please_select',
defaultMessage: '$$$',
})}${intl.formatMessage({
id: 'business_model.form.modelFkId',
defaultMessage: '$$$',
})}`}
required={true}
// initialValue={props.values.modelFkId}
showSearch
debounceTime={1000}
disabled={true}
// request={async (keyWord) => {
// const resp = await getBaseBusinessModelList({
// keyword: keyWord?.keyWords || '',
// });
// return resp.data.list.map((v: any) => {
// return {
// label: v.name,
// value: v.id,
// };
// });
// }}
/>
<ProFormTextArea
width={proFormMaxItemStyleProps.width}
name="remark"
label={<FormattedMessage id="business_model.form.remark" defaultMessage="简介" />}
placeholder={`${intl.formatMessage({
id: 'common.please_input',
defaultMessage: '$$$',
})}${intl.formatMessage({
id: 'business_model.form.remark',
defaultMessage: '$$$',
})}`}
required={false}
disabled={false}
/>
</ProForm.Group>
</StepsForm.StepForm>
{/* 关联算法模型 */}
<StepsForm.StepForm<{
model: string;
}>
name="baseModel"
title={
<FormattedMessage id="business_model.stepForm.baseModel" defaultMessage="关联模型" />
}
stepProps={{
description: (
<FormattedMessage
id="business_model.stepForm.baseModel.description"
defaultMessage="关联基础模型"
/>
),
}}
onFinish={async () => {
return true;
}}
>
{/* //TODO 与UI确定调整尺寸布局 */}
<Transfer
dataSource={modalData}
titles={['基础模型库', '已选模型']}
locale={{ itemUnit: '项', itemsUnit: '项', searchPlaceholder: '请输入搜索内容' }}
targetKeys={targetKeys}
onChange={handleChange}
// onSearch={handleSearch}
style={{ marginBottom: '20px' }}
listStyle={{ width: 410, height: 300 }}
operationStyle={{ width: 50, alignItems: 'center' }}
render={(item) => item.title}
/>
</StepsForm.StepForm>
{/* 业务代码 */}
<StepsForm.StepForm<{
project_file: string;
}>
className="gn_form"
name="project_file"
title={
<FormattedMessage id="business_model.stepForm.project_file" defaultMessage="业务代码" />
}
style={{ width: proFormMaxItemStyleProps.width }}
stepProps={{
description: (
<FormattedMessage
id="business_model.stepForm.project_file.description"
defaultMessage="上传业务代码"
/>
),
}}
onFinish={async (values: any) => {
if ('projectFilePath' in values && values['projectFilePath'].length > 0) {
let projectFilePath = values['projectFilePath'][0]?.response?.data?.path || '';
setFilePath(projectFilePath);
}
return true;
}}
>
<ProFormUploadDragger
label={<span className="font-bold"></span>}
name="projectFilePath"
action="/api/v1/file/uploadFile"
max={1}
fieldProps={{
name: 'file',
// beforeUpload: beforeUploadFile,
data: { path: `models/${Date.now()}` },
headers: {
'X-CSRFToken': cookie.load('csrftoken'),
Authorization: `Bearer ${localStorage.getItem('access') || ''}`,
},
}}
/>
<div style={{ color: '#666666' }}>zip.tar.gz</div>
</StepsForm.StepForm>
{/* 参数配置 */}
<StepsForm.StepForm<{
config: string;
}>
className="gn_form"
name="config"
title={<FormattedMessage id="business_model.stepForm.config" defaultMessage="参数配置" />}
stepProps={{
description: (
<FormattedMessage
id="business_model.stepForm.config.description"
defaultMessage="配置业务参数"
/>
),
}}
onFinish={async (values: any) => {
setFileList([]);
let formData = formRef.current?.getFieldsValue();
if (formData?.modelFkId) {
await waitTime(500);
formData.modelConfig = { params: values?.params || [] };
if (filePath) {
formData.path = filePath;
}
// postModelVersionCreateModelVersion(formData)
// .then(() => {
// message.success(
// intl.formatMessage({ id: 'common.success', defaultMessage: '$$$' }),
// );
// props.handleModal();
// props.reload();
// })
// .catch(() => {
// message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '$$$' }));
// return false;
// });
}
return true;
}}
>
<ProFormUploadDragger
width={proFormMaxItemStyleProps.width}
max={1}
label={<span className="font-bold"></span>}
value={fileList}
name="dragger"
fieldProps={{
onChange: handleFileChange,
onRemove: () => {
let index_ids = actionFormListRef.current?.getList()?.map((v, i) => {
return i;
});
actionFormListRef.current?.remove(index_ids || []);
},
beforeUpload: (file) => {
if (
!file.name.endsWith('.yaml') &&
!file.name.endsWith('.yml') &&
!file.name.endsWith('.json')
) {
message.error('请上传yaml或json文件').then(() => {});
return false;
} else {
let parsedData = {};
file
.text()
.then((text) => {
if (file.name.endsWith('.yaml') || file.name.endsWith('.yml')) {
parsedData = yaml.load(text) as Record<string, unknown>;
}
if (file.name.endsWith('.json')) {
parsedData = JSON.parse(text) as Record<string, unknown>;
}
if (Object.keys(parsedData).length > 0) {
dataFormListRef.current = Object.entries(parsedData).map(
([key, value]) => ({
name: key,
default: value,
}),
);
dataFormListRef.current.forEach((v: any, i: number) => {
actionFormListRef.current?.add(v, i);
});
}
return true;
})
.catch(() => {
return false;
});
}
},
}}
/>
{/* // TODO label字重与上面统一, 操作按钮需要与输入框对齐 */}
<ProFormList
name="params"
label={
<div>
<span className="font-bold"></span>
<p style={{ color: '#666666' }}>
~
</p>
</div>
}
actionRef={actionFormListRef}
itemContainerRender={(doms) => {
return <ProForm.Group>{doms}</ProForm.Group>;
}}
alwaysShowItemLabel
>
{() => {
return (
<>
<ProFormText key="name" name="name" label="键名" />
<ProFormText key="default" name="default" label="默认值" />
</>
);
}}
</ProFormList>
</StepsForm.StepForm>
{/* 关联节点 */}
<StepsForm.StepForm<{
group: string;
}>
name="group"
title={<FormattedMessage id="business_model.stepForm.group" defaultMessage="关联节点" />}
stepProps={{
description: (
<FormattedMessage
id="business_model.stepForm.group.description"
defaultMessage="关联相关设备节点"
/>
),
}}
onFinish={async () => {
return true;
}}
style={{ width: proFormMaxItemStyleProps.width }}
>
<div style={{ paddingBottom: 10, fontWeight: 700 }}>{'节点信息'}</div>
<Tree
checkable
defaultExpandAll={true}
defaultCheckedKeys={[]}
autoExpandParent={true}
onCheck={(checkedKeys: any) => {
// form.setFieldsValue({menuIds: checkedKeys})
setSelectKeys(checkedKeys);
// formRef3.current?.setFieldValue('groupIds', checkedKeys)
}}
treeData={treeData}
// loadData={({treeNode}) => {
// return treeData
// }}
/>
</StepsForm.StepForm>
</StepsForm>
</div>
);
};
export default CreateForm;

@ -2,13 +2,211 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-22 15:23:36
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-22 15:37:39
* @LastEditTime: 2024-04-25 16:11:40
* @FilePath: \general-ai-platform-web\src\pages\Node\BusinessModel\index.tsx
* @Description:
* @
* 1
* 2
* 3.
*/
// const BusinessModel: React.FC = () => {
// return <div className="businessModel_page">业务模型</div>;
// };
// export default BusinessModel;
import TableActionCard from '@/components/TableActionCard';
import IsDelete from '@/components/TableActionCard/isDelete';
import { getBusinessModelList } from '@/services/testApi/businessModel';
import { ExclamationCircleFilled } from '@ant-design/icons';
import type { ActionType, ProColumns } from '@ant-design/pro-components';
import { ProCard, ProTable } from '@ant-design/pro-components';
import { FormattedMessage } from '@umijs/max';
import { Button } from 'antd';
import { useRef, useState } from 'react';
import { proTableCommonOptions, proTablePaginationOptions } from '../../../../config/defaultTable';
import CreateForm from './components/createForm';
const BusinessModel: React.FC = () => {
return <div className="businessModel_page"></div>;
// const intl = useIntl();
const actionRef = useRef<ActionType>();
const [createModalOpen, setCreateModalOpen] = useState<boolean>(false);
// const [categoryFkIdIds, setCategoryFkIdIds] = useState([]);
// 动态设置每页数量
const [currentPageSize, setCurrentPageSize] = useState<number>(10);
// const [currentRow, setCurrentRow] = useState<Record<string, any>>({});
/**
* @en-US The pop-up window of the distribution update window
* @zh-CN
* */
// const [updateModalOpen, setUpdateModalOpen] = useState<boolean>(false);
// const [showDetail, setShowDetail] = useState<boolean>(false);
/**新增 编辑 删除 */
// 新增
const handleCreateModal = () => {
if (createModalOpen) {
setCreateModalOpen(false);
} else {
setCreateModalOpen(true);
}
};
function reloadList() {
actionRef.current?.reload();
}
// 业务模型列表信息
const columns: ProColumns<Record<string, any>>[] = [
{
title: <FormattedMessage id="business_model.table.list.name" defaultMessage="名称" />,
dataIndex: 'name',
hideInSearch: true,
key: 'fixedName',
fixed: 'left',
},
{
title: (
<FormattedMessage id="business_model.table.list.createTime" defaultMessage="创建时间" />
),
dataIndex: 'createTime',
hideInSearch: true,
valueType: 'dateTime',
},
{
title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
dataIndex: 'option',
valueType: 'option',
fixed: 'right',
key: 'option',
render: (_, record) => [
<TableActionCard
key="TableActionCardRef"
renderActions={[
{
key: 'updateDetail',
renderDom: (
<Button
key="updateDetail"
type="link"
size="small"
onClick={() => {
// TODO 编辑在新增联调后实现
// setCurrentRow(record);
// history.push('/home/model-detail');
// doToDetail(record);
// setShowDetail(true);
// setUpdateModalOpen(true);
}}
>
<FormattedMessage id="pages.searchTable.updateDetail" defaultMessage="查看" />
</Button>
),
},
{
key: 'destroy',
renderDom: (
<IsDelete
deleteApi={() => {
handleDestroy(record).then(() => {});
}}
></IsDelete>
),
},
]}
></TableActionCard>,
],
},
];
return (
<div className="modelIndex_page gn_head_card">
<ProCard
className="gn_card pb-[16px]"
title={
<span className="head5">
<FormattedMessage id="business_model.table.title" defaultMessage="标题" />
</span>
}
extra={
<Button
type="primary"
onClick={() => {
setCreateModalOpen(true);
}}
>
<FormattedMessage id="business_model.table.list.add.name" defaultMessage="新增" />
</Button>
}
>
<div
className="pb-[12px]"
style={{
color: '#FAAD14',
}}
>
<ExclamationCircleFilled />
<span className="pl-[8px]"></span>
</div>
<ProTable
className="gn_pro_table"
cardProps={{
bodyStyle: { padding: 0 },
}}
// 标题栏
search={false}
scroll={{ y: proTableCommonOptions.commscrollY }}
options={{ fullScreen: false, setting: false, density: false, reload: false }}
actionRef={actionRef}
rowKey="key"
onDataSourceChange={(data) => {
console.log(data, 'onDataSourceChange_data');
// let CategoryFkIdIds: any = data.map((v) => {
// return v.categoryFkId;
// });
// setCategoryFkIdIds(CategoryFkIdIds);
}}
pagination={{
...proTablePaginationOptions,
pageSize: currentPageSize,
onChange: (page, pageSize) => setCurrentPageSize(pageSize),
}}
columnsState={{
persistenceKey: 'algorithm_model_list',
persistenceType: 'localStorage',
}}
request={async (params = {}) => {
const { current, ...rest } = params;
const reqParams = {
page: current,
...rest,
};
let resp = await getBusinessModelList({ ...reqParams });
console.log(resp, 'getModelVersionList_resp');
return {
data: resp.data?.results.map((v: Record<string, any>) => {
return { ...v, key: v.id };
}),
success: resp.success,
total: resp.data.count,
current: current,
pageSize: currentPageSize,
};
}}
columns={columns}
/>
</ProCard>
<CreateForm
createModalOpen={createModalOpen}
handleModal={handleCreateModal}
reload={reloadList}
/>
</div>
);
};
export default BusinessModel;

@ -108,6 +108,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
stepsFormRender={(dom, submitter) => {
return (
<Modal
className="gn_model_steps_form"
title={
<FormattedMessage id="model_detail.version.table.list.add" defaultMessage="新增" />
}

@ -0,0 +1,51 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-09 13:46:44
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-25 15:21:56
* @FilePath: \general-ai-manage\src\services\testApi\businessModel.ts
* @Description: mock
*/
// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
/** 企业业务模型分页列表 */
export async function getBusinessModelList(
body: Record<string, any>, //
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.PageResult; msg?: string }>(
`/api/businessModel/list`,
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
params: {
...body,
},
...(options || {}),
},
);
}
/** 企业基础业务模型分页列表 */
export async function getBaseBusinessModelList(
body: Record<string, any>, //
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.PageResult; msg?: string }>(
`/api/businessModel/base/list`,
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
params: {
...body,
},
...(options || {}),
},
);
}

@ -0,0 +1,51 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-25 15:39:42
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-04-25 15:49:38
* @FilePath: \general-ai-platform-web\src\services\testApi\deviceGroup.ts
* @Description: api
*/
// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
/** 节点设置分页列表 */
// export async function getDeviceGroupList(
// body: Record<string, any>, //
// options?: { [key: string]: any },
// ) {
// return request<API.Response & { data?: API.PageResult; msg?: string }>(
// `/api/device_group/list`,
// {
// method: 'GET',
// headers: {
// 'Content-Type': 'application/json',
// },
// params: {
// ...body,
// },
// ...(options || {}),
// },
// );
// }
/** 获取设备组树 POST /device_group/getDeviceGroupTree */
export async function getDeviceGroupTree(
body: Record<string, any>, //
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.PageResult; msg?: string }>(
`/api/device_group/getDeviceGroupTree`,
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
params: {
...body,
},
...(options || {}),
},
);
}
Loading…
Cancel
Save