派生自 wuyushui/SewerAndRainNetwork

wangqi
2021-04-15 20732ddaadd46d249fa3018b43329af052ba536b
src/components/BaseNav/PublicBounced/common/echarts/EChartsHour.vue
@@ -15,7 +15,8 @@
                    <div class="pickerData">
                        <span> 开始时间:</span>
                        <span class="pickerTable">
                          <el-date-picker  type="datetime"   v-model="formInline.timeStart"></el-date-picker>
                          <el-date-picker  type="datetime"  v-model="formInline.timeStart"
                                           default-value="'"></el-date-picker>
                        </span>
                    </div>
                    <div class="pickerData">
@@ -25,16 +26,6 @@
                        </span>
                    </div>
                </div>
<!--                <div>-->
<!--                    采样点数:-->
<!--                    <el-select v-model="formInline.region">-->
<!--                        <el-option label="0" value="0"></el-option>-->
<!--                        <el-option label="25" value="25"></el-option>-->
<!--                        <el-option label="50" value="50"></el-option>-->
<!--                        <el-option label="75" value="75"></el-option>-->
<!--                        <el-option label="100" value="100"></el-option>-->
<!--                    </el-select>-->
<!--                </div>-->
                <div class="detailbtn"  @click="onSubmit">查询</div>
                <div class="detailbtn" @click="dialogVisible = true" >明细表</div>
             </div>
@@ -43,7 +34,6 @@
        <!-- 明细弹框 -->
        <el-dialog :visible.sync="dialogVisible"
                   :append-to-body="true"
                   :title="this.$attrs.value==='feiqi'?this.$attrs.getWasteGasDetails[0].OnLineMonEmissPointName:this.$attrs.getWasteWaterMonitoringDetails[0].OnLineMonEmissPointName"
                   width="68%"
                   center
                   v-dialogDrag
@@ -136,26 +126,19 @@
    }
  },
  created () {
    // this.$nextTick(() => {
    // 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)
    // }
  },
  mounted () {
    this.formInline.timeEnd = dayjs().format('YYYY-MM-DD HH:mm:ss')
    this.formInline.timeStart = dayjs().subtract(12, 'hour').format('YYYY-MM-DD HH:mm:ss')
    this.onSubmit()
    // 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)
  },
  updated () {
  mounted () {
  //   this.formInline.timeEnd = dayjs().format('YYYY-MM-DD HH:mm:ss')
  //   this.formInline.timeStart = dayjs().subtract(12, 'hour').format('YYYY-MM-DD HH:mm:ss')
    this.onSubmit()
  },
  methods: {
    onSubmit () {
      this.CreateChart()
      // 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)
    },
    CreateChart: function () {
    CreateChart () {
      // var id = this.JsonCtarts.id
      // var title = this.JsonCtarts.title
      var legend = this.JsonCtarts.legend
@@ -314,12 +297,11 @@
              var seriesName = params[i].seriesName
              // 值
              var value = params[i].value
              var valueFliter
              if (value === 'NaN') {
                valueFliter = ''
              }
              // else {
              //   // valueFliter = formatter(value)
              // var valueFliter
              // if (value === 'NaN') {
              //   valueFliter = ''
              // } else {
              //   valueFliter = this.formatter(value)
              // }
              var maker = params[i].marker
              if (seriesName === '二氧化硫') {
@@ -333,7 +315,7 @@
              } else {
                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#4ec99c;"></span>'
              }
              s += maker + seriesName + ':' + valueFliter + '<br />'
              s += maker + seriesName + ':' + value + '<br />'
            }
            return s
          }
@@ -346,7 +328,8 @@
        },
        grid: { // 网格
          top: '20%',
          left: '5%'
          left: '6%',
          bottom: '15%'
          // containLabel: true
        },
        legend: { // 图例
@@ -462,7 +445,7 @@
        }],
        series: serLists
      }
      console.log(option)
      // console.log(option)
      this.myChart.setOption(option)
      /*
      this.myChart.on('legendselectchanged', function (params) {