haoxuan
2023-12-05 aba444f58264a5b6a016ddc3e6076de8e9379950
src/views/cockpitPage/components/DeviceChart.vue
@@ -46,6 +46,7 @@
      // },
      startValue: 0,
      endValue: 5,
      chartTimer:null,
    };
  },
  watch: {
@@ -64,6 +65,7 @@
    //在职
    pieChart(chartName, data) {
      let that = this;
      clearInterval(this.chartTimer);
      let chartDomTwo = this.$refs[chartName];
      let myChartTwo = echarts.init(chartDomTwo)
      myChartTwo.dispose()
@@ -134,6 +136,12 @@
                    }
                  },
                },
                formatter:function(value){
                  if(value.length>6){
                    return `${value.slice(0,4)}...`
                  }
                  return value;
                }
              },
              data: data.datax ? data.datax : [],
            },
@@ -205,7 +213,7 @@
          ],
        };
        setInterval(function () {
        this.chartTimer=setInterval(function () {
          if (option.dataZoom[0].endValue == data.datay.length) {
            option.dataZoom[0].startValue = that.startValue;
            option.dataZoom[0].endValue = that.endValue;