refactor: 重构项目结构

- 优化 `车站-设备-告警`  轮询机制
- 改进设备卡片的布局
- 支持修改设备
- 告警轮询中获取完整告警数据
- 车站告警详情支持导出完整的 `今日告警列表`
- 支持将状态持久化到 `IndexedDB`
- 新增轮询控制 (调试模式)
- 新增离线开发模式 (调试模式)
- 新增 `IndexedDB` 数据控制 (调试模式)
This commit is contained in:
yangsy
2025-12-11 13:42:22 +08:00
commit 37781216b2
278 changed files with 17988 additions and 0 deletions

View File

@@ -0,0 +1 @@
export * from './ndm-alarm-host';

View File

@@ -0,0 +1,39 @@
import type { BaseModel, ReduceForPageQuery, ReduceForSaveVO, ReduceForUpdateVO } from '@/apis';
import type { Nullable, Optional } from '@/types';
export interface NdmAlarmHost extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
gbCode: string;
gbPort: number;
gbDomain: string;
gb28181Enabled: boolean;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
}
export type NdmAlarmHostResultVO = Nullable<NdmAlarmHost>;
export type NdmAlarmHostSaveVO = Partial<Omit<NdmAlarmHost, ReduceForSaveVO>>;
export type NdmAlarmHostUpdateVO = Optional<Omit<NdmAlarmHost, ReduceForUpdateVO>>;
export type NdmAlarmHostPageQuery = Partial<Omit<NdmAlarmHost, ReduceForPageQuery>>;

View File

@@ -0,0 +1,11 @@
import type { IcmpEntity } from './icmp-entity';
export interface IcmpEntityResult {
name: string;
ipAddress: string;
stationCode: string;
url: string;
success: boolean;
icmpEntities: IcmpEntity[];
errorMessage: string;
}

View File

@@ -0,0 +1,9 @@
export interface IcmpEntityWithStation {
id: string;
deviceId: string;
name: string;
ipAddress: string;
deviceStatus: string;
deviceType: string;
stationName: string;
}

View File

@@ -0,0 +1,8 @@
export interface IcmpEntity {
id: string;
deviceId: string;
name: string;
ipAddress: string;
deviceStatus: string;
deviceType: string;
}

View File

@@ -0,0 +1,3 @@
export * from './icmp-entity';
export * from './icmp-entity-result';
export * from './icmp-entity-with-station';

View File

@@ -0,0 +1,37 @@
import type { Nullable } from '@/types';
import type { NdmAlarmHost } from './alarm';
import type { NdmSecurityBox, NdmSwitch } from './other';
import type { NdmNvr } from './storage';
import type {
NdmCamera,
NdmDecoder,
NdmKeyboard,
NdmMediaServer,
NdmMediaServerPageQuery,
NdmMediaServerResultVO,
NdmMediaServerSaveVO,
NdmMediaServerUpdateVO,
NdmVideoServer,
NdmVideoServerPageQuery,
NdmVideoServerResultVO,
NdmVideoServerSaveVO,
NdmVideoServerUpdateVO,
} from './video';
export type NdmDevice = NdmAlarmHost | NdmCamera | NdmDecoder | NdmKeyboard | NdmMediaServer | NdmNvr | NdmSecurityBox | NdmSwitch | NdmVideoServer;
export type NdmDeviceResultVO = Nullable<NdmDevice>;
export type NdmServer = NdmMediaServer | NdmVideoServer;
export type NdmServerResultVO = NdmMediaServerResultVO | NdmVideoServerResultVO;
export type NdmServerSaveVO = NdmMediaServerSaveVO | NdmVideoServerSaveVO;
export type NdmServerUpdateVO = NdmMediaServerUpdateVO | NdmVideoServerUpdateVO;
export type NdmServerPageQuery = NdmMediaServerPageQuery | NdmVideoServerPageQuery;
export * from './alarm';
export * from './icmp';
export * from './log';
export * from './other';
export * from './storage';
export * from './upper-ndm';
export * from './video';

View File

@@ -0,0 +1,6 @@
export * from './ndm-call-log';
export * from './ndm-device-alarm-log';
export * from './ndm-icmp-log';
export * from './ndm-record-check';
export * from './ndm-snmp-log';
export * from './ndm-vimp-log';

View File

@@ -0,0 +1,18 @@
import type { BaseModel, ReduceForPageQuery, ReduceForSaveVO, ReduceForUpdateVO } from '@/apis';
import type { Nullable } from '@/types';
export interface NdmCallLog extends BaseModel {
sourceGbId: string;
targetGbId: string;
method: string;
messageType: string;
cmdType: string;
}
export type NdmCallLogResultVO = Nullable<NdmCallLog>;
export type NdmCallLogSaveVO = Partial<Omit<NdmCallLog, ReduceForSaveVO>>;
export type NdmCallLogUpdateVO = Partial<Omit<NdmCallLog, ReduceForUpdateVO>>;
export type NdmCallLogPageQuery = Partial<Omit<NdmCallLog, ReduceForPageQuery>>;

View File

@@ -0,0 +1,28 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable } from '@/types';
export interface NdmDeviceAlarmLog extends BaseModel {
alarmNo: string;
alarmDate: string;
faultLocation: string;
faultDescription: string;
faultLevel: string;
faultCode: string;
deviceId: string;
deviceName: string;
alarmCategory: string;
alarmConfirm: string;
alarmRepairSuggestion: string;
impactService: string;
alarmType: string;
deviceType: string;
stationCode: string;
}
export type NdmDeviceAlarmLogResultVO = Nullable<NdmDeviceAlarmLog>;
export type NdmDeviceAlarmLogSaveVO = Partial<Omit<NdmDeviceAlarmLog, ReduceForSaveVO>>;
export type NdmDeviceAlarmLogUpdateVO = Partial<Omit<NdmDeviceAlarmLog, ReduceForUpdateVO>>;
export type NdmDeviceAlarmLogPageQuery = Partial<Omit<NdmDeviceAlarmLog, ReduceForPageQuery>>;

View File

@@ -0,0 +1,17 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable } from '@/types';
export interface NdmIcmpLog extends BaseModel {
deviceId: string;
name: string;
ipAddress: string;
deviceStatus: string;
}
export type NdmIcmpLogResultVO = Nullable<NdmIcmpLog>;
export type NdmIcmpLogSaveVO = Partial<Omit<NdmIcmpLog, ReduceForSaveVO>>;
export type NdmIcmpLogUpdateVO = Partial<Omit<NdmIcmpLog, ReduceForUpdateVO>>;
export type NdmIcmpLogPageQuery = Partial<Omit<NdmIcmpLog, ReduceForPageQuery>>;

View File

@@ -0,0 +1,8 @@
export interface NdmRecordCheck {
gbCode: string;
parentGbCode: string;
name: string;
ipAddress: string;
diagInfo: string;
checkDate: string;
}

View File

@@ -0,0 +1,18 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable } from '@/types';
export interface NdmSnmpLog extends BaseModel {
deviceId: string;
name: string;
ipAddress: string;
diagInfo: string;
deviceType: string;
}
export type NdmSnmpLogResultVO = Nullable<NdmSnmpLog>;
export type NdmSnmpLogSaveVO = Partial<Omit<NdmSnmpLog, ReduceForSaveVO>>;
export type NdmSnmpLogUpdateVO = Partial<Omit<NdmSnmpLog, ReduceForUpdateVO>>;
export type NdmSnmpLogPageQuery = Partial<Omit<NdmSnmpLog, ReduceForPageQuery>>;

View File

@@ -0,0 +1,26 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable } from '@/types';
export interface NdmVimpLog extends BaseModel {
requestIp: string;
description: string;
classPath: string;
methodName: string;
startTime: string;
endTime: string;
consumedTime: string;
params: string;
result: string;
httpMethod: string;
userId: string;
logType: number;
targetCode: string;
}
export type NdmVimpLogResultVO = Nullable<NdmVimpLog>;
export type NdmVimpLogSaveVO = Partial<Omit<NdmVimpLog, ReduceForSaveVO>>;
export type NdmVimpLogUpdateVO = Partial<Omit<NdmVimpLog, ReduceForUpdateVO>>;
export type NdmVimpLogPageQuery = Partial<Omit<NdmVimpLog, ReduceForPageQuery>>;

View File

@@ -0,0 +1,2 @@
export * from './ndm-security-box';
export * from './ndm-switch';

View File

@@ -0,0 +1,35 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable, Optional } from '@/types';
export interface NdmSecurityBox extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
}
export type NdmSecurityBoxResultVO = Nullable<NdmSecurityBox>;
export type NdmSecurityBoxSaveVO = Partial<Omit<NdmSecurityBox, ReduceForSaveVO>>;
export type NdmSecurityBoxUpdateVO = Optional<Omit<NdmSecurityBox, ReduceForUpdateVO>>;
export type NdmSecurityBoxPageQuery = Partial<Omit<NdmSecurityBox, ReduceForPageQuery>>;

View File

@@ -0,0 +1,35 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable, Optional } from '@/types';
export interface NdmSwitch extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
}
export type NdmSwitchResultVO = Nullable<NdmSwitch>;
export type NdmSwitchSaveVO = Partial<Omit<NdmSwitch, ReduceForSaveVO>>;
export type NdmSwitchUpdateVO = Optional<Omit<NdmSwitch, ReduceForUpdateVO>>;
export type NdmSwitchPageQuery = Partial<Omit<NdmSwitch, ReduceForPageQuery>>;

View File

@@ -0,0 +1 @@
export * from './ndm-nvr';

View File

@@ -0,0 +1,46 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable, Optional } from '@/types';
export interface NdmNvr extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
gbCode: string;
gbPort: number;
gbDomain: string;
gb28181Enabled: boolean;
onvifPort: number;
onvifUsername: string;
onvifPassword: string;
onvifMajorIndex: number;
onvifMinorIndex: number;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
recordCheckEnabled: boolean;
clusterList: string;
}
export type NdmNvrResultVO = Nullable<NdmNvr>;
export type NdmNvrSaveVO = Partial<Omit<NdmNvr, ReduceForSaveVO>>;
export type NdmNvrUpdateVO = Optional<Omit<NdmNvr, ReduceForUpdateVO>>;
export type NdmNvrPageQuery = Partial<Omit<NdmNvr, ReduceForPageQuery>>;

View File

@@ -0,0 +1,2 @@
export * from './sync-camera-result';
export * from './sync-camera-result-detail';

View File

@@ -0,0 +1,6 @@
export interface SyncCameraResultDetail {
name: string;
deviceId: string;
ipAddress: string;
gbCode: string;
}

View File

@@ -0,0 +1,10 @@
import type { SyncCameraResultDetail } from './sync-camera-result-detail';
export interface SyncCameraResult {
stationCode: string;
startTime: string;
endTime: string;
insertList: SyncCameraResultDetail[];
updateList: SyncCameraResultDetail[];
deleteList: SyncCameraResultDetail[];
}

View File

@@ -0,0 +1,6 @@
export * from './ndm-camera';
export * from './ndm-camera-ignore';
export * from './ndm-decoder';
export * from './ndm-keyboard';
export * from './ndm-media-server';
export * from './ndm-video-server';

View File

@@ -0,0 +1,14 @@
import type { BaseModel, ReduceForPageQuery, ReduceForSaveVO, ReduceForUpdateVO } from '@/apis';
export interface NdmCameraIgnore extends BaseModel {
deviceId: string;
ignoreType: string;
}
export type NdmCameraIgnoreResultVO = Partial<NdmCameraIgnore>;
export type NdmCameraIgnoreSaveVO = Partial<Omit<NdmCameraIgnore, ReduceForSaveVO>>;
export type NdmCameraIgnoreUpdateVO = Partial<Omit<NdmCameraIgnore, ReduceForUpdateVO>>;
export type NdmCameraIgnorePageQuery = Partial<Omit<NdmCameraIgnore, ReduceForPageQuery>>;

View File

@@ -0,0 +1,45 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable, Optional } from '@/types';
export interface NdmCamera extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
gbCode: string;
gbPort: number;
gbDomain: string;
gb28181Enabled: boolean;
onvifPort: number;
onvifUsername: string;
onvifPassword: string;
onvifMajorIndex: number;
onvifMinorIndex: number;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
cameraType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
}
export type NdmCameraResultVO = Nullable<NdmCamera>;
export type NdmCameraSaveVO = Partial<Omit<NdmCamera, ReduceForSaveVO>>;
export type NdmCameraUpdateVO = Optional<Omit<NdmCamera, ReduceForUpdateVO>>;
export type NdmCameraPageQuery = Partial<Omit<NdmCamera, ReduceForPageQuery>>;

View File

@@ -0,0 +1,42 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable, Optional } from '@/types';
export interface NdmDecoder extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
gbCode: string;
gbPort: number;
gbDomain: string;
gb28181Enabled: boolean;
onvifPort: number;
onvifUsername: string;
onvifPassword: string;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
}
export type NdmDecoderResultVO = Nullable<NdmDecoder>;
export type NdmDecoderSaveVO = Partial<Omit<NdmDecoder, ReduceForSaveVO>>;
export type NdmDecoderUpdateVO = Optional<Omit<NdmDecoder, ReduceForUpdateVO>>;
export type NdmDecoderPageQuery = Partial<Omit<NdmDecoder, ReduceForPageQuery>>;

View File

@@ -0,0 +1,35 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable, Optional } from '@/types';
export interface NdmKeyboard extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
}
export type NdmKeyboardResultVO = Nullable<NdmKeyboard>;
export type NdmKeyboardSaveVO = Partial<Omit<NdmKeyboard, ReduceForSaveVO>>;
export type NdmKeyboardUpdateVO = Optional<Omit<NdmKeyboard, ReduceForUpdateVO>>;
export type NdmKeyboardPageQuery = Partial<Omit<NdmKeyboard, ReduceForPageQuery>>;

View File

@@ -0,0 +1,39 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable, Optional } from '@/types';
export interface NdmMediaServer extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
gbCode: string;
gbPort: number;
gbDomain: string;
gb28181Enabled: boolean;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
}
export type NdmMediaServerResultVO = Nullable<NdmMediaServer>;
export type NdmMediaServerSaveVO = Partial<Omit<NdmMediaServer, ReduceForSaveVO>>;
export type NdmMediaServerUpdateVO = Optional<Omit<NdmMediaServer, ReduceForUpdateVO>>;
export type NdmMediaServerPageQuery = Partial<Omit<NdmMediaServer, ReduceForPageQuery>>;

View File

@@ -0,0 +1,39 @@
import type { BaseModel, ReduceForSaveVO, ReduceForUpdateVO, ReduceForPageQuery } from '@/apis';
import type { Nullable, Optional } from '@/types';
export interface NdmVideoServer extends BaseModel {
deviceId: string;
name: string;
manufacturer: string;
state: boolean;
model: string;
ipAddress: string;
manageUrl: string;
manageUsername: string;
managePassword: string;
gbCode: string;
gbPort: number;
gbDomain: string;
gb28181Enabled: boolean;
diagFlag: string;
diagParam: string;
diagFormat: string;
lastDiagInfo: string;
lastDiagTime: string;
icmpEnabled: boolean;
description: string;
deviceStatus: string;
deviceType: string;
community: string;
frontendConfig: string;
linkDescription: string;
snmpEnabled: boolean;
}
export type NdmVideoServerResultVO = Nullable<NdmVideoServer>;
export type NdmVideoServerSaveVO = Partial<Omit<NdmVideoServer, ReduceForSaveVO>>;
export type NdmVideoServerUpdateVO = Optional<Omit<NdmVideoServer, ReduceForUpdateVO>>;
export type NdmVideoServerPageQuery = Partial<Omit<NdmVideoServer, ReduceForPageQuery>>;