import { FirmwareItem } from "../firmware/interface"; import { Column } from "../shared/Column"; import { PaginationProps } from "../shared/Pagination"; import { SelectItem } from "../shared/SelectItem"; import { TemplateItem, VariableItem } from "../template/interface"; /** * 设备对象 */ export interface BoxItem { /** id */ id?: string; /** 别名 */ alias?: string; /** 序列号 */ boxNo?: string; /** * 连接状态 * 0:未知 1:在线 2:超时 3:离线 */ connectionState?: number; /** * 盒子类型 * 0:FBox 1:FBox-Mini 2:FBox-Lite 3:FBox-Vpn 4:FBox-Lite_T 5:FLink 6:FL3 7:FBox-Lite 8:HMI 16:NBIot */ boxType?: number; /** * 连接模式 * 0:MQTT 1:USB 2:Tcp */ comMode?: number; /** * 网络类型 * 0:未知 1:以太网 2:2G 3:3G 4:Wifi 5:4G */ networkType?: number; /** * 模板状态 * 0:未下发 1:正在下发 2:下发完成 3:下发失败 */ templateState?: number; /** * 关联模板对象 */ template?: TemplateItem; /** 硬件ID */ hardwareId?: string; /** 硬件密码 */ password?: string; /** 添加密码 */ userPassword?: string; /** 标签 */ tags?: string; /** 最后离线时间 */ lastOffline?: string; /** 最后在线时间 */ lastOnline?: string; /** IP地址 */ natIp?: string; /** 是否同步 */ isSynced?: boolean; /** 星标 */ favorite?: boolean; } /** * 设备详情对象 */ export interface BoxDetailItem { /** 盒子Id */ id?: string; /** 盒子序列号 */ boxNo?: string; /** 添加密码 */ userPassword?: string; /** 盒子类型 */ boxType?: number; /** * 子类型 * 1.Ethernet 2.2G 3.3G 4.wifi 5.4G 7.4GR 8.5G */ subType?: number; /** * 当前上网方式 * 0:未知 1.Ethernet 2.2G 3.3G 4.Wifi 5.4G */ currentNetwork?: number; /** 连接状态 */ connectionState?: number; /** 信号强度 */ signal?: number; /** ICCID */ iccid?: string; /** IMEI */ imei?: string; /** 监控点推送状态 */ enableItemPush?: number; /** 报警推送状态 */ enableAlarmPush?: number; /** 固件版本 */ softVer?: BoxVersionItem; /** */ netMode?: BoxNetworkModeItem; /** WAN口配置对象 */ wan?: BoxNetworkItem; /** GPRS网络信息 */ gprs?: BoxNetworkItem; /** WIFI网络配置 */ wifi?: BoxNetworkItem; /** Apn配置对象 */ apn?: BoxApnItem; /** 连接配置对象 */ connection?: BoxConnectionItem; /** 时间配置对象 */ time?: BoxTimeItem; } /** * 设备更新对象 */ export interface BoxUpdateItem { alias?: string; tags?: string; } /** * 设备审计对象 */ export interface BoxAuditItem { /** id */ id?: string; /** * 类型 * 0:全部 1:模板下发 2:固件升级 3:网络设置 4:更新时钟 5:设置APN */ type?: number; /** 操作时间 */ creationTime?: string; /** 操作内容 */ content?: string; /** 操作员 */ creator?: string; } /** * 设备日志对象 */ export interface BoxLogItem { action?: number; timestamp?: string; } /** * 固件升级对象 */ export interface BoxFirmwareItem { /** 盒子Id列表 */ boxIds?: string[]; /** 固件对象 */ firmware?: FirmwareItem; } /** 设备任务对象 */ export interface BoxJobItem { /** id */ id?: string; /** * 任务类型 * 1:模板下发 2:固件下发 */ type?: number; /** 设备序列号 */ boxNo?: string; /** * 任务状态 * 1:正在下发 2:下发完成 3:下发失败 */ state?: number; /** 错误码 */ code?: number; /** 错误消息 */ msg?: string; /** 任务进度百分比 */ progress?: number; /** 任务步骤数 */ steps?: number; /** 任务创建时间 */ creationTime?: string; } /** VPN对象 */ export interface BoxVpnItem { /** 客户端状态 */ clientStatus?: number; /** 盒子状态 */ boxStatus?: number; /** PLC状态 */ plcStatus?: number; /** 连接状态描述 */ connectStatus?: string; /** 网关 */ gateway?: string; /** 子网掩码 */ subnetMask?: string; /** 日志 */ logs?: string[]; } /** 连接配置 */ export interface BoxConnectionItem { /** * 连接模式 * mqtt, tcp */ mode?: string; /** 服务器地址 */ server?: string; /** * MQTT协议版本号 * 3.1, 3.1.1 */ mqttVersion?: string; /** * 证书类型 * 0:CA signed 1:self signed */ crtType?: number; /** CA证书内容 */ caCrt?: string; /** CA证书名称(显示字段) */ caCrtName?: string; /** 客户端证书内容 */ clientCrt?: string; /** 客户端证书名称(显示字段) */ clientCrtName?: string; /** 客户端证书Key */ clientKey?: string; /** 客户端证书Key名称(显示字段) */ clientKeyName?: string; /** 心跳周期(单位: 秒) */ keepAlive?: number; /** 连接超时时间(单位: 秒) */ connectTimeout?: number; /** 清理会话 */ cleansession?: number; /** 是否连接成功标记 */ connectStatus?: boolean; } /** 网络模式配置 */ export interface BoxNetworkModeItem { networkMode?: number; } /** 网卡配置 */ export interface BoxNetworkItem { /** * 网卡类型(1.Ethernet 2.2G 3.3G 4.Wifi 5.4G) */ networkType?: number; /** * IP类型 * 0:DHCP 1:静态IP */ ipSource?: number; /** IP地址 */ ipAddr?: string; /** 子网掩码 */ subnetMask?: string; /** 网关 */ gateway?: string; /** 主DNS */ dns1?: string; /** 从DNS */ dns2?: string; /** LAN IP */ lanIp?: string; /** 其它网卡参数 */ extra?: { lanIp?: string; lanEnable?: boolean; ssid?: string; password?: string; }; } /** 时区配置 */ export interface BoxTimeItem { /** 时区 */ timezone?: string; /** 时钟服务器 */ ntpserver?: string; /** 当前日期 */ dateTime?: moment.Moment; } /** APN配置 */ export interface BoxApnItem { /** APN */ apn?: string; /** 拨号号码(繁易物联网卡不支持拨号) */ dialing?: string; /** 用户名 */ userName?: string; /** 密码 */ password?: string; } /** 盒子扫描的WIFI信息 */ export interface BoxWifiItem { /** wifi名称 */ apName?: string; /** 信号 */ signalLevel?: number; } /** 盒子版本号信息 */ export interface BoxVersionItem { /** fcs版本 */ fcs?: string; /** fds版本 */ floader?: string; /** fds版本 */ fds?: string; /** FGUI版本 */ fgui?: string; /** Boot文件版本 */ boot?: string; /** 内核版本 */ kernel?: string; /** 文件系统版本 */ rootfs?: string; /** 硬件版本号 */ hardware?: string; /** 盒子类型 */ boxType?: number; } export interface BoxFirmwareProps { boxes?: BoxItem[]; formResult?: boolean; /** * schema: (result: boolean) => void */ onFormValidate?: (result: boolean) => void; /** * schema: (item: BoxFirmwareItem) => void */ onFormSubmit?: (item: BoxFirmwareItem) => void; } export interface BoxFirmwareModalProps { visible?: boolean; boxItems?: BoxItem[]; onVisibleChange?: (visible: boolean) => void; onFirmwareUpdate?: (item: BoxFirmwareItem) => void; } export interface BoxTableProps { columns?: Column[]; data?: BoxItem[]; pagination?: PaginationProps; selectable?: boolean; selectionType?: 'checkbox' | 'radio'; onMenuItemClick?: (key: string, item: BoxItem) => void; /** * schema: (items: BoxItem[]) => void */ onSelect?: (items: BoxItem[]) => void; /** * schema: (item: BoxItem) => void */ onDetailShow?: (item: BoxItem) => void; /** * schema: (item: BoxItem) => void */ onContact?: (item: BoxItem) => void; /** * schema: (item: BoxItem) => void */ onDelete?: (item: BoxItem) => void; /** * schema: (item: BoxItem, edit: { alias?: string, tags?: string }) => void */ onEdit?: (item: BoxItem, edit: { alias?: string; tags?: string; }) => void; /** * schema: (item: BoxItem) => void */ onVpnModalShow?: (item: BoxItem) => void; } export interface BoxSearchItem { keyword?: string; connectionState?: number; templateState?: number; remark?: string; templateName?: string; boxType?: number[]; } export interface BoxToolbarProps { showConnectionStates?: boolean; connectionStates?: SelectItem[]; showTemplateStates?: boolean; templateStates?: SelectItem[]; showRemark?: boolean; showFilter?: boolean; showImport?: boolean; showOperations?: boolean; /** * schema: (args: BoxSearchItem) => void */ onSearch?: (args: BoxSearchItem) => void; /** * schema: () => void */ onImport?: () => void; /** * schema: () => void */ onFirmwareUpgrade?: () => void; /** * schema: () => void */ onTemplateUpdate?: () => void; /** * schema: () => void */ onBatchRetry?: () => void; onMenuItemClick?: (key: string) => void; } /** * 设备通信模式 * 0: MQTT * 1: USB * 2: Tcp */ export declare type BoxComMode = 0 | 1 | 2; export interface BoxImportSearchItem { importType: BoxImportType; ip?: string; boxNo?: string; userPassword?: string; } export interface BoxImportProps { data?: BoxItem[]; formResult?: boolean; templateUrl?: string; importTypes?: SelectItem[]; /** * 点击确定导入按钮时触发 * schema: (items: BoxItem[], mode: BoxComMode) => void */ onImport?: (items: BoxItem[], mode: BoxComMode) => void; /** * 点击搜索按钮时触发 */ onSearch?: (searchItem: BoxImportSearchItem) => void; /** * 当选择文件时触发 */ onFileSelect?: (items: BoxItem[]) => void; /** * 变更类型时触发 */ onTypeChange?: (importType: BoxImportType) => void; /** * 选中条目时触发 */ onChange?: (items: BoxItem[]) => void; } export interface BoxImportModalProps extends Pick { visible?: boolean; boxItems?: BoxItem[]; importTypes?: SelectItem[]; onVisibleChange?: (visible: boolean) => void; } export interface BoxDetailProps { /** 设备信息 */ boxItem?: BoxItem; /** 实时数据 */ values?: any; /** 数据获取模式 */ valueMode?: 'pull' | 'push'; /** 固定头部样式 */ fixedStyle?: any; /** 隐藏选项卡 */ hideTabs?: string[]; /** 盒子详情加载 */ onBoxDetailLoad?: (item: BoxItem, fromBox: boolean) => Promise; /** 模板加载 */ onBoxTemplateLoad?: (item: BoxItem, fromBox: boolean) => Promise; /** 升级日志列表加载 */ onBoxAuditListLoad?: (item: BoxItem, skip: number, args?: any) => Promise<{ items: BoxAuditItem[]; totalCount: number; }>; /** 日志列表加载 */ onBoxLogListLoad?: (item: BoxItem, skip: number, args?: any) => Promise<{ items: BoxLogItem[]; totalCount: number; }>; onBoxWifiLoad?: (item: BoxItem) => Promise; /** 获取值 */ onBoxValueRead?: (item: BoxItem, names: string[]) => Promise; /** 写值 */ onBoxValueWrite?: (item: BoxItem, values: any[]) => Promise; onBoxValueSubscribe?: (item: BoxItem, subState: boolean) => Promise; onBoxNetworkModeUpdate?: (items: BoxItem[], networkMode: BoxNetworkModeItem) => Promise; onBoxNetworkUpdate?: (items: BoxItem[], network: BoxNetworkItem) => Promise; onBoxApnUpdate?: (items: BoxItem[], apn: BoxApnItem) => Promise; onBoxConnectionUpdate?: (items: BoxItem[], conn: BoxConnectionItem) => Promise; onBoxTimeUpdate?: (items: BoxItem[], time: BoxTimeItem) => Promise; /** 开启/关闭监控点推送 */ onBoxVariablePushChange?: (boxItems: BoxItem[], status: BoxPushStatus) => Promise; /** 开启/关闭报警推送 */ onBoxAlarmPushChange?: (boxItems: BoxItem[], status: BoxPushStatus) => Promise; /** 重启设备 */ onBoxReboot?: (items: BoxItem[]) => Promise; } export interface BoxStateItem { id: string; connectionState: number; } export declare type BoxPushType = 'all' | 'variable' | 'alarm'; export declare type BoxPushStatus = 0 | 1; export interface BoxUpgradeItem { progress?: number; steps?: number; step?: number; code?: number; title?: string; boxNo?: string; } export interface BoxUpgradeProps { visible?: boolean; item?: BoxUpgradeItem; onOk?: () => void; } export interface BoxErrorItem { code: number; boxNo?: string; msg?: string; } export interface BoxRebootItem { waitTimeout?: number; force?: boolean; } export interface BoxProps extends Pick { listType?: 'table' | 'list'; importTypes?: number[]; boxStateItem?: BoxStateItem; boxJobProgressItem?: BoxJobProgressItem; boxFoundItem?: BoxItem; boxValueItems?: any; boxErrorItem?: BoxErrorItem; boxUpgradeItem?: BoxUpgradeItem; /** * 盒子列表加载时触发 */ onBoxListLoad?: (skip: number, take: number, args?: BoxSearchItem) => Promise<{ items: BoxItem[]; totalCount: number; }>; /** * 通过标签加载盒子信息 */ onBoxTagLoad?: (boxNo: string, userPassword: string) => Promise; onBoxUsbLoad?: () => Promise; onBoxTcpLoad?: (ip: string) => Promise; onBoxTcpScan?: () => Promise; onBoxSelect?: (item?: BoxItem) => void; onBoxFavorite?: (item: BoxItem, favorite: boolean) => Promise; /** * 导入盒子 */ onBoxImport?: (items: BoxItem[]) => Promise<{ ignored: BoxItem[]; }>; onBoxDelete?: (items: BoxItem[]) => Promise; onBoxReboot?: (items: BoxItem[], reboot?: BoxRebootItem) => Promise; onBoxFirmwareUpdate?: (items: BoxItem[], firmwareItem: BoxFirmwareItem) => Promise; onBoxOldFirmwareUpdate?: (items: BoxItem[]) => Promise; onBoxClean?: (items: BoxItem[]) => Promise; onBoxUpdate?: (items: BoxItem[], updateItem: BoxUpdateItem) => Promise; onTemplateListLoad?: (skip: number, args?: any) => Promise<{ items: TemplateItem[]; totalCount: number; }>; onTemplateApply?: (templateItem: TemplateItem, items: BoxItem[], modules: string[]) => Promise; onJobListLoad?: (skip: number, take: number, args?: any) => Promise<{ items: BoxJobItem[]; totalCount: number; }>; onJobStateLoad?: (state: number) => Promise; onBoxNatIpUpdate?: (item: BoxItem, natIp: boolean | string) => Promise; } export interface BoxJobProps { columns?: Column[]; data?: BoxJobItem[]; pagination?: PaginationProps; options?: Array; state?: number; size?: 'small' | 'middle' | 'large' | undefined; /** * schema: (args: { state?: number }) => void */ onSearch?: (args: { state: number; }) => void; } export interface BoxJobStateItem { state?: number; count?: number; default?: boolean; } export interface BoxJobProgressItem { id: string; code: number; progress: number; visible?: boolean; } export interface BoxJobListProps extends Pick { states?: BoxJobStateItem[]; progressItem?: BoxJobProgressItem; onItemLoad?: (skip: number, take: number, args?: { state: number; }) => Promise<{ items: BoxJobItem[]; totalCount: number; }>; } export interface BoxJobListModalProps extends BoxJobListProps { visible?: boolean; onVisibleChange?: (visible: boolean) => void; } export interface BoxTunnelVpnProps { item?: BoxVpnItem; /** * schema: (item: BoxVpnItem) => void */ onConnect?: (item: BoxVpnItem) => void; /** * schema: () => void */ onDisconnect?: () => void; /** * schema: (plcIp: string) => void */ onPlcCheck?: (plcIp: string) => void; } /** * 盒子发现类别 * 0: USB * 1: 广播 * 2: 固定IP * 3: 文件 */ export declare type BoxImportType = 0 | 1 | 2 | 3 | 4; /** * 盒子发现组件 */ export interface BoxDiscoveryProps { visible?: boolean; discoveryItems?: BoxItem[]; onBoxDiscover?: (type: BoxImportType) => void; onBoxSelect?: (items: BoxItem[]) => void; onCancel?: () => void; } /** * 设备列表组件 */ export interface BoxListProps { data?: BoxItem[]; defaultIndex?: number; selectable?: boolean; selectionType?: 'checkbox' | 'radio'; checkAll?: boolean; checkedItems?: BoxItem[]; onImport?: () => void; onSelect?: (item?: BoxItem) => void; onCheck?: (items: BoxItem[]) => void; onMenuItemClick?: (key: string, item: BoxItem) => void; onFavorite?: (item: BoxItem, favorite: boolean) => void; } export interface BoxDetailVariableProps { boxItem?: BoxItem; detailItem?: BoxDetailItem; values?: any; contactTemplate?: TemplateItem; pagination?: PaginationProps; onValueSet?: (variable: VariableItem, value: any) => void; onVariablePushStatusChange?: (status: BoxPushStatus) => void; onVariableSearch?: (args: { status?: number; deviceId?: string; description?: string; }) => void; } export interface BoxDetailAlarmProps { detailItem?: BoxDetailItem; contactTemplate?: TemplateItem; onAlarmPushStatusChange?: (status: BoxPushStatus) => void; } export interface BoxDetailMacroProps { item?: BoxItem; detailItem?: BoxDetailItem; contactTemplate?: TemplateItem; } export interface BoxDetailTransferProps { item?: BoxItem; detailItem?: BoxDetailItem; contactTemplate?: TemplateItem; } export interface BoxDetailPlcProps { item?: BoxItem; detailItem?: BoxDetailItem; contactTemplate?: TemplateItem; } export interface BoxDetailAuditProps { data?: BoxAuditItem[]; pagination?: PaginationProps; toolbar?: boolean; boxNo?: string; onSearch?: (args: { type?: number; }) => void; } export interface BoxDetailBasicProps { detailItem?: BoxDetailItem; wifiItems?: BoxWifiItem[]; onWifiScan?: () => Promise; onNetworkModeUpdate?: (item: BoxNetworkModeItem) => void; onNetworkUpdate?: (item: BoxNetworkItem) => void; onApnUpdate?: (item: BoxApnItem) => void; onConnectionUpdate?: (item: BoxConnectionItem) => void; onTimeUpdate?: (item: BoxTimeItem) => void; } export interface BoxDetailLogProps { data?: BoxLogItem[]; pagination?: PaginationProps; } export interface BoxDetailStatusProps { detailItem?: BoxDetailItem; } export interface BoxDetailAdvanceProps { detailItem?: BoxDetailItem; onItemClick?: (itemKey: string) => void; } export interface BoxDetailTemplateProps extends Pick, Pick { /** 模板对象 */ template?: TemplateItem; detailItem?: BoxDetailItem; /** 变量实时数据 */ variableValues?: any; variablePagination?: PaginationProps; activeKey?: string; onTabChange?: (activeKey: string) => void; onDestory?: () => void; } export interface BoxEditModalProps { visible?: boolean; editItem?: BoxItem; onVisibleChange?: (visible: boolean) => void; onFinish?: (editItem: BoxItem, updateItem: BoxUpdateItem) => void; } export interface BoxContactProps { data?: TemplateItem[]; pagination?: PaginationProps; size?: 'small' | 'middle' | 'large'; onSelect?: (items: TemplateItem[]) => void; onSearch?: (args: { name?: string; remark?: string; }) => void; } export interface BoxContactModalProps { visible?: boolean; boxItems?: BoxItem[]; templateItems?: TemplateItem[]; templateTotal?: number; onVisibleChange?: (visible: boolean) => void; onContact?: (boxItems: BoxItem[], template: TemplateItem, modules: string[]) => void; onChange?: (skip: number, arg?: { name?: string; remark?: string; }) => void; } export interface BoxDetailConnectionProps { editItem?: BoxConnectionItem; formResult?: boolean; title?: boolean; colSpan?: number; disabled?: boolean; onSave?: (item: BoxConnectionItem) => void; onFormValidate?: (result: boolean) => void; } export interface BoxDetailConnectionModalProps extends Pick { visible?: boolean; onVisibleChange?: (visible: boolean) => void; } export interface BoxDetailTimeProps { editItem?: BoxTimeItem; formResult?: boolean; title?: boolean; colSpan?: number; disabled?: boolean; onSave?: (item: BoxTimeItem) => void; } export interface BoxDetailTimeModalProps extends Pick { visible?: boolean; onVisibleChange?: (visible: boolean) => void; }