import { State } from 'dua/types'; import { PersonnelInfo, VehicleInfo } from './data-assets'; import { NodeConfig, EdgeConfig } from '@antv/g6/es/types'; export const NodeType = { AREA: 'area', VEHICLE: 'vehicle', BUILDING: 'building', FLOOR: 'floor', ROOM: 'room', UNIT: 'unit', DEVICE: 'device', EVENT: 'event', PERSON: 'person', }; export type VisualType = 'face' | 'body' | 'motor' | 'noMotor'; // 摄像机信息 export interface DeviceInfo { sn: string; name?: string; address: string; latitude: number; longitude: number; lng?: number; lat?: number; cid: string; } export interface ItemInfo { // 图库共有字段 device: DeviceInfo; // 所属设备信息 deviceInfo?: DeviceInfo; captureTime: number; imageUrl: string; // 抓拍图片 sceneUrl?: string; // 场景图片 personId?: string; // 人员id faceId?: string; // 人脸id // 人形id humanBodyId?: string; // 机动车和非机动车id motorId?: string; noMotorId?: string; motorVehicleId?: string; nonMotorVehicleId?: string; // 各图库属性字段 attribute?: { [key: string]: any; }; humanBody?: { humanBodyId?: string; // 人体图片 url?: string; // 人体图片对应的url }; // 人体属性 // 人体列表 face?: { personId?: string; url?: string; }; // 机动车特殊字段 plateNo?: string; // 车牌号 threshold?: number; // 相似度 position: any; // 生成的uuid uuid: string; [key: string]: any; } export interface ArchivesInfo { id?: string; images: { url: string }[]; registeredPersonInfo: PersonnelInfo; recentCapture: Capture; firstCapture: Capture; createdTime?: number; updatedTime?: number; } export interface VehicleArchivesInfo { id?: string; images: { url: string }[]; registeredVehicleInfo: VehicleInfo; recentCapture: Capture; firstCapture: Capture; createdTime?: number; updatedTime?: number; } // 穿着特征 export interface Appearance { tag?: string; count?: number; percent?: number; } // interface Location { address: string; lng: number; lat: number; } export interface Capture { time: number; cid: string; location: Location; imageUrl: string; faceId?: string; } export interface ActivityStatistics { timeIndex: number; count: string; } export type FaceState = State; export type BodyState = State; export type VehicleState = State; export type NonVehicleState = State; export type ArchivesState = State; export type VehicleArchivesState = State; export type AppearanceState = State; export type ActivityStatisticsState = State; //关系图谱相关类型 export const Group = { Sensor: 'Sensor', Camera: 'Camera', Device: 'Device', CAMERA: 'CAMERA', GB_CAMERA: 'GB_CAMERA', SENSOR: 'SENSOR', FIRE_HOST: 'FIRE_HOST', Unit: 'Unit', Space: 'Space', Capture: 'Capture', Person: 'Person', Vehicle: 'Vehicle', Area: 'Area', Building: 'Building', Floor: 'Floor', Room: 'Room', Org: 'Org', Merchant: 'Merchant', Alarm: 'Alarm', }; export const GroupData = [ { name: '设备', color: '#41D9C5', type: NodeType.DEVICE, }, { name: '人员', color: '#5591F2', type: NodeType.PERSON, }, { name: '车辆', color: '#9955F2', type: NodeType.VEHICLE, }, { name: '事件', color: '#F2555F', type: NodeType.EVENT, }, { name: '区域', color: '#5591F2', type: NodeType.AREA, }, { name: '建筑', color: '#FFC240', type: NodeType.BUILDING, }, { name: '楼层', color: '#FFC240', type: NodeType.FLOOR, }, { name: '房间', color: '#FFC240', type: NodeType.ROOM, }, { name: '单元', color: '#F2944B', type: NodeType.UNIT, }, // { // name: '车辆', // color: '#9955F2', // type: NodeType.VEHICLE // } ]; export const vehicleValue = GroupData.filter( i => ![NodeType.PERSON].includes(i.type), ); export const personValue = GroupData; export type Point = [number, number]; export interface SensorProps { deviceId: string; deviceSN: string; merchantId: string; type: string; category: string; name: string; tags: string[]; lnglat: Point; time: string; } export interface CameraProps { deviceId: string; deviceSN: string; merchantId: string; type: string; category: string; name: string; tags: string[]; lnglat: Point; time: number; } export interface CaptureProps { deviceId: string; lnglat: Point; createdTime: number; personId: string; vehicleId: string; } export interface PersonProps { personId: string; merchantId: string; name: string; contact: string; gender: string; faceId: string; image: string; } export interface ContactProps { name: string; contact: string; } export interface VehicleProps { vehicleId: string; merchantId: string; brand: string; type: string; spaceIds: string[]; } export type GroupType = keyof typeof Group; export interface Node { id: number; group: GroupType; properties: | SensorProps | CameraProps | CaptureProps | PersonProps | ContactProps | VehicleProps; } export interface Edge { start: number; end: number; group: GroupType; properties: { createdTime: number; deviceSN: string; virtualPersonId: string; }; } export interface GraphNode extends NodeConfig {} export interface GraphEdge extends EdgeConfig {} // 播放状态 export type PlayType = 'init' | 'finish' | 'stop' | 'playing'; // 室内轨迹 export interface ImageSize { width: number; height: number; } // 单个平面图数据 export interface FloorImage { id: string; url: string; }