Dispositivo | Código | Tipo | Revisiones | Consumo Total |
---|---|---|---|---|
{{ $typeName }} | ||||
{{ $device['name'] ?? 'Dispositivo sin nombre' }} | {{ $device['code'] }} | {{ $device['type'] }} |
@if(!empty($device['consumptions']))
@foreach($device['consumptions'] as $consumption)
@php
$level = '';
$color = 'secondary';
if ($consumption == 0) {
$level = 'Nulo';
$color = 'light text-dark';
} elseif ($consumption <= 0.25) {
$level = 'Bajo';
$color = 'success';
} elseif ($consumption <= 0.5) {
$level = 'Medio';
$color = 'warning';
} elseif ($consumption <= 0.75) {
$level = 'Alto';
$color = 'orange text-white';
} else {
$level = 'Total';
$color = 'danger';
}
@endphp
{{ number_format($consumption, 2) }}
@endforeach
@else
Sin datos
@endif
|
@php
$total = $device['total_consumption'] ?? 0;
$avgConsumption = count($device['consumptions']) > 0 ? $total / count($device['consumptions']) : 0;
$progressColor = 'bg-secondary';
if ($avgConsumption <= 0.25) $progressColor = 'bg-success';
elseif ($avgConsumption <= 0.5) $progressColor = 'bg-warning';
elseif ($avgConsumption <= 0.75) $progressColor = 'bg-orange';
else $progressColor = 'bg-danger';
@endphp
|