gaoluyang
2026-05-25 4aaae263a6c728eaa2a3f45a1ae36082619b52a0
src/views/productionManagement/safetyMonitoring/index.vue
@@ -24,7 +24,7 @@
                        </div>
                        <div class="sensor-data">
                           <div class="data-item">
                              <span>甲烷: {{ sensor.methane.toFixed(2) }}%</span>
                              <span>甲烷: {{ sensor.methane.toFixed(4) }}%</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)"
@@ -33,7 +33,7 @@
                              />
                           </div>
                           <div class="data-item">
                              <span>硫化氢: {{ sensor.h2s.toFixed(2) }}ppm</span>
                              <span>硫化氢: {{ sensor.h2s.toFixed(4) }}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)"
@@ -59,7 +59,7 @@
                        </div>
                        <div class="sensor-data">
                           <div class="data-item">
                              <span>甲烷: {{ sensor.methane.toFixed(2) }}%</span>
                              <span>甲烷: {{ sensor.methane.toFixed(4) }}%</span>
                              <el-progress
                                 :percentage="Math.min(Math.round(sensor.methane * 40 * 100) / 100, 100)"
                                 :color="getProgressColor(sensor.methane, 2.5)"
@@ -68,7 +68,7 @@
                              />
                           </div>
                           <div class="data-item">
                              <span>硫化氢: {{ sensor.h2s.toFixed(2) }}ppm</span>
                              <span>硫化氢: {{ sensor.h2s.toFixed(4) }}ppm</span>
                              <el-progress
                                 :percentage="Math.min(Math.round((sensor.h2s / 20) * 100 * 100) / 100, 100)"
                                 :color="getProgressColor(sensor.h2s, 10)"
@@ -339,7 +339,7 @@
      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(4)}%`
      },
      // 初始化图表
      initChart() {
@@ -437,7 +437,7 @@
      generateRandomData(count, min, max) {
         const data = []
         for (let i = 0; i < count; i++) {
            data.push(+(Math.random() * (max - min) + min).toFixed(2))
            data.push(+(Math.random() * (max - min) + min).toFixed(4))
         }
         return data
      },
@@ -455,15 +455,15 @@
      refreshSensorData() {
         // 更新储罐区传感器数据
         this.tankSensors.forEach(sensor => {
            sensor.methane = +(Math.random() * 4).toFixed(2)
            sensor.h2s = +(Math.random() * 15).toFixed(2)
            sensor.methane = +(Math.random() * 4).toFixed(4)
            sensor.h2s = +(Math.random() * 15).toFixed(4)
            sensor.status = this.getSensorStatus(sensor.methane, sensor.h2s)
         })
         
         // 更新压缩机传感器数据
         this.compressorSensors.forEach(sensor => {
            sensor.methane = +(Math.random() * 6).toFixed(2)
            sensor.h2s = +(Math.random() * 20).toFixed(2)
            sensor.methane = +(Math.random() * 6).toFixed(4)
            sensor.h2s = +(Math.random() * 20).toFixed(4)
            sensor.status = this.getSensorStatus(sensor.methane, sensor.h2s)
         })
         
@@ -497,7 +497,7 @@
         const h2sPct = Math.min(Math.round((sensor.h2s / 20) * 100 * 100) / 100, 100)
         const isMethaneMajor = methanePct >= h2sPct
         const overGas = isMethaneMajor ? '甲烷' : '硫化氢'
         const percent = (isMethaneMajor ? methanePct : h2sPct).toFixed(2)
         const percent = (isMethaneMajor ? methanePct : h2sPct).toFixed(4)
         this.currentWarning = {
            location: sensor.name,
            gas: overGas,