feat: 添加 视频窗口切换组件

This commit is contained in:
YuanHongbo 2024-03-10 17:35:15 +08:00
parent c3041a7d9e
commit b67b89a4ce
3 changed files with 13 additions and 7 deletions

View File

@ -1,11 +1,9 @@
import { Card, Space, CardProps, Spin, Button } from 'antd'; import { Card, Space, CardProps, Spin, Button } from 'antd';
import { theme } from 'antd/lib'; import { theme } from 'antd/lib';
import { VideoPlayer, type VideoViewRef } from '@zhst/meta'; import { VideoPlayer, type VideoViewRef } from '@zhst/meta';
import React, { useState, useEffect, ReactNode, useRef } from 'react'; import React, { useState, useEffect, ReactNode, useRef } from 'react';
import { CloseOutlined, LoadingOutlined } from '@ant-design/icons'; import { CloseOutlined, LoadingOutlined } from '@ant-design/icons';
import './index.less' import './index.less'
export interface VideoPlayerCardProps { export interface VideoPlayerCardProps {
windowKey?: string; windowKey?: string;
selectedWindowKey?: string; selectedWindowKey?: string;

View File

@ -4,12 +4,20 @@ import { Empty, Space, Spin } from 'antd';
import "./index.less" import "./index.less"
import { LoadingOutlined } from '@ant-design/icons'; import { LoadingOutlined } from '@ant-design/icons';
interface WarningRecordListProps { interface WarningRecordListProps {
dataSource?: IRecord[]; dataSource?: IRecord[];
viewLargerImageModalRef?: React.RefObject<ViewLargerImageModalRef>; viewLargerImageModalRef?: React.RefObject<ViewLargerImageModalRef>;
/*
*/
handleDownloadImg?: (imgSrc?: string) => void; handleDownloadImg?: (imgSrc?: string) => void;
/*
*/
onRecordClick?: (record?: IRecord) => void; onRecordClick?: (record?: IRecord) => void;
/*
id
*/
selectedRecordId?: string; selectedRecordId?: string;
isRecordListLoading?: boolean; isRecordListLoading?: boolean;
recordListTitle?: string; recordListTitle?: string;
@ -58,7 +66,6 @@ const WarningRecordList: React.FC<WarningRecordListProps> = (props) => {
imgStyle={{ width: 280, height: 169, ...imgStyle }} imgStyle={{ width: 280, height: 169, ...imgStyle }}
/>) />)
} }
)} )}
</Space> </Space>
: :

View File

@ -16,7 +16,8 @@ title: WindowToggle 窗口切换组件
| 参数 | 说明 | 类型 | 默认值 | 版本 | | 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| dataSource | 用于渲染 每个窗口的数据 | VideoPlayerCardProps[] | 需要传一组默认值用于窗口的渲染| - |
| handleWindowClick | 用于获取窗口的 windowKey 方便更新对应窗口数据 | (key?: string) => void; | - | - |
| handleCloseButtonClick | 用于点击窗口关闭按钮的事件 | (key?: string) => void; | - | - |
| selectedWindowKey | 选中的窗口的 key 用于控制 选中边框样式 |string| - | - |