he wei
2022-11-17 cd327dcbaca3476df44b064e56b950dc054cbb87
src/pages/compare.vue
@@ -224,8 +224,12 @@
          const {
            resBadCoeK4,
            resGoodCoeK3,
            vol1d2HighCoeK2,
            vol1d2LowCoeK1,
            vol2HighCoeK2,
            vol2LowCoeK1,
            vol6HighCoeK2,
            vol6LowCoeK1,
            vol12HighCoeK2,
            vol12LowCoeK1,
          } = this.params;
@@ -239,14 +243,42 @@
            BIT
          );
          if (2 == battVol) {
            this.marks.volChart[0].y = toFixed(vol2HighCoeK2, BIT);
            this.marks.volChart[1].y = toFixed(vol2LowCoeK1, BIT);
          } else if (12 == battVol) {
            this.marks.volChart[0].y = toFixed(vol12HighCoeK2, BIT);
            this.marks.volChart[1].y = toFixed(vol12LowCoeK1, BIT);
          } else {
            this.marks.volChart = [];
          if (!this.marks.volChart.length) {
            this.marks.volChart = [
              {
                name: "高压告警",
                y: 0,
                type: "high",
                color: "#ff0",
              },
              {
                name: "低压告警",
                y: 0,
                type: "low",
                color: "#d9001b",
              },
            ];
          }
          switch (battVol) {
            case 1.2:
              this.marks.volChart[0].y = toFixed(vol1d2HighCoeK2, BIT);
              this.marks.volChart[1].y = toFixed(vol1d2LowCoeK1, BIT);
              break;
            case 2:
              this.marks.volChart[0].y = toFixed(vol2HighCoeK2, BIT);
              this.marks.volChart[1].y = toFixed(vol2LowCoeK1, BIT);
              break;
            case 6:
              this.marks.volChart[0].y = toFixed(vol6HighCoeK2, BIT);
              this.marks.volChart[1].y = toFixed(vol6LowCoeK1, BIT);
              break;
            case 12:
              this.marks.volChart[0].y = toFixed(vol12HighCoeK2, BIT);
              this.marks.volChart[1].y = toFixed(vol12LowCoeK1, BIT);
              break;
            default:
              this.marks.volChart = [];
              break;
          }
          this.$nextTick(() => {
            this.initChart();