You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.5 KiB
TypeScript
63 lines
1.5 KiB
TypeScript
import request from '@/config/axios'
|
|
|
|
export interface DeviceOperationOverviewParams {
|
|
ids?: string
|
|
startTime?: string
|
|
endTime?: string
|
|
timelinePageNo?: number
|
|
timelinePageSize?: number
|
|
}
|
|
|
|
export interface DeviceOperationOverviewMetricVO {
|
|
key: string
|
|
icon: string
|
|
value: number
|
|
unit: string
|
|
change: number
|
|
}
|
|
|
|
export interface DeviceOperationOverviewHourlyStatusVO {
|
|
hour: string
|
|
running: number
|
|
standby: number
|
|
fault: number
|
|
offline: number
|
|
}
|
|
|
|
export interface DeviceOperationOverviewSummaryVO {
|
|
status: 'running' | 'standby' | 'fault' | 'offline'
|
|
percent: number
|
|
hours: number
|
|
}
|
|
|
|
export interface DeviceOperationOverviewTimelineSegmentVO {
|
|
status: 'running' | 'standby' | 'fault' | 'offline'
|
|
startHour: number
|
|
endHour: number
|
|
}
|
|
|
|
export interface DeviceOperationOverviewTimelineRowVO {
|
|
id: string
|
|
name: string
|
|
utilizationRate: number
|
|
segments: DeviceOperationOverviewTimelineSegmentVO[]
|
|
}
|
|
|
|
export interface DeviceOperationOverviewRespVO {
|
|
metrics: DeviceOperationOverviewMetricVO[]
|
|
hourlyStatus: DeviceOperationOverviewHourlyStatusVO[]
|
|
summary: DeviceOperationOverviewSummaryVO[]
|
|
summaryTotalHours: number
|
|
timelineRows: DeviceOperationOverviewTimelineRowVO[]
|
|
totalDevices: number
|
|
}
|
|
|
|
export const DeviceOperationOverviewApi = {
|
|
getRunOverview: async (params: DeviceOperationOverviewParams) => {
|
|
return await request.get<DeviceOperationOverviewRespVO>({
|
|
url: `/iot/device-operation-record/runOverview`,
|
|
params
|
|
})
|
|
}
|
|
}
|