From 80079d9802dd2445820b112fe818d61e1cc21c6f Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 15 五月 2024 18:08:03 +0800
Subject: [PATCH] 修复bug

---
 src/components/chart/ProgressLineChart.vue |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/components/chart/ProgressLineChart.vue b/src/components/chart/ProgressLineChart.vue
index 4aedf0a..7a40cc0 100644
--- a/src/components/chart/ProgressLineChart.vue
+++ b/src/components/chart/ProgressLineChart.vue
@@ -40,7 +40,9 @@
       allSeries: [],
       option: null,
       pageSize: 200,
-      progress: 0
+      progress: 0,
+      // 瀵瑰簲progress杩涘害涓嬶紝鎵�灞曠ず鏁版嵁鐨勮捣濮嬬储寮�
+      sIndex: 0
     };
   },
   emits: ['chartClick'],
@@ -155,8 +157,9 @@
       len = len < 0 ? 0 : len;
       const sIndex = Math.round((len * this.progress) / 100);
       const eIndex = sIndex + this.pageSize;
-      const startPer = (sIndex / this.allXAxis.length) * 100;
+      const startPer = (this.sIndex / this.allXAxis.length) * 100;
       const endPer = (eIndex / this.allXAxis.length) * 100;
+      this.sIndex = sIndex;
       return { sIndex, eIndex, startPer, endPer };
     }
   },
@@ -166,7 +169,8 @@
   mounted() {
     this.lineChart = echarts.init(this.$refs.lineChart);
     this.lineChart.on('click', (e) => {
-      this.$emit('chartClick', e.dataIndex);
+      console.log(e);
+      this.$emit('chartClick', this.sIndex + e.dataIndex);
     });
   }
 };

--
Gitblit v1.9.3