派生自 wuyushui/SewerAndRainNetwork

chenyabin
2021-04-13 dd13c9fb53fdfbfc6f908dd497b4f51d5b8d28c9
src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue
@@ -141,22 +141,16 @@
      }
    }
  },
  // mounted () {
  //   // this.$nextTick(() => {
  //   //   console.log(1)
  //   this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype)
  //   // }
  // },
  methods: {
    onSubmit () {
      console.log(1)
      // const date = [this.value1, this.value2, this.formInline.region]
      // if (this.$attrs.)
      // console.log(this.$attrs.)
      console.log(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype)
      this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype)
      // console.log(date)
      // if (date) {
      //   var date1 = new Date(date)
      //   date1 = new Date(date1.getTime() - (8 * 3600000))
      //   console.log(date1)
      // var dateUtil = new DateUtil()
      // var datePkg = dateUtil.getTowDate(date1, "a", 24 * 3600000 - 1);
      // var datatype = 2;
    },
    CreateChart: function (id, title, legend, xdata, ydatas, yname, jcdID, datatype) {
      this.myChart = this.$echarts.init(this.$refs.main)
@@ -311,9 +305,10 @@
              var valueFliter
              if (value === 'NaN') {
                valueFliter = ''
              } else {
                // valueFliter = formatter(value)
              }
              // else {
              //   // valueFliter = formatter(value)
              // }
              var maker = params[i].marker
              if (seriesName === '二氧化硫') {
                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#fff21c;"></span>'
@@ -526,21 +521,20 @@
        }
        // createDivByMouse("s",params.event);
      }) */
    },
    drawChart: function () {
      window.onresize = function () {
        var h1 = document.documentElement.clientHeight// 获取屏幕的高度
        if (h1 > 700) {
          this.myChart.getDom().style.height = 3 + 'rem'
          this.myChart.getDom().style.width = 6 + 'rem'
        } else {
          this.myChart.getDom().style.height = 3 + 'rem'
          this.myChart.getDom().style.width = 6 + 'rem'
        }
        this.myChart.resize()
      }
    }
    // drawChart: function () {
    //   window.onresize = function () {
    //     var h1 = document.documentElement.clientHeight// 获取屏幕的高度
    //     if (h1 > 700) {
    //       this.myChart.getDom().style.height = 3 + 'rem'
    //       this.myChart.getDom().style.width = 6 + 'rem'
    //     } else {
    //       this.myChart.getDom().style.height = 3 + 'rem'
    //       this.myChart.getDom().style.width = 6 + 'rem'
    //     }
    //     this.myChart.resize()
    //   }
    // }
  }
}