riku
2024-05-11 e94ea7f723e616a0566ac5c7f9d77435333d9e92
src/components/chart/ProgressLineChart.vue
ÎļþÃû´Ó src/components/monitor/LineChart.vue ÐÞ¸Ä
@@ -19,6 +19,7 @@
import { factorName } from '@/constant/factor-name';
import { factorLineOption } from '@/utils/chart/chart-option';
// å¸¦å¯æ‹–动进度条的折线图
export default {
  props: {
    loading: Boolean,
@@ -119,20 +120,17 @@
    // ä¿®æ”¹å›¾è¡¨å±•示的折线图类型
    changeChartSeries() {
      this.option.series = this.getShowSeries();
      this.option.legend.data = this.getLegends(this.option.series);
      this.lineChart.setOption(this.option, { notMerge: true });
    },
    changeChartRange() {
      const { sIndex, eIndex, startPer, endPer } = this.getRange();
      const showSeries = this.getShowSeries(sIndex, eIndex);
      const xAxis = this.getShowXAxis(sIndex, eIndex);
      const legends = this.getLegends(showSeries);
      if (!this.option) {
        this.option = factorLineOption(xAxis, showSeries, legends);
        this.option = factorLineOption(xAxis, showSeries);
      } else {
        this.option.xAxis.data = xAxis;
        this.option.series = showSeries;
        this.option.legend.data = legends;
      }
      // this.option.dataZoom[0].start = startPer;
      // this.option.dataZoom[0].end = endPer;
@@ -160,11 +158,6 @@
      const startPer = (sIndex / this.allXAxis.length) * 100;
      const endPer = (eIndex / this.allXAxis.length) * 100;
      return { sIndex, eIndex, startPer, endPer };
    },
    getLegends(series) {
      return series.map((s) => {
        return s.name;
      });
    }
  },
  beforeUnmount() {