Files
ndm-web-platform/src/apis/domain/biz/station/device.ts
yangsy fd7f1927ff feat: 设备关联与解除关联
- 支持配置交换机端口的下游关联设备
- 支持配置安防箱电路的下游关联设备
- 支持解除关联
- 删除设备时校验是否存在上/下游设备
2025-12-26 18:14:54 +08:00

50 lines
1.5 KiB
TypeScript

import type {
NdmAlarmHostResultVO,
NdmCameraResultVO,
NdmDecoderResultVO,
NdmKeyboardResultVO,
NdmMediaServerResultVO,
NdmNvrResultVO,
NdmSecurityBoxResultVO,
NdmSwitchResultVO,
NdmVideoServerResultVO,
Station,
} from '@/apis';
import { DEVICE_TYPE_LITERALS, type DeviceType } from '@/enums';
export interface DeviceStoreIndex {
stationCode: Station['code'];
deviceType: DeviceType;
deviceDbId: string;
}
export interface StationDevices {
[DEVICE_TYPE_LITERALS.ndmAlarmHost]: NdmAlarmHostResultVO[];
[DEVICE_TYPE_LITERALS.ndmCamera]: NdmCameraResultVO[];
[DEVICE_TYPE_LITERALS.ndmDecoder]: NdmDecoderResultVO[];
[DEVICE_TYPE_LITERALS.ndmKeyboard]: NdmKeyboardResultVO[];
[DEVICE_TYPE_LITERALS.ndmMediaServer]: NdmMediaServerResultVO[];
[DEVICE_TYPE_LITERALS.ndmNvr]: NdmNvrResultVO[];
[DEVICE_TYPE_LITERALS.ndmSecurityBox]: NdmSecurityBoxResultVO[];
[DEVICE_TYPE_LITERALS.ndmSwitch]: NdmSwitchResultVO[];
[DEVICE_TYPE_LITERALS.ndmVideoServer]: NdmVideoServerResultVO[];
}
export interface LineDevices {
[stationCode: Station['code']]: StationDevices;
}
export const initStationDevices = (): StationDevices => {
return {
[DEVICE_TYPE_LITERALS.ndmAlarmHost]: [],
[DEVICE_TYPE_LITERALS.ndmCamera]: [],
[DEVICE_TYPE_LITERALS.ndmDecoder]: [],
[DEVICE_TYPE_LITERALS.ndmKeyboard]: [],
[DEVICE_TYPE_LITERALS.ndmMediaServer]: [],
[DEVICE_TYPE_LITERALS.ndmNvr]: [],
[DEVICE_TYPE_LITERALS.ndmSecurityBox]: [],
[DEVICE_TYPE_LITERALS.ndmSwitch]: [],
[DEVICE_TYPE_LITERALS.ndmVideoServer]: [],
};
};