export interface FaultTraceQuery {
    pageNum?: number;
    pageSize?: number;
    startDate?: string; // 'YYYY-MM-DD' or ISO
    endDate?: string;
    deviceModeId?: number;
    machineCode?: string;
    faultType?: string;
    machineId?: number;
    params?: Record<string, any>;
  }

  export interface FaultTraceVO {
    periodLabel: string;
    periodStart: string;
    deviceType: string;
    machineCode: string;
    faultTypeName: string;
    faultCount: number;
    totalDowntimeHours: number;
    mtbfHours: number;
    mttrMinutes: number;
    outputLoss: number | null;
    delayCount: number;
    topCause: string;
    topResolution: string;
    topResolutionTime: string | null;
    faultType?: string | number;
  }

  export interface RealtimeAlarmQuery {
  pageNum?: number;
  pageSize?: number;
  startDate?: string; // 'YYYY-MM-DD HH:mm:ss' or ISO
  endDate?: string;   // 'YYYY-MM-DD HH:mm:ss' or ISO
  deviceModeId?: number;
  machineCode?: string;
  machineId?: number;
  alarmLevelId?: number;
  alarmTypeId?: number;
  alarmStatus?: string; // 0未处理、1已处理、2已恢复
  alarmMode?: string;   // 1云端处理，2终端上报
  alarmInfoType?: string; // 1设备报警，3离线报警
  params?: Record<string, any>;
}

export interface RealtimeAlarmVO {
  machineCode: string;
  machineName: string;
  deviceModeName: string;
  alarmLevelName: string;
  alarmTypeName: string;
  alarmStatus: string; // 字典 alarm_status
  alarmMode: string;   // 字典 alarm_mode
  alarmBeginTime: string;
  alarmEndTime: string | null;
  durationMinutes: string; // as string from backend
  alarmContent: string;
}