import { State } from 'dua/types'; import { FormInstance } from 'antd/es/form'; import { QueryData } from '@/common/types/query'; // 区域状态 export enum AreaState { CLOSE = 0, // 未开通 OPEN = 1, // 开通 SOME_PAUSE = 2, // 部分暂停 ALL_PAUSE = 4, // 全部暂停 EXPRIING = 8, // 临近到期 STOP = 16, // 停止服务 ALL_PAUSE_EXPRIING = 12, // 全部暂停+临近到期 SOME_PAUSE_EXPRIING = 10 // 部分暂停+临近到期 } // 设防状态 export enum ArmedState { NO_ARMED = 0, // 未设防 ARMED = 1, // 设防 SOME_ARMED = 2 // 部分设防 } // 缴费状态 export enum PayState { NO_PAY = 0, PAY = 1, ARREARS = 2 // 欠费 } // 联系人 export interface Contact { id: number; name: string; // 联系电话 contact: string; // 职位 userPosition: string; // 描述 description: string; // 排序号 sortNo: number; } // 安防任务 export interface SecuritySchedule { id: number; // 父节点ID parentIds: string[]; spaceId: string; // 父节点空间ID数组 parentSpaceIds: string[]; // 商户ID merchantId: number; // 应用ID appId: number; // 区域名称 name: string; // 地址 address: string; // 区域图片 areaImgs: { url?: string }[]; // 平面图 floorImgs: { url?: string }[]; // 区域状态 areaState: AreaState; // 设防状态 armedState: ArmedState; // 缴费状态 payState: PayState; // 服务起止时间 startTime: number; expiryTime: number; // 描述 description: string; // 服务时长 duration: number; leftDays: number; // 经纬度 lnglat: number[]; // 创建时间 createdTime: number; // 修改时间 updatedTime: number; // 标签 tags: string[]; // 位置信息 location: string; // 联系人 contacts: Partial[]; } // 安防区域 export interface SecurityArea { // 应用ID appId: number; // 区域名称 name: string; // 地址 address: string; // 区域图片 areaImgs: { url?: string }[]; // 描述 description: string; // 经纬度 lnglat: number[]; // 位置信息 location: string; // 联系人 contacts: Partial[]; } // 区域树 export interface AreaTree { id: number; areaId: string; // 父节点空间ID数组 parentSpaceIds: string[]; // 区域名称 name: string; // 设防状态 armedState: ArmedState; areaImgs: { url?: string }[]; // 创建时间 createdTime: number; // 修改时间 updatedTime: number; } export interface UserRole { // 角色id id: string; // 角色名称 name: string; } export enum UserTagType { USER = 'user', ADMIN = 'admin' } // 用户信息 export interface User { id: string; // 头像 avatar: string; // 姓名 nickname: string; mobile: string; gender: number; // 工号 empno: string; // 用户标签 userTag: UserTagType; // 所属防区 areaName: string; // 角色 roles: UserRole[]; // 权限等级 permissionLevel: number; // 状态 (true 无效 false-有效) isDisabled: boolean; // 入驻时间 createdTime: number; // 有效时间 expiryTime: number; } export const NodeType = { AREA: 'area', DEFENCE: 'defence', CHILD_DEFENCE: 'child_defence' }; export interface BaseInfo { id?: string; name?: string; spaceId?: string; parentSpaceIds?: string[]; type?: keyof typeof NodeType; parentIds?: string[]; createdTime?: number; updatedTime?: number; armedState?: number; areaImgs?: { url?: string }[]; floorImgs?: { url?: string }[]; children?: any; enabled?: boolean; [key: string]: any; } export enum TransferType { devices = 'device', vehicle = 'vehicle', person = 'person', org = 'org' } export interface TransferData { oldSpaceIds: string[]; spaceIds: string[]; ids: string[]; type: TransferType; } export type DefenceAreaState = State; export interface PluginProps { data?: BaseInfo; form: FormInstance; } export interface Plugin { [key: string]: React.FC; } export interface QueryDevicesData extends QueryData { domain?: string[] | string; spaceId?: string; spaceFilter?: string; spaceIds?: string[]; spaceIdsFilter?: string; type?: string[]; category?: string[]; } export const DeviceFilterType = { NOT_IN_ALL_TREES: '3', // 不在任意节点 NOT_IN: '2', // 不在当前节点 CONTAIN: '1', // 此节点及其子节点 ONLY: '0' // 只在此此节点上 }; export interface BindDevicesParams { // 设备ids ids: string[]; // 空间ids [id, ...parentIds] spaceIds: string[]; }