| | |
| | | </div> |
| | | <div class="sensor-data"> |
| | | <div class="data-item"> |
| | | <span>甲烷: {{ sensor.methane.toFixed(2) }}%</span> |
| | | <span>甲烷: {{ sensor.methane.toFixed(3) }}%</span> |
| | | <el-progress |
| | | :percentage="Math.min(Math.round(sensor.methane * 40 * 100) / 100, 100)" |
| | | :color="getProgressColor(Math.min(Math.round(sensor.methane * 40 * 100) / 100, 100), 80)" |
| | |
| | | /> |
| | | </div> |
| | | <div class="data-item"> |
| | | <span>硫化氢: {{ sensor.h2s.toFixed(2) }}ppm</span> |
| | | <span>硫化氢: {{ sensor.h2s.toFixed(3) }}ppm</span> |
| | | <el-progress |
| | | :percentage="Math.min(Math.round((sensor.h2s / 20) * 100 * 100) / 100, 100)" |
| | | :color="getProgressColor(Math.min(Math.round((sensor.h2s / 20) * 100 * 100) / 100, 100), 80)" |
| | |
| | | </div> |
| | | <div class="sensor-data"> |
| | | <div class="data-item"> |
| | | <span>甲烷: {{ sensor.methane.toFixed(2) }}%</span> |
| | | <span>甲烷: {{ sensor.methane.toFixed(3) }}%</span> |
| | | <el-progress |
| | | :percentage="Math.min(Math.round(sensor.methane * 40 * 100) / 100, 100)" |
| | | :color="getProgressColor(sensor.methane, 2.5)" |
| | |
| | | /> |
| | | </div> |
| | | <div class="data-item"> |
| | | <span>硫化氢: {{ sensor.h2s.toFixed(2) }}ppm</span> |
| | | <span>硫化氢: {{ sensor.h2s.toFixed(3) }}ppm</span> |
| | | <el-progress |
| | | :percentage="Math.min(Math.round((sensor.h2s / 20) * 100 * 100) / 100, 100)" |
| | | :color="getProgressColor(sensor.h2s, 10)" |
| | |
| | | formatProgress(percentage) { |
| | | if (percentage == null || isNaN(percentage)) return '0.00%' |
| | | const val = Math.round(Number(percentage) * 100) / 100 |
| | | return `${val.toFixed(2)}%` |
| | | return `${val.toFixed(3)}%` |
| | | }, |
| | | // 初始化图表 |
| | | initChart() { |