From cd327dcbaca3476df44b064e56b950dc054cbb87 Mon Sep 17 00:00:00 2001 From: he wei <858544502@qq.com> Date: 星期四, 17 十一月 2022 16:58:56 +0800 Subject: [PATCH] UA 添加自动升级检测功能 添加几种类型电池告警阀值 --- src/pages/compare.vue | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/pages/compare.vue b/src/pages/compare.vue index dce4c74..9018929 100644 --- a/src/pages/compare.vue +++ b/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(); -- Gitblit v1.9.1