haoxuan
2023-12-05 cd388c78650efe85fe4dd41cc439208d58ab6c29
src/views/cockpitPage/components/DeviceChart.vue
@@ -46,11 +46,12 @@
      // },
      startValue: 0,
      endValue: 5,
      chartTimer:null,
    };
  },
  watch: {
    "chartData.datay"(val) {
      console.log(val, "ddddddddddddddd");
      console.log(val, "设备变更数据");
      this.ydata = val;
      this.startValue = 0;
      this.endValue = 5;
@@ -64,14 +65,18 @@
    //在职
    pieChart(chartName, data) {
      let that = this;
      clearInterval(this.chartTimer);
      let chartDomTwo = this.$refs[chartName];
      let myChartTwo = echarts.init(chartDomTwo)
      myChartTwo.dispose()
      let chartDom = this.$refs[chartName];
      if (myChart != null && myChart != "" && myChart != undefined) {
        console.log("222222222");
        myChart.dispose(); //销毁
        myChart.resize();
      }
      console.log(myChart, "ssssssss");
      myChart = echarts.init(chartDom);
      // if (myChart != null && myChart != "" && myChart != undefined) {
      //   console.log("222222222");
      //   myChart.dispose(); //销毁
      //   myChart.resize();
      // }
      // console.log(myChart, "ssssssss");
      let option;
      let lineColor = "#35ddc74d";
      if (this.ydata) {
@@ -202,7 +207,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;