From 96da92e9056c9c02e77867998424d623261daab0 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期四, 25 七月 2024 15:09:32 +0800 Subject: [PATCH] 1. 添加地图罗盘的显隐 2. 修复数据表格中O3数据列实际显示NO2的值的问题 3. 优化风向的中文描述 --- src/components/chart/ProgressLineChart.vue | 27 ++++++++++++++++----------- 1 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/components/chart/ProgressLineChart.vue b/src/components/chart/ProgressLineChart.vue index 7a40cc0..9c91a25 100644 --- a/src/components/chart/ProgressLineChart.vue +++ b/src/components/chart/ProgressLineChart.vue @@ -67,13 +67,6 @@ }, locateIndex(nV, oV) { if (nV == oV) return; - // 1. 瀹氫綅鐐瑰簲璇ュ睍绀哄湪瓒嬪娍鍥句腑闂达紝鍥犳瀹氫綅鐧惧垎姣斿線鍓嶅亸绉诲綋鍓峗size鐨勪竴鍗� - let i = nV - parseInt(this.pageSize / 2); - // 2. 纭繚绱㈠紩涓嶄細瓒呭嚭鑼冨洿 - i = i < 0 ? 0 : i; - // 3. 鑾峰彇绱㈠紩瀵瑰簲鐨勮繘搴︾櫨鍒嗘瘮 - this.progress = (i / (this.allXAxis.length - this.pageSize)) * 100; - for (const iterator of this.allSeries) { // if (iterator.name == factorName || (iterator.name == 'TVOC' || factorName == 'VOC')) { iterator.markLine = { @@ -92,7 +85,21 @@ ] }; } - this.changeChartRange(); + // 璁$畻瓒呭嚭鍗曢〉鏁版嵁閲忕殑闀垮害 + let len = this.allXAxis.length - this.pageSize; + len = len < 0 ? 0 : len; + // 瀹氫綅鐐瑰簲璇ュ睍绀哄湪瓒嬪娍鍥句腑闂达紝鍥犳瀹氫綅鐧惧垎姣斿線鍓嶅亸绉诲綋鍓峗size鐨勪竴鍗� + let i = nV - parseInt(this.pageSize / 2); + // 纭繚绱㈠紩涓嶄細瓒呭嚭鑼冨洿 + i = i < 0 ? 0 : i; + i = i > len ? len : i; + // 鑾峰彇绱㈠紩瀵瑰簲鐨勮繘搴︾櫨鍒嗘瘮 + const _progress = len == 0 ? 0 : (i / len) * 100; + if (this.progress != _progress) { + this.progress = _progress; + } else { + this.changeChartRange(); + } } }, methods: { @@ -143,9 +150,7 @@ }, getShowSeries(sIndex, eIndex) { this.allSeries.forEach((s) => { - if (sIndex && eIndex) { - s.data = s.allData.slice(sIndex, eIndex); - } + s.data = s.allData.slice(sIndex, eIndex); }); const res = this.allSeries.filter((s) => { return this.selectFactorType.includes(s.key); -- Gitblit v1.9.3