fact: 重点关注页面及接口联调

develop
JINGYJ 12 months ago
parent 634ff34962
commit 43c86f77a0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -4,6 +4,7 @@ import { FormattedMessage, useIntl } from '@umijs/max';
import { Form, message,Image, Button, Popover } from 'antd';
import React, { useEffect, useState } from 'react';
import { postIgnoringvents } from '@/services/alarm/Alarmlist';
import { postRecognition } from '@/services/alarm/Involved';
// Import Swiper React components
// import { Swiper, SwiperSlide } from 'swiper/react';
// import { Navigation, Pagination, Mousewheel } from 'swiper/modules';
@ -46,18 +47,43 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
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) {
if (involved === 1) {
setInvolved(0);
handlePostRecognition(props.values?.person_id, 0)
} else {
setInvolved(1);
handlePostRecognition(props.values?.person_id, 1)
}
}
@ -78,7 +104,10 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
autoFocusFirstInput
modalProps={{
destroyOnClose: true,
onCancel: () => props.handleModal(),
onCancel: () => {
setInvolved(0);
props.handleModal()
},
okText: intl.formatMessage({ id: 'common.yes', defaultMessage: '确认' }),
cancelText: intl.formatMessage({ id: 'common.no', defaultMessage: '取消' }),
}}
@ -125,42 +154,10 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
}}
>
{/* <ProForm.Group> */}
{/* <div className={styles.alarmDetails}>
: <span className={styles.alarmSpan}></span>: <span className={styles.alarmSpan}>广1#</span>: <span className={styles.alarmSpan}>2023-01-15 22:00:03</span>
</div> */}
<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) => {
console.log(involvedInfo, 'item');
return (
<ImageWithPopover
src={item?.[1]}
involved={involvedInfo[index][2]}
key={index}
indexId={index}
handleInvolved={handleInvolved}
></ImageWithPopover>
);
})
) : (
Array.isArray(props?.values?.picture_path) && props?.values?.picture_path.length && props?.values?.picture_path.map((item: any, index: any) => {
console.log(item,'dan');
return (
<ImageWithPopover
src={item}
involved={props?.values?.person_classify}
key={index}
indexId={index}
handleInvolved={handleInvolved}
></ImageWithPopover>
);
})
)
)} */}
{Array.isArray(props.values?.person_id) ? (
Array.isArray(involvedInfo) && involvedInfo.length ? (
involvedInfo.map((item: any, index: any) => {
@ -262,7 +259,6 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
</div>
</div> */}
</div>
{/* </ProForm.Group> */}
</ModalForm>
);

@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { Image, Popover, Button } from 'antd';
import { CloseCircleOutlined, EllipsisOutlined, EyeOutlined, InfoCircleOutlined } from '@ant-design/icons';
interface ImageSinglePopoverProps {
src: string;
involved: any;
@ -33,7 +34,7 @@ const ImageSinglePopover: React.FC<ImageSinglePopoverProps> = ({ src, involved,
onClick={()=>{
// setInvolved(true)
handleInvolved();
reload()
// reload()
setOpen(false)
}}
></Button>
@ -44,7 +45,7 @@ const ImageSinglePopover: React.FC<ImageSinglePopoverProps> = ({ src, involved,
onClick={()=>{
// setInvolved(false)
handleInvolved();
reload()
// reload()
setOpen(false)
}}
></Button>

@ -1,85 +0,0 @@
.alarmImgBox {
// display: flex;
// justify-content: flex-start;
.alarmImgLeft {
position: relative;
margin-right: 32px;
width: 120px;
// height: 600px;
.alarmImgLeftBox{
width: 112px;
height: 112px;
border-radius: 4px;
// background: skyblue;
}
.alarmImgLeftBoxActive {
width: 112px;
height: 112px;
border-radius: 4px;
border: 1.5px solid #081FA8;
}
.shadowBox {
position: absolute;
left: 0;
bottom: 0px;
width: 112px;
height: 20px;
background: #FFF;
z-index: 999;
}
}
.alarmImgRight{
flex: 1;
position: relative;
.alarmImgRightTopBox {
width: 640px;
height: 640px;
background: skyblue;
}
.alarmDetails {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 38px;
padding-left: 24px;
line-height: 38px;
margin-bottom: 16px;
font-family: PingFang SC;
font-size: 16px;
font-weight: 400;
color: #FFFFFF;
background: rgba(0, 0, 0, 0.6);
.alarmSpan {
// color: #333;
margin-right: 24px;
}
}
}
.alarmImgDescribe {
margin-bottom: 12px;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
font-size: 16px;
color: #666;
span {
color: #333;
}
}
.alarmImgContent {
box-sizing: border-box;
padding: 16px;
width: 100%;
// height: 172px;
background: #F7F7F7;
border-radius: 4px;
border: 2px dashed #DCDCDC;
display: flex;
justify-content: center;
}
}
.myButtonDisabled{
visibility: hidden;
}

@ -1,143 +0,0 @@
import { putDeviceCategoryUpdateDeviceCategory } from '@/services/device/DeviceCategory';
import { postDeviceGroupGetDeviceGroupFkSelect } from '@/services/device/DeviceGroup';
import { ModalForm, ProForm, ProFormFieldSet, ProFormSelect, ProFormSwitch, ProFormText } from '@ant-design/pro-components';
import { FormattedMessage, useIntl } from '@umijs/max';
import { Form, message,Image, Button, Popover } from 'antd';
import React, { useEffect, useState } from 'react';
import { postIgnoringvents } from '@/services/alarm/Alarmlist';
import styles from './AlarmDetails.less'
import moment from 'moment';
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(false);
const handleInvolved = () => {
if (involved) {
setInvolved(false);
} else {
setInvolved(true);
}
};
// const [open, setOpen] = useState(false);
useEffect(() => {
setImageSrc(props?.values?.picture_path?.[0])
}, [props.updateModalOpen])
return (
<ModalForm<any>
width={615}
title={intl.formatMessage({
id: 'alarm.list.table.form.title',
defaultMessage: `编辑${props.values.warning_name}`,
})}
open={props.updateModalOpen}
form={form}
autoFocusFirstInput
modalProps={{
destroyOnClose: true,
onCancel: () => props.handleModal(),
}}
submitter={false}
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.alarmDetails}>
: <span className={styles.alarmSpan}></span>: <span className={styles.alarmSpan}>广1#</span>: <span className={styles.alarmSpan}>2023-01-15 22:00:03</span>
</div> */}
<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}>
</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,12 +1,17 @@
import React, { useState } from 'react';
import { Image, Popover, Button } from 'antd';
import { CloseCircleOutlined, EllipsisOutlined, EyeOutlined, InfoCircleOutlined } from '@ant-design/icons';
import { Image, Popover, Button, message } from 'antd';
import { CloseCircleOutlined, EllipsisOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { postRecognition } from '@/services/alarm/Involved';
interface ImageWithPopoverProps {
src: string;
reload: any;
person_id: any;
}
const ImageWithPopover: React.FC<ImageWithPopoverProps> = ({ src }) => {
const ImageWithPopover: React.FC<ImageWithPopoverProps> = ({ src, person_id,reload }) => {
const intl = useIntl();
const [visible, setVisible] = useState(false);
const [open, setOpen] = useState(false);
@ -16,12 +21,21 @@ const ImageWithPopover: React.FC<ImageWithPopoverProps> = ({ src }) => {
<div>2</div> */}
<Button
type="text"
style={{ height:22, padding: 0,fontSize: 12,color: '#FFF' }}
style={{ height:22, padding: 0,fontSize: 12,color: '#FFF' }}
icon={<CloseCircleOutlined style={{ color: '#E80D0D',fontSize: 12}} />}
onClick={(event)=>{
// setInvolved(false)
// handleInvolved();
event.stopPropagation();
postRecognition({
person_id: person_id,
classify: '0'
})
.then(() => {
message.success('此人已被移除重点关注');
reload();
})
.catch(() => {
message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '失败' }));
});
setOpen(false)
}}
></Button>
@ -44,12 +58,6 @@ const ImageWithPopover: React.FC<ImageWithPopoverProps> = ({ src }) => {
style={{ borderRadius: 4 }}
width={96}
height={96}
// preview={{
// visible,
// src,
// onVisibleChange: handleVisibleChange,
// mask: generateMask("点击可预览大图"),
// }}
preview={false}
src={src}
/>

@ -0,0 +1,26 @@
.InvolvedImgBox {
box-sizing: border-box;
// display: flex;
// justify-content: flex-start;
padding: 16px 32px;
border-top: 1px solid #E0E0E0;
.involvedImgList {
position: relative;
span {
position: absolute;
width: 2px;
height: 30px;
bottom: -30px;
left: 15px;
border-left: 2px dashed #081FA8;
}
}
}
.myButtonDisabled{
visibility: hidden;
}
.involvedModalForm {
.ant-modal .ant-modal-content {
padding: 0 !important;
}
}

@ -0,0 +1,305 @@
import { putDeviceCategoryUpdateDeviceCategory } from '@/services/device/DeviceCategory';
import { postDeviceGroupGetDeviceGroupFkSelect } from '@/services/device/DeviceGroup';
import { ModalForm, ProForm, ProFormFieldSet, ProFormSelect, ProFormSwitch, ProFormText } from '@ant-design/pro-components';
import { FormattedMessage, useIntl } from '@umijs/max';
import { Form, message,Image, Button, Popover, List, Avatar } from 'antd';
import React, { useEffect, useState } from 'react';
import { getInvolvedTravelList } from '@/services/alarm/Involved';
import styles from './InvolvedDetails.less'
import './InvolvedDetails.less'
import moment from 'moment';
import { CloseCircleOutlined, EllipsisOutlined } from '@ant-design/icons';
import VirtualList from 'rc-virtual-list';
import trajectoryBottom from '../../../../../public/images/involved/trajectoryBottom.png'
import { postRecognition } from '@/services/alarm/Involved';
export type FormValueType = {
target?: string;
template?: string;
type?: string;
time?: string;
frequency?: string;
} & Partial<API.InvolvedDetailsParams>;
export type UpdateFormProps = {
updateModalOpen: boolean;
handleModal: () => void;
values: Partial<API.InvolvedDetailsParams>;
reload: any;
};
const InvolvedDetails: React.FC<UpdateFormProps> = (props) => {
const intl = useIntl();
const [form] = Form.useForm<API.InvolvedDetailsParams>();
const [dataFlag, setDataFlag] = useState(false);;
const [open, setOpen] = useState(false);
const [trajectoryData, setTrajectoryData] = useState([]);
// 动态设置每页数量
const [currentPageSize, setCurrentPageSize] = useState<number>(10);
const [currentPage, setCurrentPage] = useState<number>(1);
const [total, setTotal] = useState<number>(0);
const ContainerHeight = 630;
const content = (
<div style={{ display: 'flex', justifyContent: 'center',alignItems: 'center', height: '100%'}}>
{/* <div>1</div>
<div>2</div> */}
<Button
type="text"
style={{ height:22, padding: 0,fontSize: 12,color: '#FFF' }}
icon={<CloseCircleOutlined style={{ color: '#E80D0D',fontSize: 12}} />}
onClick={(event)=>{
event.stopPropagation();
postRecognition({
person_id: props.values.person_id,
classify: '0'
})
.then(() => {
message.success('此人已被移除重点关注');
props.reload();
})
.catch(() => {
message.error(intl.formatMessage({ id: 'common.failure', defaultMessage: '失败' }));
});
setOpen(false)
props.handleModal()
}}
></Button>
</div>
);
const handleOpenChange = (value: boolean) => {
setOpen(value);
};
const appendData = (page: any, pageSize: any) => {
const reqParams = {
page: page,
pageSize: pageSize,
// desc: false,
person_id: props.values.person_id,
// ...rest,
};
getInvolvedTravelList(reqParams).then((res) => {
console.log(res);
if(res.data.results) {
setTrajectoryData(trajectoryData.concat(res.data.results));
setTotal(res.data.count)
if(res.data.next) {
setDataFlag(true)
}else {
setDataFlag(false)
// setTrajectoryData([]); // 重置trajectoryData数据为空数组
}
}
})
.catch(() => {
// setLoading(false);
setDataFlag(false)
// setTrajectoryData([]); // 重置trajectoryData数据为空数组
});
};
const onScroll = (e: React.UIEvent<HTMLElement, UIEvent>) => {
// Refer to: https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#problems_and_solutions
console.log(e.currentTarget.scrollHeight - e.currentTarget.scrollTop - ContainerHeight);
if (Math.abs(e.currentTarget.scrollHeight - e.currentTarget.scrollTop - ContainerHeight) <= 1) {
if(dataFlag) {
const nextPage = currentPage + 1
setCurrentPage(nextPage);
appendData(nextPage, 10);
}
}
};
useEffect(() => {
if (props.updateModalOpen) {
// 调用接口获取数据
setTrajectoryData([]); // 重置trajectoryData数据为空数组
setCurrentPage(1);
setCurrentPageSize(10);
appendData(currentPage, currentPageSize);
}
}, [props.updateModalOpen]);
return (
<ModalForm<any>
width={615}
title={
<div
style={{
display: 'flex',
alignItems: 'center',
padding: '24px 32px 0px',
justifyContent: 'flex-start',
}}
>
<div style={{ position: 'relative', boxSizing: 'border-box', width: 120, height: 120 }}>
<Image
style={{ borderRadius: 4 }}
width={120}
height={120}
preview={false}
src={props?.values?.picture_path}
/>
<Popover
placement="right"
content={content}
trigger="click"
style={{ width: 104, height: 32 }}
color="rgba(0, 0, 0, 0.6)"
overlayInnerStyle={{ width: 104, height: 32, padding: 4, borderRadius: 2 }}
open={open}
onOpenChange={handleOpenChange}
>
<Button
style={{ position: 'absolute', bottom: 0, right: -4 }}
type="text"
icon={<EllipsisOutlined style={{ color: '#fff', fontSize: 24, transform: 'rotate(90deg)' }} />}
// onClick={handleButtonClick}
/>
</Popover>
<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',
fontWeight: 400
}}
>
</div>
</div>
<div
style={{
marginLeft: 12,
height: 98,
display: 'flex',
flexDirection: 'column',
justifyContent: 'space-between',
color: '#666',
fontSize: 14,
fontWeight: 400
}}
>
<div>
:{' '}
<span
style={{
color: '#333',
}}
>
{moment(props?.values?.classify_time).format('YYYY-MM-DD hh:mm:ss')}
</span>
</div>
<div>
:{' '}
<span
style={{
color: '#333',
}}
>
{moment(props?.values?.appear_time).format('YYYY-MM-DD hh:mm:ss')}
</span>
</div>
<div>
:{' '}
<span
style={{
color: '#333',
}}
>
{props?.values?.device_name}
</span>
</div>
</div>
</div>
}
open={props.updateModalOpen}
form={form}
autoFocusFirstInput
modalProps={{
destroyOnClose: true,
onCancel: () => {
setTrajectoryData([]);
setCurrentPage(1);
setCurrentPageSize(10);
props.handleModal()
},
wrapClassName:"involvedModalForm"
}}
submitter={false}
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: '失败' }));
// });
setTrajectoryData([]);
setCurrentPage(1);
setCurrentPageSize(10);
props.handleModal();
return true;
}}
>
{/* <ProForm.Group> */}
{/* <div className={styles.alarmDetails}>
: <span className={styles.alarmSpan}></span>: <span className={styles.alarmSpan}>广1#</span>: <span className={styles.alarmSpan}>2023-01-15 22:00:03</span>
</div> */}
<div className={styles.InvolvedImgBox}>
<List>
<VirtualList
data={trajectoryData}
height={ContainerHeight}
itemHeight={64}
itemKey="id"
onScroll={onScroll}
>
{(item: any, index:any) => (
<div key={item.person_id + index}>
<List.Item style={{ borderBottom: 0, height: 64, padding: 0 }}>
<List.Item.Meta
avatar={
<div className={styles.involvedImgList}>
<img style={{ width: 32, height: 32 }} src={trajectoryBottom} />
{index + 1 !== total && <span />}
</div>
}
title={<div style={{ lineHeight: '30px', color: '#666' }}>: <span style={{ color: '#333', marginRight: 16}}>{moment(item.appear_time).format('YYYY-MM-DD hh:mm:ss')}</span> : <span style={{ color: '#333'}}>{item.device_name}</span></div>}
/>
<div>
<Image
style={{ borderRadius: 4 }}
width={48}
height={48}
preview={{
mask: '',
}}
src={item.picture_path}
/>
</div>
</List.Item>
{index === total - 1 && (
<div style={{ textAlign: 'center', color: '#999' }}>~</div>
)}
</div>
)}
</VirtualList>
</List>
</div>
{/* </ProForm.Group> */}
</ModalForm>
);
};
export default InvolvedDetails;

@ -5,9 +5,9 @@ import React, { useEffect, useRef, useState } from 'react';
import { proTablePaginationOptions } from '../../../../config/defaultTable';
// import DeviceStatusCard from './components/DeviceStatusCard';
// import CreateForm from './components/CreateForm';
import { postAlarmList } from '@/services/alarm/Alarmlist';
import { getInvolvedList } from '@/services/alarm/Involved';
import { QuestionCircleFilled } from '@ant-design/icons';
import AlarmDetails from './components/AlarmDetails';
import InvolvedDetails from './components/InvolvedDetails';
import moment from 'moment';
import ImageWithPopover from './components/ImageWithPopover';
@ -165,7 +165,10 @@ const InvolvedList: React.FC = () => {
src={record.picture_path[0]}
/> */}
<ImageWithPopover
src={record.picture_path[0]}
src={record.picture_path}
// eslint-disable-next-line @typescript-eslint/no-use-before-define
reload={initList}
person_id={record.person_id}
// handleInvolved={handleInvolved}
></ImageWithPopover>
<div
@ -179,33 +182,33 @@ const InvolvedList: React.FC = () => {
}}
>
<div>
:{' '}
:{' '}
<span
style={{
color: '#333',
}}
>
{record.warning_name}
{moment(record.classify_time).format('YYYY-MM-DD hh:mm:ss')}
</span>
</div>
<div>
:{' '}
:{' '}
<span
style={{
color: '#333',
}}
>
{record.device_name}
{moment(record.appear_time).format('YYYY-MM-DD hh:mm:ss')}
</span>
</div>
<div>
:{' '}
:{' '}
<span
style={{
color: '#333',
}}
>
{moment(record.trigger_time).format('YYYY-MM-DD hh:mm:ss')}
{record.device_name}
</span>
</div>
</div>
@ -220,15 +223,15 @@ const InvolvedList: React.FC = () => {
}
// 初始化加载
async function initList(tabId:string = tab) {
async function initList(tabId:string = '1') {
const reqParams = {
page: currentPage,
pageSize: currentPageSize,
// desc: false,
warning_type: tabId,
classify: tabId,
// ...rest,
};
const resp = await postAlarmList({ ...reqParams });
const resp = await getInvolvedList({ ...reqParams });
// console.log(resp,'resp');
// setCurrentPageSize(resp?.data?.count)
setTotal(resp?.data?.count)
@ -420,7 +423,7 @@ const InvolvedList: React.FC = () => {
handleModal={handleCreateModal}
reload={actionRef.current?.reload}
/> */}
<AlarmDetails
<InvolvedDetails
updateModalOpen={updateModalOpen}
values={currentRow || {}}
handleModal={handleUpdateModal}

@ -0,0 +1,61 @@
// @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 || {}),
},
);
}

@ -95,5 +95,47 @@ declare namespace API {
is_ignore?: any; // 设备代码 // 是否启用
person_id?: string;
}
type SearchInvolvedParams = {
/** 人员标识 0为正常1为重点关注2为白名单 */
classify?: string;
/** 排序方式:升序false(默认)|降序true */
desc?: boolean;
/** 页码 */
page?: number;
/** 每页大小 */
pageSize?: number;
};
type InvolvedDetailsParams = {
/** 人员标识 0为正常1为重点关注2为白名单 */
classify?: string;
/** 人员id */
person_id?: string;
/** 人员照片 */
picture_path?: string;
/** 标记时间 */
classify_time?: string;
/** 设备id */
device_id?: string;
/** 设备名 */
device_name?: string;
/** 出现时间 */
appear_time?: string;
};
type SearchInvolvedTravelParams = {
/** 人员ID */
person_id?: string;
/** 排序方式:升序false(默认)|降序true */
desc?: boolean;
/** 页码 */
page?: number;
/** 每页大小 */
pageSize?: number;
};
type RecognitionParams = {
/** 人员ID */
person_id?: string;
/** 人员标识 0为正常1为重点关注2为白名单 */
classify?: string;
};
}
Loading…
Cancel
Save