154 lines
4.7 KiB
TypeScript
154 lines
4.7 KiB
TypeScript
/**
|
|
* 适配老的大屏组件数据格式传入
|
|
*/
|
|
import React from 'react';
|
|
import { AlgorithmVersionStr, HumanProperty, ObjectType, Rect, ViewOption, AlignType, IScreenshotButtonProp, ODRECT } from '@zhst/types';
|
|
export type TAB_TYPE = 'COMPATER' | 'NORMAL' | 'TRACK';
|
|
export type MODEL_TYPE = 'VIDEO' | 'IMAGE';
|
|
export interface ImgViewProps extends React.HTMLAttributes<HTMLElement> {
|
|
imageKey: string;
|
|
odRect: ODRECT;
|
|
attachImg?: Array<{
|
|
label: string;
|
|
url: string;
|
|
}>;
|
|
showAttachImgLabel: boolean;
|
|
screenshotButtonAlign: AlignType;
|
|
screenshotButtonRender: (screenshotButtonProp: IScreenshotButtonProp) => React.ReactElement;
|
|
scale$?: number;
|
|
showCrop$?: boolean;
|
|
hideLeftTopBtn?: boolean;
|
|
score?: number;
|
|
viewOption?: ViewOption;
|
|
}
|
|
export interface VideoViewProps {
|
|
flvUrl: string;
|
|
maxDuration?: number;
|
|
screenshotButtonAlign?: AlignType;
|
|
screenshotButtonRender?: (screenshotButtonProp: IScreenshotButtonProp) => React.ReactElement;
|
|
defautlNormalizationRect?: Rect;
|
|
onCropChange?: (showCrop: boolean, normalizationRect: null | Rect) => void;
|
|
showCrop$?: boolean;
|
|
}
|
|
export interface CarouselProps {
|
|
hasPre?: boolean;
|
|
hasNext?: boolean;
|
|
selectIndex: number;
|
|
setSelectIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
dataSource: Array<{
|
|
key: string;
|
|
url: string;
|
|
}>;
|
|
}
|
|
export type ISelectItem = Partial<Omit<ImgViewProps, 'screenshotButtonRender'>> & Partial<Omit<VideoViewProps, 'screenshotButtonRender'>>;
|
|
export interface HeaderProps {
|
|
value: TAB_TYPE;
|
|
onChange: (type: TAB_TYPE) => void;
|
|
tabsFilter: TAB_TYPE[];
|
|
}
|
|
export interface ImgViewRef {
|
|
imgInsRef: React.MutableRefObject<any>;
|
|
setShowCrop: React.Dispatch<React.SetStateAction<boolean>>;
|
|
}
|
|
export interface VideoViewRef {
|
|
cropAble: boolean;
|
|
setShowCrop: React.Dispatch<React.SetStateAction<boolean>>;
|
|
downloadVideoframe: () => void;
|
|
}
|
|
export interface ParamProps {
|
|
tab: string;
|
|
selectItem: ISelectItem;
|
|
imgViewRef: React.MutableRefObject<ImgViewRef>;
|
|
VideoViewRef: React.MutableRefObject<VideoViewRef>;
|
|
model: MODEL_TYPE;
|
|
setModel: React.Dispatch<React.SetStateAction<MODEL_TYPE>>;
|
|
scale$: number;
|
|
showCrop$: boolean;
|
|
}
|
|
export interface BigImageData {
|
|
extendRectList: (Rect & {
|
|
algorithmVersion: AlgorithmVersionStr;
|
|
imageKey: string;
|
|
})[];
|
|
rectList: (Rect & {
|
|
algorithmVersion: AlgorithmVersionStr;
|
|
imageKey: string;
|
|
})[];
|
|
attachImg: {
|
|
url: string;
|
|
label: '形体' | '人脸';
|
|
}[];
|
|
odRect: Rect;
|
|
imageKey: string;
|
|
imgSummary: string;
|
|
objectExtImageKey: string;
|
|
attributeList: {
|
|
label: string;
|
|
list: any[];
|
|
}[];
|
|
archiveImages?: any;
|
|
spaceName: string;
|
|
objectType: ObjectType;
|
|
objectId: string;
|
|
bodyObjectId?: string;
|
|
faceObjectId?: string;
|
|
sourceObjectId?: string;
|
|
cameraId: string;
|
|
cameraName: string;
|
|
selectIndex: number;
|
|
humanProperty: HumanProperty;
|
|
qualityScore?: number;
|
|
score: number;
|
|
timestamp: string;
|
|
bodyImageUrl: string;
|
|
faceImageUrl: string;
|
|
algorithmVersion: AlgorithmVersionStr;
|
|
bodySpaceName: string;
|
|
faceSpaceName: string;
|
|
solutionId?: string;
|
|
[index: string]: any;
|
|
}
|
|
interface IOldImageData {
|
|
visible?: boolean;
|
|
defaultModel?: MODEL_TYPE;
|
|
onClose?: () => void;
|
|
isLoading?: boolean;
|
|
hasPre?: boolean;
|
|
hasNext?: boolean;
|
|
selectIndex?: number;
|
|
onSelectIndexChange?: (i: number) => void;
|
|
dataSource: any[];
|
|
dataSources: any[];
|
|
relatedData?: any[];
|
|
transformPropFunc: (item: any) => ISelectItem;
|
|
transformVideoPropFunc: (item: ISelectItem) => Promise<Omit<VideoViewProps, 'screenshotButtonRender'>>;
|
|
screenshotButtonRender?: (screenshotButtonProp: IScreenshotButtonProp) => React.ReactElement;
|
|
showTool?: boolean;
|
|
showCarousel?: boolean;
|
|
imgViewProp?: Partial<ImgViewProps>;
|
|
videoViewProp?: Partial<VideoViewProps>;
|
|
ToolProps?: Partial<ToolProps>;
|
|
nullDialogProp?: {
|
|
emptyText?: string;
|
|
};
|
|
showHeader?: boolean;
|
|
tabsFilter?: TAB_TYPE[];
|
|
useVirtual?: boolean;
|
|
loadNext?: (i: number) => Promise<void>;
|
|
loadPre?: (i: number) => Promise<void>;
|
|
children: React.ReactNode;
|
|
title?: string;
|
|
specialTitle?: string;
|
|
isRelated?: boolean;
|
|
carouselProp?: Partial<CarouselProps>;
|
|
}
|
|
export interface ToolProps {
|
|
renderRight?: (props: ParamProps) => React.ReactNode;
|
|
renderLeft?: (props: ParamProps) => React.ReactNode;
|
|
renderVideoBtn?: boolean;
|
|
param: ParamProps;
|
|
disableVideo: boolean;
|
|
}
|
|
declare const _default: (data: IOldImageData) => IOldImageData;
|
|
export default _default;
|