feat: 企业信息展示模块静态交互完成
@ -1,23 +0,0 @@
|
|||||||
// @ts-ignore
|
|
||||||
import { Request, Response } from 'express';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
'POST /employee/createEmployee': (req: Request, res: Response) => {
|
|
||||||
res.status(200).send({});
|
|
||||||
},
|
|
||||||
'DELETE /employee/deleteEmployee': (req: Request, res: Response) => {
|
|
||||||
res.status(200).send({});
|
|
||||||
},
|
|
||||||
'DELETE /employee/deleteEmployeeByIds': (req: Request, res: Response) => {
|
|
||||||
res.status(200).send({});
|
|
||||||
},
|
|
||||||
'POST /employee/getEmployeeById': (req: Request, res: Response) => {
|
|
||||||
res.status(200).send({});
|
|
||||||
},
|
|
||||||
'POST /employee/getEmployeeList': (req: Request, res: Response) => {
|
|
||||||
res.status(200).send({});
|
|
||||||
},
|
|
||||||
'PUT /employee/updateEmployee': (req: Request, res: Response) => {
|
|
||||||
res.status(200).send({});
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: donghao donghao@supervision.ltd
|
|
||||||
* @Date: 2024-04-02 14:08:47
|
|
||||||
* @LastEditors: donghao donghao@supervision.ltd
|
|
||||||
* @LastEditTime: 2024-04-02 17:27:11
|
|
||||||
* @FilePath: \uighur-recognition-web2\mock\recognitionPeople.ts
|
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
||||||
*/
|
|
||||||
/**告警汇总模块 mock */
|
|
||||||
import {
|
|
||||||
mockGetRecognitionPeopleData,
|
|
||||||
mockGetUploadRecognitionPeopleData,
|
|
||||||
} from './pools/recognitionPeopleData';
|
|
||||||
import { successMockApiProps } from './typing';
|
|
||||||
import { fetchCurrPageByList } from './utils/apiMock';
|
|
||||||
export default {
|
|
||||||
// 实时分析告警汇总列表分页
|
|
||||||
'GET /api/recognition_people/': async (req: Request, res: Response) => {
|
|
||||||
// get 使用 query 读取参数
|
|
||||||
const { page, pageSize } = req.query;
|
|
||||||
const resData: successMockApiProps = {
|
|
||||||
...fetchCurrPageByList({
|
|
||||||
...mockGetRecognitionPeopleData,
|
|
||||||
data: { ...mockGetRecognitionPeopleData.data, page, pageSize: pageSize || 10 },
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
res.json(resData);
|
|
||||||
},
|
|
||||||
// 离线分析告警汇总列表分页
|
|
||||||
'GET /api/upload_recognition_people/': async (req: Request, res: Response) => {
|
|
||||||
// get 使用 query 读取参数
|
|
||||||
const { page, pageSize } = req.query;
|
|
||||||
const resData: successMockApiProps = {
|
|
||||||
...fetchCurrPageByList({
|
|
||||||
...mockGetUploadRecognitionPeopleData,
|
|
||||||
data: { ...mockGetUploadRecognitionPeopleData.data, page, pageSize: pageSize || 10 },
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
res.json(resData);
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: donghao donghao@supervision.ltd
|
|
||||||
* @Date: 2024-04-02 15:48:44
|
|
||||||
* @LastEditors: donghao donghao@supervision.ltd
|
|
||||||
* @LastEditTime: 2024-04-02 17:07:30
|
|
||||||
* @FilePath: \uighur-recognition-web2\mock\travelTrack.ts
|
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
||||||
*/
|
|
||||||
/**告警追踪模块 mock */
|
|
||||||
|
|
||||||
import { mockGetTravelTrackData, mockGetUploadTravelTrackData } from './pools/travelTrackData';
|
|
||||||
import { successMockApiProps } from './typing';
|
|
||||||
import { fetchCurrPageByList } from './utils/apiMock';
|
|
||||||
export default {
|
|
||||||
// 实时分析告警追踪分页
|
|
||||||
'GET /api/travel_track/': async (req: Request, res: Response) => {
|
|
||||||
// get 使用 query 读取参数
|
|
||||||
const { page, pageSize } = req.query;
|
|
||||||
const resData: successMockApiProps = {
|
|
||||||
...fetchCurrPageByList({
|
|
||||||
...mockGetTravelTrackData,
|
|
||||||
data: { ...mockGetTravelTrackData.data, page, pageSize: pageSize || 10 },
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
res.json(resData);
|
|
||||||
},
|
|
||||||
// 离线分析告警追踪分页
|
|
||||||
'GET /api/upload_travel_track/': async (req: Request, res: Response) => {
|
|
||||||
// get 使用 query 读取参数
|
|
||||||
const { page, pageSize } = req.query;
|
|
||||||
const resData: successMockApiProps = {
|
|
||||||
...fetchCurrPageByList({
|
|
||||||
...mockGetUploadTravelTrackData,
|
|
||||||
data: { ...mockGetUploadTravelTrackData.data, page, pageSize: pageSize || 10 },
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
res.json(resData);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// \upload_travel_track
|
|
@ -1,31 +0,0 @@
|
|||||||
/**告警列表模块 mock */
|
|
||||||
|
|
||||||
import { mockGetUploadWarningInfoData, mockGetWarningInfoData } from './pools/warningInfoData';
|
|
||||||
import { successMockApiProps } from './typing';
|
|
||||||
import { fetchCurrPageByList } from './utils/apiMock';
|
|
||||||
export default {
|
|
||||||
// 实时分析告警列表分页
|
|
||||||
'GET /api/warning_info/': async (req: Request, res: Response) => {
|
|
||||||
// get 使用 query 读取参数
|
|
||||||
const { page, pageSize } = req.query;
|
|
||||||
const resData: successMockApiProps = {
|
|
||||||
...fetchCurrPageByList({
|
|
||||||
...mockGetWarningInfoData,
|
|
||||||
data: { ...mockGetWarningInfoData.data, page, pageSize: pageSize || 10 },
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
res.json(resData);
|
|
||||||
},
|
|
||||||
// 离线分析告警列表分页
|
|
||||||
'GET /api/upload_warning_info/': async (req: Request, res: Response) => {
|
|
||||||
// get 使用 query 读取参数
|
|
||||||
const { page, pageSize } = req.query;
|
|
||||||
const resData: successMockApiProps = {
|
|
||||||
...fetchCurrPageByList({
|
|
||||||
...mockGetUploadWarningInfoData,
|
|
||||||
data: { ...mockGetUploadWarningInfoData.data, page, pageSize: pageSize || 10 },
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
res.json(resData);
|
|
||||||
},
|
|
||||||
};
|
|
@ -1,30 +0,0 @@
|
|||||||
/**告警规则模块 mock */
|
|
||||||
import { mockGetUploadWarningRuleData, mockGetWarningRuleData } from './pools/warningRuleData';
|
|
||||||
import { successMockApiProps } from './typing';
|
|
||||||
import { fetchCurrPageByList } from './utils/apiMock';
|
|
||||||
export default {
|
|
||||||
// 实时分析告警规则分页
|
|
||||||
'GET /api/warning_rule/': async (req: Request, res: Response) => {
|
|
||||||
// get 使用 query 读取参数
|
|
||||||
const { page, pageSize } = req.query;
|
|
||||||
const resData: successMockApiProps = {
|
|
||||||
...fetchCurrPageByList({
|
|
||||||
...mockGetWarningRuleData,
|
|
||||||
data: { ...mockGetWarningRuleData.data, page, pageSize: pageSize || 10 },
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
res.json(resData);
|
|
||||||
},
|
|
||||||
// 离线分析告警规则分页
|
|
||||||
'GET /api/upload_warning_rule/': async (req: Request, res: Response) => {
|
|
||||||
// get 使用 query 读取参数
|
|
||||||
const { page, pageSize } = req.query;
|
|
||||||
const resData: successMockApiProps = {
|
|
||||||
...fetchCurrPageByList({
|
|
||||||
...mockGetUploadWarningRuleData,
|
|
||||||
data: { ...mockGetUploadWarningRuleData.data, page, pageSize: pageSize || 10 },
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
res.json(resData);
|
|
||||||
},
|
|
||||||
};
|
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 413 B |
After Width: | Height: | Size: 658 B |
After Width: | Height: | Size: 379 B |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 42 KiB |
@ -1,84 +0,0 @@
|
|||||||
.alarmImgBox {
|
|
||||||
// display: flex;
|
|
||||||
// justify-content: flex-start;
|
|
||||||
.alarmImgLeft {
|
|
||||||
position: relative;
|
|
||||||
width: 120px;
|
|
||||||
margin-right: 32px;
|
|
||||||
// height: 600px;
|
|
||||||
.alarmImgLeftBox {
|
|
||||||
width: 112px;
|
|
||||||
height: 112px;
|
|
||||||
border-radius: 4px;
|
|
||||||
// background: skyblue;
|
|
||||||
}
|
|
||||||
.alarmImgLeftBoxActive {
|
|
||||||
width: 112px;
|
|
||||||
height: 112px;
|
|
||||||
border: 1.5px solid #081fa8;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
.shadowBox {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0px;
|
|
||||||
left: 0;
|
|
||||||
z-index: 999;
|
|
||||||
width: 112px;
|
|
||||||
height: 20px;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.alarmImgRight {
|
|
||||||
position: relative;
|
|
||||||
flex: 1;
|
|
||||||
.alarmImgRightTopBox {
|
|
||||||
width: 640px;
|
|
||||||
height: 640px;
|
|
||||||
background: skyblue;
|
|
||||||
}
|
|
||||||
.alarmDetails {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 38px;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
padding-left: 24px;
|
|
||||||
color: #ffffff;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 16px;
|
|
||||||
font-family: PingFang SC;
|
|
||||||
line-height: 38px;
|
|
||||||
background: rgba(0, 0, 0, 0.6);
|
|
||||||
.alarmSpan {
|
|
||||||
// color: #333;
|
|
||||||
margin-right: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.alarmImgDescribe {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
color: #666;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 16px;
|
|
||||||
font-family: PingFang SC;
|
|
||||||
span {
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.alarmImgContent {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 784px;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
padding: 16px;
|
|
||||||
// height: 172px;
|
|
||||||
background: #f7f7f7;
|
|
||||||
border: 1px dashed #dcdcdc;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.myButtonDisabled {
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
@ -1,293 +0,0 @@
|
|||||||
import { postIgnoringvents } from '@/services/realTime/alarmlist';
|
|
||||||
import { postRecognition } from '@/services/realTime/involved';
|
|
||||||
import { ModalForm } from '@ant-design/pro-components';
|
|
||||||
import { useIntl } from '@umijs/max';
|
|
||||||
import { Button, Form, message } from 'antd';
|
|
||||||
import React, { useEffect, useState } from 'react';
|
|
||||||
// Import Swiper React components
|
|
||||||
// import { Swiper, SwiperSlide } from 'swiper/react';
|
|
||||||
// import { Navigation, Pagination, Mousewheel } from 'swiper/modules';
|
|
||||||
// Import Swiper styles
|
|
||||||
// import 'swiper/css';
|
|
||||||
// import 'swiper/css/navigation';
|
|
||||||
// import 'swiper/css/pagination';
|
|
||||||
import moment from 'moment';
|
|
||||||
import styles from './AlarmDetails.less';
|
|
||||||
import ImageSinglePopover from './ImageSinglePopover';
|
|
||||||
import ImageWithPopover from './ImageWithPopover';
|
|
||||||
export type FormValueType = {
|
|
||||||
target?: string;
|
|
||||||
template?: string;
|
|
||||||
type?: string;
|
|
||||||
time?: string;
|
|
||||||
frequency?: string;
|
|
||||||
} & Partial<API.AlarmDetailsParams>;
|
|
||||||
|
|
||||||
export type UpdateFormProps = {
|
|
||||||
updateModalOpen: boolean;
|
|
||||||
handleModal: () => void;
|
|
||||||
values: Partial<API.AlarmDetailsParams>;
|
|
||||||
reload: any;
|
|
||||||
};
|
|
||||||
const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
|
||||||
const intl = useIntl();
|
|
||||||
const [form] = Form.useForm<API.AlarmDetailsParams>();
|
|
||||||
// const [isActive, setIsActive] = useState(0);
|
|
||||||
// const [imageSrc, setImageSrc] = useState('');
|
|
||||||
// const [visible, setVisible] = useState(false);
|
|
||||||
const [involved, setInvolved] = useState(0);
|
|
||||||
// const [involvedInfo, setInvolvedInfo] = useState([...(props?.values?.person_list || [])]);
|
|
||||||
const [involvedInfo, setInvolvedInfo] = useState<any[]>([]);
|
|
||||||
useEffect(() => {
|
|
||||||
if (props.values?.person_list) {
|
|
||||||
setInvolvedInfo([...props.values.person_list]);
|
|
||||||
}
|
|
||||||
}, [props.values?.person_list]);
|
|
||||||
useEffect(() => {
|
|
||||||
if (props.values?.person_classify) {
|
|
||||||
setInvolved(props.values.person_classify);
|
|
||||||
console.log(involved);
|
|
||||||
}
|
|
||||||
}, [props.values?.person_classify]);
|
|
||||||
const handlePostRecognition = (person_id: any, classify: any) => {
|
|
||||||
postRecognition({
|
|
||||||
person_id: person_id,
|
|
||||||
classify: classify,
|
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
console.log(res.data.classify, 'res.data.classify');
|
|
||||||
if (res.data.classify === 1) {
|
|
||||||
message.success('此人已被设为重点关注');
|
|
||||||
} else {
|
|
||||||
message.success('此人已被移除重点关注');
|
|
||||||
}
|
|
||||||
props.reload();
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '失败' }));
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/** 多人告警组件 */
|
|
||||||
const handleInvolved = (value: any, index: any) => {
|
|
||||||
const updatedInvolvedInfo = [...involvedInfo];
|
|
||||||
console.log(updatedInvolvedInfo);
|
|
||||||
updatedInvolvedInfo[index][2] = value;
|
|
||||||
setInvolvedInfo(updatedInvolvedInfo);
|
|
||||||
handlePostRecognition(updatedInvolvedInfo[index][0], value);
|
|
||||||
};
|
|
||||||
/** 单人告警组件 */
|
|
||||||
// const handleSingleInvolved = () => {
|
|
||||||
// if (involved === 1) {
|
|
||||||
// setInvolved(0);
|
|
||||||
// handlePostRecognition(props.values?.person_id, 0)
|
|
||||||
// } else {
|
|
||||||
// setInvolved(1);
|
|
||||||
// handlePostRecognition(props.values?.person_id, 1)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const [open, setOpen] = useState(false);
|
|
||||||
// useEffect(() => {
|
|
||||||
// // console.log(Array.isArray(props.values?.person_id),'Array.isArray(props.values?.person_id)');
|
|
||||||
// setImageSrc(props?.values?.picture_path?.[0]);
|
|
||||||
// }, [props.updateModalOpen]);
|
|
||||||
return (
|
|
||||||
<ModalForm<any>
|
|
||||||
width={832}
|
|
||||||
title={`${props.values.warning_name}告警`}
|
|
||||||
open={props.updateModalOpen}
|
|
||||||
form={form}
|
|
||||||
autoFocusFirstInput
|
|
||||||
modalProps={{
|
|
||||||
destroyOnClose: true,
|
|
||||||
onCancel: () => {
|
|
||||||
setInvolved(0);
|
|
||||||
props.handleModal();
|
|
||||||
},
|
|
||||||
okText: intl.formatMessage({ id: 'common.yes', defaultMessage: '确认' }),
|
|
||||||
cancelText: intl.formatMessage({ id: 'common.no', defaultMessage: '取消' }),
|
|
||||||
}}
|
|
||||||
submitter={{
|
|
||||||
// resetButtonProps: {
|
|
||||||
// style: {
|
|
||||||
// display: 'none',
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// searchConfig: {
|
|
||||||
// submitText: '忽略此事件',
|
|
||||||
// },
|
|
||||||
render: (prop) => {
|
|
||||||
return [
|
|
||||||
<Button
|
|
||||||
key="ok"
|
|
||||||
style={{ backgroundColor: '#E80D0D', color: '#FFF', borderBlockColor: '#E80D0D' }}
|
|
||||||
onClick={() => {
|
|
||||||
prop.submit();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
忽略此事件
|
|
||||||
</Button>,
|
|
||||||
props.values?.person_list ? null : (
|
|
||||||
<Button
|
|
||||||
key="involved"
|
|
||||||
style={{ backgroundColor: '#FAAD14', color: '#FFF', borderBlockColor: '#FAAD14' }}
|
|
||||||
onClick={() => {
|
|
||||||
// console.log(props.updateModalOpen);
|
|
||||||
setInvolved(1);
|
|
||||||
handlePostRecognition(props.values?.person_id, 1);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
加入重点关注
|
|
||||||
</Button>
|
|
||||||
),
|
|
||||||
props.values?.person_list ? null : (
|
|
||||||
<Button
|
|
||||||
key="noInvolved"
|
|
||||||
style={{ background: '#FFF', color: '#E80D0D', borderColor: '#E80D0D' }}
|
|
||||||
onClick={() => {
|
|
||||||
// console.log(props.updateModalOpen);
|
|
||||||
setInvolved(0);
|
|
||||||
handlePostRecognition(props.values?.person_id, 0);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
移除重点关注
|
|
||||||
</Button>
|
|
||||||
),
|
|
||||||
];
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
submitTimeout={2000}
|
|
||||||
onFinish={async (values) => {
|
|
||||||
values.is_ignore = true;
|
|
||||||
values.person_id = props.values.person_id;
|
|
||||||
// console.log(values);
|
|
||||||
postIgnoringvents(values)
|
|
||||||
.then(() => {
|
|
||||||
message.success(intl.formatMessage({ id: 'common.success', defaultMessage: '成功' }));
|
|
||||||
props.reload();
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '失败' }));
|
|
||||||
});
|
|
||||||
|
|
||||||
props.handleModal();
|
|
||||||
return true;
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* <ProForm.Group> */}
|
|
||||||
<div className={styles.alarmImgBox}>
|
|
||||||
<div className={styles.alarmImgDescribe}>
|
|
||||||
来源: <span>{props.values.device_name}</span>
|
|
||||||
</div>
|
|
||||||
<div className={styles.alarmImgDescribe}>
|
|
||||||
触发时间:{' '}
|
|
||||||
<span className={styles.alarmSpan}>
|
|
||||||
{moment(props.values.trigger_time).format('YYYY-MM-DD hh:mm:ss')}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className={styles.alarmImgContent}>
|
|
||||||
{Array.isArray(props.values?.person_id)
|
|
||||||
? Array.isArray(involvedInfo) && involvedInfo.length
|
|
||||||
? involvedInfo.map((item: any, index: any) => {
|
|
||||||
return (
|
|
||||||
<ImageWithPopover
|
|
||||||
src={item?.[1]}
|
|
||||||
involved={involvedInfo[index][2]}
|
|
||||||
key={index}
|
|
||||||
indexId={index}
|
|
||||||
handleInvolved={handleInvolved}
|
|
||||||
time={props.values.trigger_time}
|
|
||||||
></ImageWithPopover>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
: Array.isArray(props?.values?.picture_path) && props?.values?.picture_path.length
|
|
||||||
? props.values.picture_path.map((item: any, index: any) => {
|
|
||||||
return (
|
|
||||||
<ImageSinglePopover
|
|
||||||
src={item}
|
|
||||||
involved={involved}
|
|
||||||
key={index}
|
|
||||||
// handleInvolved={handleSingleInvolved}
|
|
||||||
reload={props.reload} // 将reload方法作为prop传递给ImageSinglePopover组件
|
|
||||||
time={props.values.trigger_time}
|
|
||||||
></ImageSinglePopover>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
: null
|
|
||||||
: Array.isArray(props?.values?.picture_path) && props?.values?.picture_path.length
|
|
||||||
? props.values.picture_path.map((item: any, index: any) => {
|
|
||||||
return (
|
|
||||||
<ImageSinglePopover
|
|
||||||
src={item}
|
|
||||||
involved={involved}
|
|
||||||
key={index}
|
|
||||||
// handleInvolved={handleSingleInvolved}
|
|
||||||
reload={props.reload} // 将reload方法作为prop传递给ImageSinglePopover组件
|
|
||||||
time={props.values.trigger_time}
|
|
||||||
></ImageSinglePopover>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
: null}
|
|
||||||
{/* { Array.isArray(involvedInfo) && involvedInfo.length && involvedInfo.map((item: any, index: any) => {
|
|
||||||
console.log(involvedInfo,'item');
|
|
||||||
return(<ImageWithPopover src={item?.[1]} involved={involvedInfo[index][2]} key={index} indexId={index} handleInvolved={handleInvolved}></ImageWithPopover>)
|
|
||||||
})} */}
|
|
||||||
</div>
|
|
||||||
{/* <div className={styles.alarmImgLeft}>
|
|
||||||
<Swiper
|
|
||||||
style={{height:660}}
|
|
||||||
slidesPerView={5}
|
|
||||||
spaceBetween={20}
|
|
||||||
direction='vertical'
|
|
||||||
mousewheel={true}
|
|
||||||
modules={[Mousewheel]}
|
|
||||||
onSlideChange={() => {
|
|
||||||
console.log(111);
|
|
||||||
}}
|
|
||||||
// pagination={{
|
|
||||||
// clickable: true,
|
|
||||||
// }}
|
|
||||||
// modules={[Pagination]}
|
|
||||||
>
|
|
||||||
{ Array.isArray(props?.values?.picture_path) && props?.values?.picture_path.length && props?.values?.picture_path.map((item: any, index: any) => {
|
|
||||||
return (<SwiperSlide key={index} virtualIndex={index} onClick={() => {
|
|
||||||
console.log(index);
|
|
||||||
setIsActive(index)
|
|
||||||
setImageSrc(item)
|
|
||||||
}}>
|
|
||||||
<div className={ styles.alarmImgLeftBox }>
|
|
||||||
<Image
|
|
||||||
style={{
|
|
||||||
width: 112,
|
|
||||||
height: 112,
|
|
||||||
borderRadius: 4
|
|
||||||
}}
|
|
||||||
className={ index === isActive ? styles.alarmImgLeftBoxActive : '' }
|
|
||||||
preview={false}
|
|
||||||
src={item}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</SwiperSlide>)
|
|
||||||
})}
|
|
||||||
</Swiper>
|
|
||||||
<div className={styles.shadowBox}></div>
|
|
||||||
</div>
|
|
||||||
<div className={styles.alarmImgRight}>
|
|
||||||
<div className={styles.alarmImgRightTopBox}>
|
|
||||||
<Image
|
|
||||||
width={640}
|
|
||||||
height={640}
|
|
||||||
preview={false}
|
|
||||||
src={imageSrc}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className={styles.alarmDetails}>
|
|
||||||
来源: <span className={styles.alarmSpan}>{props.values.device_name}</span>触发时间: <span className={styles.alarmSpan}>{moment(props.values.trigger_time).format('YYYY-MM-DD hh:mm:ss')}</span>
|
|
||||||
</div>
|
|
||||||
</div> */}
|
|
||||||
</div>
|
|
||||||
{/* </ProForm.Group> */}
|
|
||||||
</ModalForm>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default UpdateForm;
|
|
@ -1,147 +0,0 @@
|
|||||||
import { EyeOutlined } from '@ant-design/icons';
|
|
||||||
import { Image } from 'antd';
|
|
||||||
import moment from 'moment';
|
|
||||||
import React, { useState } from 'react';
|
|
||||||
|
|
||||||
interface ImageSinglePopoverProps {
|
|
||||||
src: string;
|
|
||||||
involved: any;
|
|
||||||
// handleInvolved: () => void;
|
|
||||||
reload: any;
|
|
||||||
time: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ImageSinglePopover: React.FC<ImageSinglePopoverProps> = ({ src, involved, time }) => {
|
|
||||||
const [visible, setVisible] = useState(false);
|
|
||||||
// const [open, setOpen] = useState(false);
|
|
||||||
|
|
||||||
// 定义一个方法,用于生成自定义的遮罩层
|
|
||||||
const generateMask = (text: any) => (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
width: '100%',
|
|
||||||
height: '100%',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
color: '#fff',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', alignItems: 'center', fontSize: 12 }}>
|
|
||||||
<EyeOutlined style={{ marginRight: 8, fontSize: 12 }} />
|
|
||||||
<div>{text}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
// const content = (
|
|
||||||
// <div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center',alignItems: 'center', height: 56}}>
|
|
||||||
// {/* <div>选项1</div>
|
|
||||||
// <div>选项2</div> */}
|
|
||||||
// <Button
|
|
||||||
// type="text"
|
|
||||||
// style={{ height:22, padding: 0,fontSize: 12,color: '#FFF' }}
|
|
||||||
// icon={<InfoCircleOutlined style={{ color: '#FAAD14',fontSize: 12}} />}
|
|
||||||
// onClick={()=>{
|
|
||||||
// // setInvolved(true)
|
|
||||||
// // handleInvolved();
|
|
||||||
// // reload()
|
|
||||||
// setOpen(false)
|
|
||||||
// }}
|
|
||||||
// >加入重点关注</Button>
|
|
||||||
// <Button
|
|
||||||
// type="text"
|
|
||||||
// style={{ height:22, padding: 0,fontSize: 12,color: '#FFF' }}
|
|
||||||
// icon={<CloseCircleOutlined style={{ color: '#E80D0D',fontSize: 12}} />}
|
|
||||||
// onClick={()=>{
|
|
||||||
// // setInvolved(false)
|
|
||||||
// // handleInvolved();
|
|
||||||
// // reload()
|
|
||||||
// setOpen(false)
|
|
||||||
// }}
|
|
||||||
// >移除重点关注</Button>
|
|
||||||
// </div>
|
|
||||||
// );
|
|
||||||
const handleVisibleChange = (value: boolean) => {
|
|
||||||
setVisible(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
// const handleOpenChange = (value: boolean) => {
|
|
||||||
// setOpen(value);
|
|
||||||
// };
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
position: 'relative',
|
|
||||||
boxSizing: 'border-box',
|
|
||||||
width: 140,
|
|
||||||
height: 160,
|
|
||||||
marginRight: 12,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Image
|
|
||||||
style={{ borderRadius: 4 }}
|
|
||||||
width={140}
|
|
||||||
height={140}
|
|
||||||
preview={{
|
|
||||||
visible,
|
|
||||||
src,
|
|
||||||
onVisibleChange: handleVisibleChange,
|
|
||||||
mask: generateMask('点击可预览大图'),
|
|
||||||
}}
|
|
||||||
src={src}
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
height: 30,
|
|
||||||
textAlign: 'center',
|
|
||||||
lineHeight: '30px',
|
|
||||||
fontWeight: 500,
|
|
||||||
color: '#333',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{moment(time).format('YYYY-MM-DD hh:mm:ss')}
|
|
||||||
</div>
|
|
||||||
{/* <Popover
|
|
||||||
placement="right"
|
|
||||||
content={content}
|
|
||||||
trigger="click"
|
|
||||||
style={{ width: 104, height: 64 }}
|
|
||||||
color="rgba(0, 0, 0, 0.6)"
|
|
||||||
overlayInnerStyle={{ width: 104, height: 64, padding: 4, borderRadius: 2 }}
|
|
||||||
open={open}
|
|
||||||
onOpenChange={handleOpenChange}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
style={{ position: 'absolute', bottom: 8, right: 0 }}
|
|
||||||
type="text"
|
|
||||||
icon={<EllipsisOutlined style={{ color: '#fff', fontSize: 24, transform: 'rotate(90deg)' }} />}
|
|
||||||
/>
|
|
||||||
</Popover> */}
|
|
||||||
{involved === 1 && (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: 0,
|
|
||||||
right: 0,
|
|
||||||
width: 64,
|
|
||||||
height: 24,
|
|
||||||
background: '#FAAD14',
|
|
||||||
borderRadius: '0px 4px 0px 4px',
|
|
||||||
color: '#FFF',
|
|
||||||
fontSize: 12,
|
|
||||||
textAlign: 'center',
|
|
||||||
lineHeight: '24px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
重点关注
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ImageSinglePopover;
|
|
@ -1,170 +0,0 @@
|
|||||||
import {
|
|
||||||
CloseCircleOutlined,
|
|
||||||
EllipsisOutlined,
|
|
||||||
EyeOutlined,
|
|
||||||
InfoCircleOutlined,
|
|
||||||
} from '@ant-design/icons';
|
|
||||||
import { Button, Image, Popover } from 'antd';
|
|
||||||
import moment from 'moment';
|
|
||||||
import React, { useState } from 'react';
|
|
||||||
|
|
||||||
interface ImageWithPopoverProps {
|
|
||||||
src: string;
|
|
||||||
involved: any;
|
|
||||||
indexId: any;
|
|
||||||
handleInvolved: (value: any, index: any) => void;
|
|
||||||
time: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ImageWithPopover: React.FC<ImageWithPopoverProps> = ({
|
|
||||||
src,
|
|
||||||
involved,
|
|
||||||
indexId,
|
|
||||||
handleInvolved,
|
|
||||||
time,
|
|
||||||
}) => {
|
|
||||||
const [visible, setVisible] = useState(false);
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
|
|
||||||
// 定义一个方法,用于生成自定义的遮罩层
|
|
||||||
const generateMask = (text: any) => (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
width: '100%',
|
|
||||||
height: '100%',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
color: '#fff',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', alignItems: 'center', fontSize: 12 }}>
|
|
||||||
<EyeOutlined style={{ marginRight: 8, fontSize: 12 }} />
|
|
||||||
<div>{text}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
const content = (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'column',
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
height: 56,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* <div>选项1</div>
|
|
||||||
<div>选项2</div> */}
|
|
||||||
<Button
|
|
||||||
type="text"
|
|
||||||
style={{ height: 22, padding: 0, fontSize: 12, color: '#FFF', marginBottom: 4 }}
|
|
||||||
icon={<InfoCircleOutlined style={{ color: '#FAAD14', fontSize: 12 }} />}
|
|
||||||
onClick={() => {
|
|
||||||
// setInvolved(true)
|
|
||||||
handleInvolved(1, indexId);
|
|
||||||
setOpen(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
加入重点关注
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
type="text"
|
|
||||||
style={{ height: 22, padding: 0, fontSize: 12, color: '#FFF' }}
|
|
||||||
icon={<CloseCircleOutlined style={{ color: '#E80D0D', fontSize: 12 }} />}
|
|
||||||
onClick={() => {
|
|
||||||
// setInvolved(false)
|
|
||||||
handleInvolved(0, indexId);
|
|
||||||
setOpen(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
移除重点关注
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
const handleVisibleChange = (value: boolean) => {
|
|
||||||
setVisible(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleOpenChange = (value: boolean) => {
|
|
||||||
setOpen(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
position: 'relative',
|
|
||||||
boxSizing: 'border-box',
|
|
||||||
width: 140,
|
|
||||||
height: 160,
|
|
||||||
marginRight: 12,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Image
|
|
||||||
style={{ borderRadius: 4 }}
|
|
||||||
width={140}
|
|
||||||
height={140}
|
|
||||||
preview={{
|
|
||||||
visible,
|
|
||||||
src,
|
|
||||||
onVisibleChange: handleVisibleChange,
|
|
||||||
mask: generateMask('点击可预览大图'),
|
|
||||||
}}
|
|
||||||
src={src}
|
|
||||||
/>
|
|
||||||
<Popover
|
|
||||||
placement="right"
|
|
||||||
content={content}
|
|
||||||
trigger="click"
|
|
||||||
style={{ width: 104, height: 64 }}
|
|
||||||
color="rgba(0, 0, 0, 0.6)"
|
|
||||||
overlayInnerStyle={{ width: 104, height: 68, padding: 4, borderRadius: 2 }}
|
|
||||||
open={open}
|
|
||||||
onOpenChange={handleOpenChange}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
style={{ position: 'absolute', bottom: 20, right: 0 }}
|
|
||||||
type="text"
|
|
||||||
icon={
|
|
||||||
<EllipsisOutlined style={{ color: '#fff', fontSize: 24, transform: 'rotate(90deg)' }} />
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Popover>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
height: 30,
|
|
||||||
textAlign: 'center',
|
|
||||||
lineHeight: '30px',
|
|
||||||
fontWeight: 500,
|
|
||||||
color: '#333',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{moment(time).format('YYYY-MM-DD hh:mm:ss')}
|
|
||||||
</div>
|
|
||||||
{involved === 1 && (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: 0,
|
|
||||||
right: 0,
|
|
||||||
width: 64,
|
|
||||||
height: 24,
|
|
||||||
background: '#FAAD14',
|
|
||||||
borderRadius: '0px 4px 0px 4px',
|
|
||||||
color: '#FFF',
|
|
||||||
fontSize: 12,
|
|
||||||
textAlign: 'center',
|
|
||||||
lineHeight: '24px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
重点关注
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ImageWithPopover;
|
|
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* @Author: donghao donghao@supervision.ltd
|
||||||
|
* @Date: 2024-04-23 17:46:47
|
||||||
|
* @LastEditors: donghao donghao@supervision.ltd
|
||||||
|
* @LastEditTime: 2024-04-24 16:46:44
|
||||||
|
* @FilePath: \general-ai-platform-web\src\pages\Project\BusinessInfo\components\accountPsw.tsx
|
||||||
|
* @Description: 账号密码
|
||||||
|
*/
|
||||||
|
import { ProForm, ProFormText } from '@ant-design/pro-components';
|
||||||
|
import { FormattedMessage, useIntl } from '@umijs/max';
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
type AccountPswProps = {
|
||||||
|
info: Record<string, any>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const AccountPsw: React.FC<AccountPswProps> = () => {
|
||||||
|
const [form] = ProForm.useForm(); // form 对象
|
||||||
|
const intl = useIntl();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ProForm
|
||||||
|
className="gn_form"
|
||||||
|
form={form}
|
||||||
|
submitter={{
|
||||||
|
submitButtonProps: {
|
||||||
|
style: {
|
||||||
|
display: 'none', // 设置为隐藏状态
|
||||||
|
},
|
||||||
|
},
|
||||||
|
resetButtonProps: {
|
||||||
|
style: {
|
||||||
|
display: 'none', // 设置为隐藏状态
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormText
|
||||||
|
width="34.45vw"
|
||||||
|
name="name"
|
||||||
|
label={
|
||||||
|
<FormattedMessage id="business_info.list.table.form.name" defaultMessage="企业账号" />
|
||||||
|
}
|
||||||
|
placeholder={`${intl.formatMessage({
|
||||||
|
id: 'common.please_input',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}${intl.formatMessage({
|
||||||
|
id: 'business.list.table.form.name',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}`}
|
||||||
|
required={true}
|
||||||
|
/>
|
||||||
|
<ProFormText.Password
|
||||||
|
width="34.45vw"
|
||||||
|
label={<FormattedMessage id="business_info.list.table.form.pwd" defaultMessage="密码" />}
|
||||||
|
name="pwd"
|
||||||
|
placeholder={'输入新密码'}
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
</ProForm>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default AccountPsw;
|
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* @Author: donghao donghao@supervision.ltd
|
||||||
|
* @Date: 2024-04-23 17:00:00
|
||||||
|
* @LastEditors: donghao donghao@supervision.ltd
|
||||||
|
* @LastEditTime: 2024-04-24 17:14:48
|
||||||
|
* @FilePath: \general-ai-platform-web\src\pages\Project\BusinessInfo\components\baseInfo.tsx
|
||||||
|
* @Description: 基本信息展示
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { ProDescriptions } from '@ant-design/pro-components';
|
||||||
|
import { FormattedMessage } from '@umijs/max';
|
||||||
|
|
||||||
|
type BaseInfoProps = {
|
||||||
|
info: Record<string, any>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const BaseInfo: React.FC<BaseInfoProps> = ({ info }) => {
|
||||||
|
// 模型基本信息
|
||||||
|
const ModelDetailColumns = [
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="business.list.table.form.address" defaultMessage="公司地址" />,
|
||||||
|
dataIndex: 'address',
|
||||||
|
render: (_, record) => {
|
||||||
|
return record?.province + record?.city + record.address;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="business.list.table.form.industry" defaultMessage="所属行业" />,
|
||||||
|
dataIndex: 'industryName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="business.list.table.form.contacts" defaultMessage="联系人" />,
|
||||||
|
dataIndex: 'contacts',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: (
|
||||||
|
<FormattedMessage id="business.list.table.form.contactWay" defaultMessage="联系方式" />
|
||||||
|
),
|
||||||
|
dataIndex: 'contactWay',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: <FormattedMessage id="business.list.table.form.remark" defaultMessage="公司简介" />,
|
||||||
|
dataIndex: 'remark',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return (
|
||||||
|
<div className="gn_table_descriptions bg_active_1">
|
||||||
|
<ProDescriptions column={4} columns={ModelDetailColumns} dataSource={info}></ProDescriptions>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BaseInfo;
|
@ -0,0 +1,350 @@
|
|||||||
|
/*
|
||||||
|
* @Author: donghao donghao@supervision.ltd
|
||||||
|
* @Date: 2024-04-23 17:46:28
|
||||||
|
* @LastEditors: donghao donghao@supervision.ltd
|
||||||
|
* @LastEditTime: 2024-04-24 15:00:31
|
||||||
|
* @FilePath: \general-ai-platform-web\src\pages\Project\BusinessInfo\components\updateForm.tsx
|
||||||
|
* @Description: 修改企业信息
|
||||||
|
*/
|
||||||
|
import { useCity } from '@/hooks/useCity';
|
||||||
|
import { beforeUploadImage } from '@/utils/common';
|
||||||
|
import {
|
||||||
|
ModalForm,
|
||||||
|
ProForm,
|
||||||
|
ProFormSelect,
|
||||||
|
ProFormText,
|
||||||
|
ProFormTextArea,
|
||||||
|
// ProFormDependency,
|
||||||
|
ProFormUploadButton,
|
||||||
|
} from '@ant-design/pro-components';
|
||||||
|
import { FormattedMessage, useIntl } from '@umijs/max';
|
||||||
|
import { Form } from 'antd';
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import {
|
||||||
|
proFormSmallItemStyleProps,
|
||||||
|
proFormSmallModelWidth,
|
||||||
|
} from '../../../../../config/defaultForm';
|
||||||
|
// @ts-ignore
|
||||||
|
import cookie from 'react-cookies';
|
||||||
|
export type FormValueType = {
|
||||||
|
target?: string;
|
||||||
|
template?: string;
|
||||||
|
type?: string;
|
||||||
|
time?: string;
|
||||||
|
frequency?: string;
|
||||||
|
} & Partial<API.ModelCategory>;
|
||||||
|
export type UpdateFormProps = {
|
||||||
|
updateModalOpen: boolean;
|
||||||
|
handleModal: () => void;
|
||||||
|
values: Partial<API.ModelCategory>;
|
||||||
|
reload: any;
|
||||||
|
};
|
||||||
|
|
||||||
|
const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
||||||
|
const intl = useIntl();
|
||||||
|
// const [isAuto, setIsAuto] = useState(true);
|
||||||
|
const [form] = Form.useForm<API.ModelCategory>();
|
||||||
|
const [cityOptions, setCityOptions] = useState<Record<string, any>[]>([]);
|
||||||
|
const { formatProvinceByData, formatCityByProvinceData } = useCity();
|
||||||
|
function changeCity(record1, record2) {
|
||||||
|
// 汇总城市数据到表单
|
||||||
|
console.log(record1, record2, 'changeProvince_record');
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ModalForm<API.ModelCategory>
|
||||||
|
className="gn_form"
|
||||||
|
width={proFormSmallModelWidth}
|
||||||
|
title={intl.formatMessage({
|
||||||
|
id: 'business.list.table.createForm.add',
|
||||||
|
defaultMessage: '新建',
|
||||||
|
})}
|
||||||
|
open={props.updateModalOpen}
|
||||||
|
form={form}
|
||||||
|
autoFocusFirstInput
|
||||||
|
modalProps={{
|
||||||
|
destroyOnClose: true,
|
||||||
|
onCancel: () => props.handleModal(),
|
||||||
|
}}
|
||||||
|
submitTimeout={2000}
|
||||||
|
onFinish={async (values) => {
|
||||||
|
console.log(values, 'add_finish_values');
|
||||||
|
// TODO 对接更新接口
|
||||||
|
// postModelCategoryCreateModelCategory(values)
|
||||||
|
// .then(() => {
|
||||||
|
// message.success(intl.formatMessage({ id: 'common.success', defaultMessage: '$$$' }));
|
||||||
|
// props.reload();
|
||||||
|
// })
|
||||||
|
// .catch(() => {
|
||||||
|
// message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '$$$' }));
|
||||||
|
// });
|
||||||
|
props.handleModal();
|
||||||
|
return true;
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormText
|
||||||
|
width={proFormSmallItemStyleProps.width}
|
||||||
|
name="name"
|
||||||
|
label={<FormattedMessage id="business.list.table.form.name" defaultMessage="名称" />}
|
||||||
|
placeholder={`${intl.formatMessage({
|
||||||
|
id: 'common.please_input',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}${intl.formatMessage({
|
||||||
|
id: 'business.list.table.form.name',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}`}
|
||||||
|
initialValue={props.values.name}
|
||||||
|
required={true}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: (
|
||||||
|
<FormattedMessage
|
||||||
|
id="business.list.table.form.rule.required.name"
|
||||||
|
defaultMessage="name is required"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ProFormSelect
|
||||||
|
width={proFormSmallItemStyleProps.column2Width / 2 - 8}
|
||||||
|
name="province"
|
||||||
|
label={<FormattedMessage id="business.list.table.form.province" defaultMessage="省份" />}
|
||||||
|
placeholder={`${intl.formatMessage({
|
||||||
|
id: 'common.please_select',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}${intl.formatMessage({
|
||||||
|
id: 'business.list.table.form.province',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}`}
|
||||||
|
initialValue={props.values.province}
|
||||||
|
required={true}
|
||||||
|
showSearch
|
||||||
|
debounceTime={500}
|
||||||
|
request={() => {
|
||||||
|
const respDataList = formatProvinceByData();
|
||||||
|
// 初始化有省份数据,默认加载当前省份的城市数据
|
||||||
|
if (props.values.province) {
|
||||||
|
respDataList.forEach((item) => {
|
||||||
|
if (props.values.province === item.value) {
|
||||||
|
setCityOptions(() => formatCityByProvinceData(item));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return respDataList;
|
||||||
|
}}
|
||||||
|
onChange={(_, record2) => {
|
||||||
|
form.setFieldValue('city', null); // 先清空城市
|
||||||
|
setCityOptions(() => formatCityByProvinceData(record2));
|
||||||
|
}}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: (
|
||||||
|
<FormattedMessage
|
||||||
|
id="business.list.table.form.rule.required.province"
|
||||||
|
defaultMessage="name is required"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormSelect
|
||||||
|
width={proFormSmallItemStyleProps.column2Width / 2 - 8}
|
||||||
|
name="city"
|
||||||
|
label={<FormattedMessage id="business.list.table.form.city" defaultMessage="城市" />}
|
||||||
|
placeholder={`${intl.formatMessage({
|
||||||
|
id: 'common.please_select',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}${intl.formatMessage({
|
||||||
|
id: 'business.list.table.form.city',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}`}
|
||||||
|
initialValue={props.values.city}
|
||||||
|
required={true}
|
||||||
|
showSearch
|
||||||
|
debounceTime={500}
|
||||||
|
options={cityOptions}
|
||||||
|
onChange={changeCity}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: (
|
||||||
|
<FormattedMessage
|
||||||
|
id="business.list.table.form.rule.required.city"
|
||||||
|
defaultMessage="name is required"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
width={proFormSmallItemStyleProps.column2Width}
|
||||||
|
name="address"
|
||||||
|
label={<FormattedMessage id="business.list.table.form.address" defaultMessage="地址" />}
|
||||||
|
placeholder={`${intl.formatMessage({
|
||||||
|
id: 'common.please_input',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}${intl.formatMessage({
|
||||||
|
id: 'business.list.table.form.address',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}`}
|
||||||
|
initialValue={props.values.address}
|
||||||
|
required={true}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: (
|
||||||
|
<FormattedMessage
|
||||||
|
id="business.list.table.form.rule.required.address"
|
||||||
|
defaultMessage="name is required"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
width={proFormSmallItemStyleProps.width}
|
||||||
|
name="industry"
|
||||||
|
label={<FormattedMessage id="business.list.table.form.industry" defaultMessage="行业" />}
|
||||||
|
placeholder={`${intl.formatMessage({
|
||||||
|
id: 'common.please_input',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}${intl.formatMessage({
|
||||||
|
id: 'business.list.table.form.industry',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}`}
|
||||||
|
initialValue={props.values.industry}
|
||||||
|
required={true}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: (
|
||||||
|
<FormattedMessage
|
||||||
|
id="business.list.table.form.rule.required.industry"
|
||||||
|
defaultMessage="name is required"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
width={proFormSmallItemStyleProps.width}
|
||||||
|
name="contacts"
|
||||||
|
label={
|
||||||
|
<FormattedMessage id="business.list.table.form.contacts" defaultMessage="联系人" />
|
||||||
|
}
|
||||||
|
placeholder={`${intl.formatMessage({
|
||||||
|
id: 'common.please_input',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}${intl.formatMessage({
|
||||||
|
id: 'business.list.table.form.contacts',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}`}
|
||||||
|
initialValue={props.values.contacts}
|
||||||
|
required={true}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: (
|
||||||
|
<FormattedMessage
|
||||||
|
id="business.list.table.form.rule.required.contacts"
|
||||||
|
defaultMessage="name is required"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormText
|
||||||
|
width={proFormSmallItemStyleProps.width}
|
||||||
|
name="contactWay"
|
||||||
|
label={
|
||||||
|
<FormattedMessage id="business.list.table.form.contactWay" defaultMessage="联系方式" />
|
||||||
|
}
|
||||||
|
placeholder={`${intl.formatMessage({
|
||||||
|
id: 'common.please_input',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}${intl.formatMessage({
|
||||||
|
id: 'business.list.table.form.contactWay',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}`}
|
||||||
|
initialValue={props.values.contactWay}
|
||||||
|
required={true}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: (
|
||||||
|
<FormattedMessage
|
||||||
|
id="business.list.table.form.rule.required.contactWay"
|
||||||
|
defaultMessage="name is required"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<ProFormTextArea
|
||||||
|
width={proFormSmallItemStyleProps.width}
|
||||||
|
name="remark"
|
||||||
|
label={<FormattedMessage id="business.list.table.form.remark" defaultMessage="简介" />}
|
||||||
|
placeholder={`${intl.formatMessage({
|
||||||
|
id: 'common.please_input',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}${intl.formatMessage({
|
||||||
|
id: 'business.list.table.form.remark',
|
||||||
|
defaultMessage: '$$$',
|
||||||
|
})}`}
|
||||||
|
initialValue={props.values.remark}
|
||||||
|
required={true}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: (
|
||||||
|
<FormattedMessage
|
||||||
|
id="business.list.table.form.rule.required.remark"
|
||||||
|
defaultMessage="name is required"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
disabled={false}
|
||||||
|
/>
|
||||||
|
{/* // TODO level3 按UI实际效果调整上传logo & 改用上传base64格式编码 换手动上传 */}
|
||||||
|
<ProFormUploadButton
|
||||||
|
width={proFormSmallItemStyleProps.width}
|
||||||
|
max={1}
|
||||||
|
action="/api/v1/file/uploadImage"
|
||||||
|
name="logo"
|
||||||
|
label={<FormattedMessage id="business.list.table.form.logo" defaultMessage="logo" />}
|
||||||
|
fieldProps={{
|
||||||
|
name: 'file',
|
||||||
|
listType: 'picture-card',
|
||||||
|
beforeUpload: beforeUploadImage,
|
||||||
|
data: { path: 'user/avatar' },
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': cookie.load('csrftoken'),
|
||||||
|
'X-Token': `${localStorage.getItem('access') || ''}`,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
initialValue={props.values.logo}
|
||||||
|
required={true}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: (
|
||||||
|
<FormattedMessage
|
||||||
|
id="business.list.table.form.rule.required.logo"
|
||||||
|
defaultMessage="name is required"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</ProForm.Group>
|
||||||
|
</ModalForm>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default UpdateForm;
|
@ -0,0 +1,11 @@
|
|||||||
|
.businessInfo_page {
|
||||||
|
/* 企业算法列表 */
|
||||||
|
}
|
||||||
|
.businessInfo_page .algorithmCard_box .tag_type {
|
||||||
|
padding: 2px 4px;
|
||||||
|
color: white;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 12px;
|
||||||
|
background: linear-gradient(180deg, #21c7ff 0%, #428cff 100%);
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
.businessInfo_page {
|
||||||
|
/* 企业算法列表 */
|
||||||
|
// 算法卡片
|
||||||
|
|
||||||
|
.algorithmCard_box {
|
||||||
|
.tag_type {
|
||||||
|
padding: 2px 4px;
|
||||||
|
color: white;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 12px;
|
||||||
|
background: linear-gradient(180deg, #21c7ff 0%, #428cff 100%);
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: donghao donghao@supervision.ltd
|
|
||||||
* @Date: 2024-04-01 19:20:30
|
|
||||||
* @LastEditors: donghao donghao@supervision.ltd
|
|
||||||
* @LastEditTime: 2024-04-02 17:19:56
|
|
||||||
* @FilePath: \uighur-recognition-web2\src\services\realTime\alarmRules.ts
|
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
||||||
*/
|
|
||||||
// @ts-ignore
|
|
||||||
/* eslint-disable */
|
|
||||||
import { request } from '@umijs/max';
|
|
||||||
|
|
||||||
/** 告警列表 */
|
|
||||||
export async function getAlarmRules(
|
|
||||||
params: API.SearchAlarmRulesParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(`/api/warning_rule/`, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 更新告警列表 */
|
|
||||||
export async function postAlarmRules(
|
|
||||||
body: API.UpdateAlarmRulesParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(`/api/warning_rule/`, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 离线告警规则 */
|
|
||||||
export async function getOfflineAlarmRules(
|
|
||||||
params: API.SearchAlarmRulesParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(
|
|
||||||
`/api/upload_warning_rule/`,
|
|
||||||
{
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 离线更新告警规则 */
|
|
||||||
export async function postOfflineAlarmRules(
|
|
||||||
body: API.UpdateAlarmRulesParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(
|
|
||||||
`/api/upload_warning_rule/`,
|
|
||||||
{
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
// @ts-ignore
|
|
||||||
/* eslint-disable */
|
|
||||||
import { request } from '@umijs/max';
|
|
||||||
|
|
||||||
/** 告警列表 */
|
|
||||||
export async function postAlarmList(
|
|
||||||
body: API.SearchAlarmListParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(`/api/warning_info/`, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
params: {
|
|
||||||
...body,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/** 忽略事件 */
|
|
||||||
export async function postIgnoringvents(
|
|
||||||
body: API.IgnoringventsParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(`/api/detect_result/`, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 上传告警列表 */
|
|
||||||
export async function postUploadAlarmList(
|
|
||||||
params: API.SearchAlarmListParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(
|
|
||||||
`/api/upload_warning_info/`,
|
|
||||||
{
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 上传忽略事件 */
|
|
||||||
export async function postUploadIgnoringvents(
|
|
||||||
body: API.UploadIgnoringventsParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(
|
|
||||||
`/api/ignore_warning_info/`,
|
|
||||||
{
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: donghao donghao@supervision.ltd
|
|
||||||
* @Date: 2024-04-01 19:20:30
|
|
||||||
* @LastEditors: donghao donghao@supervision.ltd
|
|
||||||
* @LastEditTime: 2024-04-01 19:22:27
|
|
||||||
* @FilePath: \uighur-recognition-web2\src\services\realTime\index.ts
|
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
||||||
*/
|
|
||||||
// @ts-ignore
|
|
||||||
/* eslint-disable */
|
|
||||||
// API 更新时间:
|
|
||||||
// API 唯一标识:
|
|
||||||
import * as alarmlist from './alarmlist';
|
|
||||||
import * as alarmRules from './alarmRules';
|
|
||||||
import * as interfaces from './interfaces';
|
|
||||||
export default {
|
|
||||||
alarmlist,
|
|
||||||
alarmRules,
|
|
||||||
interfaces,
|
|
||||||
};
|
|
@ -1,89 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: donghao donghao@supervision.ltd
|
|
||||||
* @Date: 2024-04-01 19:20:30
|
|
||||||
* @LastEditors: donghao donghao@supervision.ltd
|
|
||||||
* @LastEditTime: 2024-04-02 17:44:55
|
|
||||||
* @FilePath: \uighur-recognition-web2\src\services\realTime\interfaces.ts
|
|
||||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
||||||
*/
|
|
||||||
// @ts-ignore
|
|
||||||
/* eslint-disable */
|
|
||||||
import { request } from '@umijs/max';
|
|
||||||
|
|
||||||
/** 接口列表 */
|
|
||||||
export async function getInterfaces(
|
|
||||||
params: API.SearchAlarmRulesParams | any,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(`/api/device/`, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 更新接口列表 */
|
|
||||||
export async function postInterfaces(
|
|
||||||
body: API.UpdateInterfacesParams | any,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(`/api/device/`, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/** 测试接口 */
|
|
||||||
export async function postTestDevice(
|
|
||||||
body: API.UpdateInterfacesParams | any,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(`/api/test_device/`, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 离线设备列表 */
|
|
||||||
export async function getInterfacesUpload(
|
|
||||||
params: API.SearchAlarmRulesParams | any,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(`/api/upload_device/`, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 更新接口列表 */
|
|
||||||
export async function postInterfacesUpload(
|
|
||||||
body: API.UpdateInterfacesParams | any,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(`/api/upload_device/`, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,116 +0,0 @@
|
|||||||
// @ts-ignore
|
|
||||||
/* eslint-disable */
|
|
||||||
import { request } from '@umijs/max';
|
|
||||||
|
|
||||||
/** 重点关注列表 */
|
|
||||||
export async function getInvolvedList(
|
|
||||||
params: API.SearchInvolvedParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(
|
|
||||||
`/api/recognition_people/`,
|
|
||||||
{
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 任务轨迹列表 */
|
|
||||||
export async function getInvolvedTravelList(
|
|
||||||
params: API.SearchInvolvedTravelParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(`/api/travel_track/`, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 关注与取消关注 */
|
|
||||||
export async function postRecognition(
|
|
||||||
body: API.RecognitionParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(
|
|
||||||
`/api/recognition_people/`,
|
|
||||||
{
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 上传重点关注列表 */
|
|
||||||
export async function getUploadInvolvedList(
|
|
||||||
params: API.SearchInvolvedParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(
|
|
||||||
`/api/upload_recognition_people/`,
|
|
||||||
{
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 上传任务轨迹列表 */
|
|
||||||
export async function getUploadInvolvedTravelList(
|
|
||||||
params: API.SearchInvolvedTravelParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(
|
|
||||||
`/api/upload_travel_track/`,
|
|
||||||
{
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
params: {
|
|
||||||
...params,
|
|
||||||
},
|
|
||||||
...(options || {}),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 上传关注与取消关注 */
|
|
||||||
export async function postUploadRecognition(
|
|
||||||
body: API.RecognitionParams,
|
|
||||||
options?: { [key: string]: any },
|
|
||||||
) {
|
|
||||||
return request<API.Response & { data?: API.PageResult; msg?: string }>(
|
|
||||||
`/api/upload_recognition_people/`,
|
|
||||||
{
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
data: body,
|
|
||||||
...(options || {}),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* @Author: donghao donghao@supervision.ltd
|
||||||
|
* @Date: 2024-04-24 10:11:48
|
||||||
|
* @LastEditors: donghao donghao@supervision.ltd
|
||||||
|
* @LastEditTime: 2024-04-24 10:17:21
|
||||||
|
* @FilePath: \general-ai-platform-web\src\utils\forApi.ts
|
||||||
|
* @Description: 这是接口层和业务层的转换工具方法集
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @判断接口数据是否成功返回
|
||||||
|
* @param result 接口返回数据
|
||||||
|
* @returns boolean
|
||||||
|
*/
|
||||||
|
export function isSuccessApi(result: API.API_COMMON_DATA): boolean {
|
||||||
|
const { meta } = result;
|
||||||
|
if (meta.code < 300 && meta.code >= 200) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|