|
|
|
|
@ -965,11 +965,12 @@ const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
|
|
|
|
|
|
type DeviceOperatingStatusKey = 'running' | 'standby' | 'fault' | 'alarm' | 'offline'
|
|
|
|
|
type DeviceStatisticKey = 'total' | 'running' | 'standby' | 'alarm' | 'offline'
|
|
|
|
|
type DeviceStatisticKey = 'total' | 'running' | 'standby' | 'fault' | 'alarm' | 'offline'
|
|
|
|
|
const deviceStatistics = reactive<Record<DeviceStatisticKey, number>>({
|
|
|
|
|
total: 0,
|
|
|
|
|
running: 0,
|
|
|
|
|
standby: 0,
|
|
|
|
|
fault: 0,
|
|
|
|
|
alarm: 0,
|
|
|
|
|
offline: 0
|
|
|
|
|
})
|
|
|
|
|
@ -978,7 +979,7 @@ const deviceStatisticsItems = computed(() => [
|
|
|
|
|
{ key: 'running', label: t('DataCollection.Device.statisticsRunning'), value: deviceStatistics.running },
|
|
|
|
|
{ key: 'standby', label: t('DataCollection.Device.statisticsStandby'), value: deviceStatistics.standby },
|
|
|
|
|
{ key: 'fault', label: t('DataCollection.Device.statisticsFault'), value: deviceStatistics.fault },
|
|
|
|
|
/*{ key: 'alarm', label: '报警数', value: deviceStatistics.alarm },*/
|
|
|
|
|
{ key: 'alarm', label: '报警数', value: deviceStatistics.alarm },
|
|
|
|
|
{ key: 'offline', label: t('DataCollection.Device.statisticsOffline'), value: deviceStatistics.offline }
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
@ -987,7 +988,7 @@ const normalizeDeviceOperatingStatus = (value: string | number | undefined): Dev
|
|
|
|
|
if (['运行', '运行中', 'running', 'run', '1'].includes(text)) return 'running'
|
|
|
|
|
if (['待机', '待机中', 'standby', 'idle', '2'].includes(text)) return 'standby'
|
|
|
|
|
if (['故障', '故障中', 'fault', 'error', '3'].includes(text)) return 'fault'
|
|
|
|
|
/* if (['报警', '报警中', 'alarm', 'warning', '4', '5'].includes(text)) return 'alarm'*/
|
|
|
|
|
if (['报警', '报警中', 'alarm', 'warning', '4', '5'].includes(text)) return 'alarm'
|
|
|
|
|
return 'offline'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1009,6 +1010,7 @@ const getDeviceStatistics = async () => {
|
|
|
|
|
total: Number(data?.totalCount ?? 0),
|
|
|
|
|
running: Number(data?.runningCount ?? 0),
|
|
|
|
|
standby: Number(data?.standbyCount ?? 0),
|
|
|
|
|
fault: Number(data?.faultCount ?? 0),
|
|
|
|
|
alarm: Number(data?.alarmCount ?? 0),
|
|
|
|
|
offline: Number(data?.offlineCount ?? 0)
|
|
|
|
|
})
|
|
|
|
|
@ -1017,6 +1019,7 @@ const getDeviceStatistics = async () => {
|
|
|
|
|
total: 0,
|
|
|
|
|
running: 0,
|
|
|
|
|
standby: 0,
|
|
|
|
|
fault: 0,
|
|
|
|
|
alarm: 0,
|
|
|
|
|
offline: 0
|
|
|
|
|
})
|
|
|
|
|
@ -2056,7 +2059,7 @@ const handleShowDeviceAlarmHistory = async () => {
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.device-statistics {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(5, minmax(0, 1fr));
|
|
|
|
|
grid-template-columns: repeat(6, minmax(0, 1fr));
|
|
|
|
|
gap: 10px;
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
}
|
|
|
|
|
@ -2095,7 +2098,7 @@ const handleShowDeviceAlarmHistory = async () => {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-statistics__item--alarm .device-statistics__value {
|
|
|
|
|
color: #f56c6c;
|
|
|
|
|
color: #e6a23c;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.device-statistics__item--offline .device-statistics__value,
|
|
|
|
|
|