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);
    });
  }
};