fix: 视频显示od框,修复预警记录无法查看大图
This commit is contained in:
parent
38fb02e322
commit
7b09934be8
@ -36,7 +36,6 @@ export default () => {
|
|||||||
const handleWindowClick = (key?: string) => {
|
const handleWindowClick = (key?: string) => {
|
||||||
setSelectedWindowKey(key)
|
setSelectedWindowKey(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
const clearWindowData = (key?: string) => {
|
const clearWindowData = (key?: string) => {
|
||||||
// 当关闭窗口时 也要刷新 右侧 预警记录接口 不要忘记
|
// 当关闭窗口时 也要刷新 右侧 预警记录接口 不要忘记
|
||||||
setVideoDataSource((pre) => {
|
setVideoDataSource((pre) => {
|
||||||
@ -49,12 +48,10 @@ export default () => {
|
|||||||
return newVideoDataSource
|
return newVideoDataSource
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDownloadImg = (imageKey?: string) => {
|
const handleDownloadImg = (imageKey?: string) => {
|
||||||
// 可以调用 下面 方法关闭弹窗
|
// 可以调用 下面 方法关闭弹窗
|
||||||
// viewLargerImageModalRef.current?.handleCancel()
|
// viewLargerImageModalRef.current?.handleCancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
const onRecordClick = (record?: IRecord) => {
|
const onRecordClick = (record?: IRecord) => {
|
||||||
// 点击的时候把数据 拿过来处理一下传给大图弹框
|
// 点击的时候把数据 拿过来处理一下传给大图弹框
|
||||||
const { imageKey, warningType, boxId, position, cabietId, warningTime, warningTimestamp, warningTimeFormat = 'YYYY-MM-DD HH:mm:ss', odRect = [] } = record || {}
|
const { imageKey, warningType, boxId, position, cabietId, warningTime, warningTimestamp, warningTimeFormat = 'YYYY-MM-DD HH:mm:ss', odRect = [] } = record || {}
|
||||||
@ -70,7 +67,6 @@ export default () => {
|
|||||||
]
|
]
|
||||||
// 调用这个方法打开弹框
|
// 调用这个方法打开弹框
|
||||||
viewLargerImageModalRef?.current?.show({ imageKey: imageKey, warningData: warningData, odRect: odRect })
|
viewLargerImageModalRef?.current?.show({ imageKey: imageKey, warningData: warningData, odRect: odRect })
|
||||||
|
|
||||||
setSelectedRecordId(record?.id)
|
setSelectedRecordId(record?.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +86,8 @@ export default () => {
|
|||||||
// 模拟 视频数据请求
|
// 模拟 视频数据请求
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// 对后端返回数据进行处理 组装一套符合属性的 数据
|
// 对后端返回数据进行处理 组装一套符合属性的 数据
|
||||||
const newVideoData: VideoPlayerCardProps = { imageKey: videoData.imageKey, title: videoData.title, odRect: videoData.odRect }
|
// videoSrc : videoData.videoSrc
|
||||||
|
const newVideoData: VideoPlayerCardProps = { imageKey: videoData.imageKey, title: videoData.title, odRect: videoData.odRect, videoSrc: videoData.videoSrc }
|
||||||
setVideoDataSource((pre) => {
|
setVideoDataSource((pre) => {
|
||||||
const newVideoDataSource: VideoPlayerCardProps[] = pre.map((item) => {
|
const newVideoDataSource: VideoPlayerCardProps[] = pre.map((item) => {
|
||||||
// 传给 选中的视频窗口
|
// 传给 选中的视频窗口
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
export const videoData = {
|
export const videoData = {
|
||||||
imageKey: 'https://i.yourimageshare.com/lRHiD2UnAT.png',
|
imageKey: 'https://i.yourimageshare.com/lRHiD2UnAT.png',
|
||||||
// videoSrc: 'ws://10.0.0.7:9033/flv/File/test/test_h264_1.mp4.flv?ip=127.0.0.1',
|
videoSrc: 'ws://10.0.0.7:9033/flv/File/test/test_h264_1.mp4.flv?ip=127.0.0.1',
|
||||||
title: `盒子1 点位1`,
|
title: `盒子1 点位1`,
|
||||||
odRect: [{
|
odRect: [{
|
||||||
"id": "456",
|
"id": "456",
|
||||||
|
@ -19,7 +19,7 @@ export interface VideoPlayerCardProps {
|
|||||||
handleCloseButtonClick?: (key?: string) => void;
|
handleCloseButtonClick?: (key?: string) => void;
|
||||||
handleWindowClick?: (key?: string) => void;
|
handleWindowClick?: (key?: string) => void;
|
||||||
odRect?: {
|
odRect?: {
|
||||||
id?: string;
|
id: string;
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
w: number;
|
w: number;
|
||||||
@ -58,7 +58,7 @@ export const VideoPlayerCard: React.FC<VideoPlayerCardProps> = (props) => {
|
|||||||
let contentElement: JSX.Element | null = null;
|
let contentElement: JSX.Element | null = null;
|
||||||
if (videoSrc) {
|
if (videoSrc) {
|
||||||
contentElement = (
|
contentElement = (
|
||||||
<VideoPlayer ref={videoRef} url={videoSrc} />
|
<VideoPlayer ref={videoRef} url={videoSrc} showOD odList={odRectDefault} />
|
||||||
);
|
);
|
||||||
videoRef.current?.setShowCrop(true)
|
videoRef.current?.setShowCrop(true)
|
||||||
|
|
||||||
|
@ -88,7 +88,8 @@ export const ViewLargerImageModal = forwardRef<ViewLargerImageModalRef, ViewLarg
|
|||||||
<div className={`${componentName}-left-img`}>
|
<div className={`${componentName}-left-img`}>
|
||||||
<div style={{ width: 789, height: 444, ...imgStyle }}>
|
<div style={{ width: 789, height: 444, ...imgStyle }}>
|
||||||
<CropperImage
|
<CropperImage
|
||||||
// editAble={true}
|
// editAble={false}
|
||||||
|
// selectAble={false}
|
||||||
odList={odRectDefault}
|
odList={odRectDefault}
|
||||||
url={imageKey}
|
url={imageKey}
|
||||||
/>
|
/>
|
||||||
|
@ -55,7 +55,7 @@ export interface IRecord {
|
|||||||
接收 od框 坐标
|
接收 od框 坐标
|
||||||
*/
|
*/
|
||||||
odRect?: {
|
odRect?: {
|
||||||
id?: string;
|
id: string;
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
w: number;
|
w: number;
|
||||||
@ -82,8 +82,6 @@ export const WarningRecordCard: React.FC<WarningRecordCardProps> = (props) => {
|
|||||||
const { getPrefixCls } = useContext(ConfigContext);
|
const { getPrefixCls } = useContext(ConfigContext);
|
||||||
const { prefixCls: customizePrefixCls, record, onRecordClick, style, cardProps, selectedRecordId, cardStyle, imgStyle } = props;
|
const { prefixCls: customizePrefixCls, record, onRecordClick, style, cardProps, selectedRecordId, cardStyle, imgStyle } = props;
|
||||||
const componentName = getPrefixCls('biz-warning-record-card', customizePrefixCls);
|
const componentName = getPrefixCls('biz-warning-record-card', customizePrefixCls);
|
||||||
|
|
||||||
;
|
|
||||||
const { imageKey, id, warningType, warningInfo = [], cabietText, warningTime, warningTimestamp, warningTimeFormat = 'YYYY-MM-DD HH:mm:ss', odRect = [] } = record || {}
|
const { imageKey, id, warningType, warningInfo = [], cabietText, warningTime, warningTimestamp, warningTimeFormat = 'YYYY-MM-DD HH:mm:ss', odRect = [] } = record || {}
|
||||||
const formattedDate = warningTimestamp ? dayjs(warningTimestamp).format(warningTimeFormat) : '';
|
const formattedDate = warningTimestamp ? dayjs(warningTimestamp).format(warningTimeFormat) : '';
|
||||||
const warningTimeShow = warningTime ? warningTime : formattedDate
|
const warningTimeShow = warningTime ? warningTime : formattedDate
|
||||||
@ -99,22 +97,18 @@ export const WarningRecordCard: React.FC<WarningRecordCardProps> = (props) => {
|
|||||||
const selectedCardStyle: React.CSSProperties = {
|
const selectedCardStyle: React.CSSProperties = {
|
||||||
...(selectedRecordId === record?.id ? selectedBorderStyle : {})
|
...(selectedRecordId === record?.id ? selectedBorderStyle : {})
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
onRecordClick?.(record);
|
onRecordClick?.(record);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={componentName} key={id} onClick={handleClick} style={style}>
|
<div className={componentName} key={id} onClick={handleClick} style={style}>
|
||||||
<Card
|
<Card
|
||||||
cover={
|
cover={
|
||||||
<div style={{ width: 336, height: 203, ...imgStyle }}>
|
<div style={{ width: 336, height: 203, ...imgStyle }}>
|
||||||
<CropperImage
|
<CropperImage
|
||||||
// editAble={true}
|
// 无法触发 图片点击时间需要 加 selectAble
|
||||||
|
selectAble={false}
|
||||||
odList={odRectDefault}
|
odList={odRectDefault}
|
||||||
url={imageKey}
|
url={imageKey}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user