派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-04-20 ec950a5a5d96fba7a3b1214e0a798ce2d8dc045e
src/components/BaseNav/WasteWater/HourData.vue
@@ -1,181 +1,326 @@
<!--  小时数据  -->
<template>
    <div id="Tab">
        <div class="infomation">
          <div>
            <span class="grid-content">COD : <i style="color: #e8ee0b">6.039</i>  标准 : <i style="color: #fff">12</i></span>
            <span class="grid-content">氨氮 : <i style="color: #e8ee0b">0.38</i> 标准 : <i style="color: #fff">5</i></span>
              <span class="grid-content">pH : <i style="color: #e8ee0b">7.674</i> 标准 : <i style="color: #fff">9</i></span>
            <span class="grid-content">废水流量 : <i style="color: #e8ee0b">254.643997</i></span>
          </div>
        </div>
        <div class="form-echrts">
            <div class="from-search">
                <div class="pickerMon">
                    <div class="pickerData">
                        <span> 开始时间:</span>
                        <span class="pickerTable">
  <div id="Tab">
    <PublicDataStandard :dataStandard="dataStandard"></PublicDataStandard>
    <div class="form-echrts">
      <div class="from-search">
        <div class="pickerMon">
          <div class="pickerData">
            <span> 开始时间:</span>
            <span class="pickerTable">
                          <el-date-picker type="datetime" v-model="formInline.timeStart">
                      </el-date-picker>
                      </span>
                    </div>
                    <div class="pickerData">
                        <span >结束时间:</span>
                        <span class="pickerTable">
          </div>
          <div class="pickerData">
            <span>结束时间:</span>
            <span class="pickerTable">
                        <el-date-picker type="datetime" v-model="formInline.timeEnd">
                      </el-date-picker>
                      </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>
            <div class="boxChart">
                <div style="width: 5rem;height:1.5rem;" id="echarts" ref="main"></div>
            </div>
          </div>
        </div>
        <!-- 明细弹框 -->
<!--        <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-->
<!--        >-->
<!--            <div class="el-dialog-div" style="height: 500px">-->
<!--                <public-detailed-list v-bind="$attrs"></public-detailed-list>-->
<!--            </div>-->
<!--        </el-dialog>-->
        <div class="detailbtn">查询</div>
        <div class="detailbtn">明细表</div>
      </div>
      <div class="boxChart">
        <div style="width: 5rem;height:2rem;" id="echarts" ref="echartsHour"></div>
      </div>
    </div>
  </div>
</template>
<script>
// import PublicDetailedList from '@components/BaseNav/PublicBounced/common/echarts/PublicDetailedList'
// import dayjs from 'dayjs'
import PublicDataStandard from '../PublicDataStandard'
import dayjs from 'dayjs'
import mapApi from '@/api/mapApi'
export default {
  name: 'ECharts',
  components: {
    // PublicDetailedList
    PublicDataStandard
  },
  data () {
    return {
      watchData: [],
      dialogVisible: false,
      myChar: null,
      value: '',
      formInline: {
        region: '',
        timeStart: '2021-04-12 10:00:00',
        timeEnd: '2021-04-13 09:00:00'
      },
      myChart: null,
      JsonHourWater: {
        id: 'mycharteff',
        title: '',
        jcdID: '1020',
        legend: [
          {
            icon: 'image://../assets/imgs/legend/SO2.png',
            itemHeight: 5,
            itemWidth: 20,
            name: 'COD',
            testStyle: {
              color: '#ccc'
            }
      // tab栏传递接收数据
      dataStandard: [
        {
          current: {
            name: '氮氧化物',
            val: 29.93
          },
          {
            icon: 'image://../assets/imgs/legend/NOX.png',
            itemHeight: 5,
            itemWidth: 20,
            name: '氨氮',
            testStyle: {
              color: '#ccc'
            }
          },
          {
            icon: 'image://../assets/imgs/legend/WenDu.png',
            itemHeight: 5,
            itemWidth: 20,
            name: 'pH',
            testStyle: {
              color: '#ccc'
            }
          },
          {
            icon: 'image://../assets/imgs/legend/VOCs.png',
            itemHeight: 5,
            itemWidth: 20,
            name: '废水流量',
            testStyle: {
              color: '#ccc'
            }
          standard: {
            name: '标准',
            val: 100
          }
        ],
        xdata: ['10时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '21时', '22时', '23时', '0时', '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时'],
        ydatas: [
          { name: 'COD', data: [11.197, 11.5, 11.33, 11.2, 11.54, 11.8, 11.195, 10.7, 10.645, 10.6, 10.875, 11.1, 10.715, 10.4, 10.95, 11.4, 11.193, 11, 11.267, 11.5, 10.725, 10, 10.8, 11.5], zdcbcolor: 'red', zxcolor: '#fff21c', bzz: 12 },
          { name: '氨氮', data: [0.186, 0.179, 0.165, 0.159, 0.149, 0.146, 0.141, 0.136, 0.128, 0.13, 0.133, 0.133, 0.134, 0.13, 0.122, 0.124, 0.128, 0.139, 0.16, 0.147, 0.123, 0.127, 0.134, 0.128], zdcbcolor: 'red', zxcolor: '#00B0F0', bzz: 5 },
          { name: '废水流量', data: [35.15667, 35.445004, 32.91, 31.478336, 33.038334, 33.46167, 33.348335, 33.515003, 33.735001, 31.503336, 31.411667, 32.880001, 33.100002, 31.870001, 30.841667, 31.873335, 32.658333, 32.178337, 30.656668, 30.65667, 32.241669, 32.521667, 31.225002, 30.476669], zdcbcolor: 'red', zxcolor: '#9ACD32', bzz: null },
          { name: 'pH', data: [7.666, 7.669, 7.67, 7.672, 7.677, 7.682, 7.685, 7.688, 7.689, 7.689, 7.688, 7.689, 7.69, 7.69, 7.69, 7.69, 7.691, 7.69, 7.685, 7.681, 7.681, 7.678, 7.674, 7.674], zdcbcolor: 'red', zxcolor: '#F206FF', bzz: 9 }
        ],
        yname: '浓度(mg/l)',
        datatype: 2
      }
        },
        {
          current: {
            name: '二氧化硫',
            val: 17.34
          },
          standard: {
            name: '标准',
            val: 50
          }
        },
        {
          current: {
            name: '烟尘',
            val: 6.93
          },
          standard: {
            name: '标准',
            val: 30
          }
        },
        {
          current: {
            name: '废气流量',
            val: 120
          },
          standard: {
            name: '',
            val: null
          }
        }],
      formInline: {
        timeStart: '',
        timeEnd: ''
      },
      chart: null,
      jcdID: 1,
      dataType: 2,
      bzz: null,
      bzzList: [],
      bz: ''
    }
  },
  mounted () {
    this.onSubmit()
    // 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()
  },
  updated () {
    this.onSubmit()
    this.draw24Chart()
  },
  methods: {
    onSubmit () {
      this.effChartShow()
    async draw24Chart () {
      // 用于接口数据请求的参数 开始/结束时间 || 可选择查询的开始/结束时间
      this.formInline.timeEnd = dayjs().format('YYYY-MM-DD HH:mm:ss')
      this.formInline.timeStart = dayjs().subtract(24, 'hours').format('YYYY-MM-DD HH:mm:ss')
      const data = {
        onLineMonEmissPointId: 23,
        monItemId: 28,
        beginTime: this.formInline.timeStart,
        endTime: this.formInline.timeEnd,
        dataType: this.dataType
      }
      const result = (await mapApi.getQueryOnlineMonData(data)).Result.DataInfo
      this.get24HourDate(result)
    },
    effChartShow: function () {
      // var id = this.JsonHourWater.id
      // var title = this.JsonHourWater.title
      var legend = this.JsonHourWater.legend
      var xdata = this.JsonHourWater.xdata
      var ydatas = this.JsonHourWater.ydatas
      var yname = this.JsonHourWater.yname
      // var jcdId = this.JsonHourWater.jcdID
      var datatype = this.JsonHourWater.datatype
    // 绘制小时数据
    get24HourDate (res) {
      if (res.length > 0) {
        const d = res
        const nameList = [] // 存放图例
        const dateList = [] // 存放时间
        let dataList = [] // 存放数据
        let data = []
        const bzh = []
        // wrwIDS = []
        for (let i = 0; i < d.length; i++) {
          if (d[i].MonItemId === '29') {
            continue
          }
      this.myChart = this.$echarts.init(this.$refs.main)
      this.myChart.clear()
          var MonTimeStr = d[i].MonTimeStr
          // getWRW(d[i])
          let strDate
          const d1 = MonTimeStr.split('/') // 月
          const d2 = d1[2].split(' ')
          const t = MonTimeStr.split(' ')
          const hlist = t[1].split(':')
          const h = hlist[0]
          if (d1[1] > 9) {
            //  strDate=MonTimeStr.substring(8,10)+"日";
            if (d2[0] > 9) {
              strDate = ''
              if (h > 9) {
                strDate += MonTimeStr.substring(11, 13) + '时'
              } else {
                strDate += MonTimeStr.substring(11, 12) + '时'
              }
            } else {
              strDate = ''
              if (h > 9) {
                strDate += MonTimeStr.substring(10, 12) + '时'
              } else {
                strDate += MonTimeStr.substring(10, 11) + '时'
              }
            }
          } else {
            if (d2[0] > 9) {
              strDate = ''
              if (h > 9) {
                strDate += MonTimeStr.substring(10, 12) + '时'
              } else {
                strDate += MonTimeStr.substring(10, 11) + '时'
              }
            } else {
              strDate = ''
              if (h > 9) {
                strDate += MonTimeStr.substring(9, 11) + '时'
              } else {
                strDate += MonTimeStr.substring(9, 10) + '时'
              }
            }
          }
          if (nameList.length === 0) {
            nameList.push(d[i].PoltmtrlName.trim())
            dateList.push(strDate)
            /*  var data=new Array();
              data.push(d.MonQty); */
            if ((d[i].PoltmtrlName === '废水流量' || d[i].PoltmtrlName === '废水') && d[i].MonQty < 0) {
              d[i].MonQty = 0
            }
            data.push(d[i].MonQty)
            bzh.push(d[i].StdValue)
          } else if (nameList.indexOf(d[i].PoltmtrlName.trim()) < 0) {
            nameList.push(d[i].PoltmtrlName)
            bzh.push(d[i].StdValue)
            dataList.push(data)
            data = []
            if ((d[i].PoltmtrlName === '废水流量' || d[i].PoltmtrlName === '废水') && d[i].MonQty < 0) {
              d[i].MonQty = 0
            }
            data.push(d[i].MonQty)
          } else if (i === d.length - 1) {
            if ((d[i].PoltmtrlName === '废水流量' || d[i].PoltmtrlName === '废水') && d[i].MonQty < 0) {
              d[i].MonQty = 0
            }
            data.push(d[i].MonQty)
            dataList.push(data)
          } else {
            if (dateList.indexOf(strDate) < 0) {
              dateList.push(strDate)
            }
            // data.push()
            if ((d[i].PoltmtrlName === '废水流量' || d[i].PoltmtrlName === '废水') && d[i].MonQty < 0) {
              d[i].MonQty = 0
            }
            data.push(d[i].MonQty)
          }
        }
        // 处理数据结束
        // dateList=get24DateTime();
        const newList = []
        for (let i = 0; i < dataList.length; i++) {
          var list = dataList[i].reverse()
          newList.push(list)
        }
        dataList = newList
        const divid = 'mycharteff'
        const title = name
        const lengList = []
        let objTemp
        for (let l = 0; l < nameList.length; l++) {
          let obj
          let iconurl
          if (nameList[l] === 'COD') {
            iconurl = 'image://../assets/imgs/legend/SO2.png'
          } else if (nameList[l] === '氨氮') {
            iconurl = 'image://../assets/imgs/legend/NOX.png'
          } else if (nameList[l] === '总磷') {
            iconurl = 'image://../assets/imgs/legend/YanChen.png'
          } else if (nameList[l] === '总氮') {
            iconurl = 'image://../assets/imgs/legend/zongdan.png'
          } else {
            iconurl = 'image://../assets/imgs/legend/VOCs.png'
          }
          if (nameList[l] === '废水' || nameList[l] === '废水流量') { // 将废水流量排到数组最后
            objTemp = {
              name: nameList[l],
              icon: iconurl,
              textStyle: {
                color: '#ccc'
              },
              itemWidth: 20,
              itemHeight: 5
            }
          } else {
            obj = {
              name: nameList[l],
              icon: iconurl,
              textStyle: {
                color: '#ccc'
              },
              itemWidth: 20,
              itemHeight: 5
            }
            lengList.push(obj)
          }
        }
        lengList.push(objTemp)
        var legend = lengList
        var xdata = dateList.reverse()
        var ydatas = []
        for (var j = 0; j < nameList.length; j++) {
          let zdcbcolor, zxcolor
          if (nameList[j] === 'COD') {
            zdcbcolor = 'red'
            zxcolor = '#fff21c'
          } else if (nameList[j] === '氨氮') {
            zdcbcolor = 'red'
            zxcolor = '#00B0F0'
          } else if (nameList[j] === '总磷') {
            zdcbcolor = 'red'
            zxcolor = '#f48183'
          } else if (nameList[j] === '总氮') {
            zdcbcolor = 'red'
            zxcolor = '#d9f2f4'
          } else {
            zdcbcolor = 'red'
            zxcolor = '#9ACD32'
          }
          const ydata = {
            name: nameList[j],
            data: dataList[j],
            zdcbcolor: zdcbcolor,
            zxcolor: zxcolor,
            bzz: bzh[j]
          }
          this.bzz = {
            name: nameList[j],
            bzhui: bzh[j]
          }
          this.bzzList.push(this.bzz)
          ydatas.push(ydata)
        }
        var yname = '浓度(mg/l)'
        this.effChartShow(divid, title, legend, xdata, ydatas, yname, this.jcdID, this.datatype)
      }
    },
    effChartShow (divid, title, legend, xdata, ydatas, yname, jcdID, datatype) {
      this.chart = this.$echarts.init(this.$refs.echartsHour)
      console.log(this.chart)
      this.chart.clear()
      var dataUnit = ''
      if (datatype === 1) {
        dataUnit = '流量(m³/d)'
      } else {
        dataUnit = '流量(m³/h)'
      }
      var serLists = []
      for (var j = 0; j < ydatas.length; j++) {
        var len = ydatas[j].data.length
        for (var k = 0; k < len; k++) {
          var it = ydatas[j].data[k]
          var it2 = parseFloat(it).toFixed(2)
          ydatas[j].data[k] = it2
        }
      }
      for (var i = 0; i < ydatas.length; i++) {
        // var zdcbcolor = ydatas[i].zdcbcolor
        var bz = ydatas[i].bzz
@@ -186,42 +331,43 @@
            symbol: 'circle', // 折点形状
            symbolSize: 10, // 大小
            smooth: false, // 直线 ,true 为曲线
            itemStyle: {
              normal: {
                color: function (c) { // 根据value 显示不同的折点颜色
                  /* var biaozhuiz
                  for (var i = 0; i < bzzList.length; i++) {
                    if (bzzList[i].name == c.seriesName) {
                      biaozhuiz = bzzList[i].bzhui
                    }
                  }
                  if (c.value > biaozhuiz) {
                    return zdcbcolor
                  } else if (c.value > biaozhuiz * 0.9) {
                    return '#FFA500'
                  } else {
                    return '#33c95f'
                  } */
                },
                lineStyle: { // 折线的颜色
                  color: ydatas[i].zxcolor,
                  width: 5
                },
                borderColor: 'black', // 折点边框的颜色
                label: { // 显示值
                  show: false
                }
              }
            },
            // itemStyle: {
            //   normal: {
            //     color: function (c) { // 根据value 显示不同的折点颜色
            //       // var biaozhuiz
            //       let bzlist = this.bzzList
            //       for (let i = 0; i < this.bzzList.length; i++) {
            //         if (this.bzzList[i].name === c.seriesName) {
            //           this.bz = this.bzzList[i].bzhui
            //         }
            //       }
            //       if (c.value > this.bz) {
            //         return zdcbcolor
            //       } else if (c.value > this.bz * 0.9) {
            //         return '#FFA500'
            //       } else {
            //         return '#33c95f'
            //       }
            //     },
            //     lineStyle: { // 折线的颜色
            //       color: ydatas[i].zxcolor,
            //       width: 5
            //     },
            //     borderColor: 'black', // 折点边框的颜色
            //     label: { // 显示值
            //       show: false
            //     }
            //   }
            // },
            type: 'line',
            data: ydatas[i].data,
            markLine: { // 平均值  和 指标上限
            markLine: { // 平均值 , 和 指标上限
              symbol: 'none',
              data: [{
                label: {
                  normal: {
                    position: 'end',
                    formatter: '' // ydatas[i].name+'标准值' //+'{c}'
                    formatter: ''// ydatas[i].name+'标准值' //+'{c}'
                  }
                },
                name: '标准值',
@@ -242,458 +388,318 @@
            symbolSize: 10, // 大小
            smooth: false, // 直线 ,true 为曲线
            yAxisIndex: 1,
            itemStyle: {
              normal: {
                color: function (c) { // 根据value 显示不同的折点颜色
                  /* var biaozhuiz
                  for (var i = 0; i < bzzList.length; i++) {
                    if (bzzList[i].name == c.seriesName) {
                      biaozhuiz = bzzList[i].bzhui
                    }
                  }
                  if (c.value > 9999999) {
                    return zdcbcolor
                  } else {
                    return '#33c95f'
                  } */
                },
                lineStyle: { // 折线的颜色
                  color: ydatas[i].zxcolor,
                  width: 4
                },
                borderColor: 'black', // 折点边框的颜色
                label: { // 显示值
                  show: false
                }
              }
            },
            // itemStyle: {
            //   normal: {
            //     color: function (c) { // 根据value 显示不同的折点颜色
            //       // var biaozhuiz
            //       for (let i = 0; i < this.bzzList.length; i++) {
            //         if (this.bzzList[i].name === c.seriesName) {
            //           this.bz = this.bzzList[i].bzhui
            //         }
            //       }
            //       if (c.value > 9999999) {
            //         return zdcbcolor
            //       } else {
            //         return '#33c95f'
            //       }
            //     },
            //     lineStyle: { // 折线的颜色
            //       color: ydatas[i].zxcolor,
            //       width: 5
            //     },
            //     borderColor: 'black', // 折点边框的颜色
            //     label: { // 显示值
            //       show: false
            //     }
            //   }
            // },
            type: 'line',
            data: ydatas[i].data
          }
        }
        serLists.push(obj)
      }
      var option =
    {
      /*  title: {
        text: title,
    }, */
      tooltip: { // 提示框
        trigger: 'axis',
        axisPointer: {
          type: 'cross',
          label: {
            color: '#1a4245'
      var option = {
        /*  title: {
          text: title,
      }, */
        tooltip: { // 提示框
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              color: '#1a4245'
            }
          },
          formatter: function (params) {
            var s = params[0].name + '<br />'
            for (var i = 0; i < params.length; i++) {
              // var name = params[i].name
              // 图表title名称
              var seriesName = params[i].seriesName
              // 值
              var value = params[i].value
              // var valueFliter = formatter(value)
              var valueFliter = value
              var maker = params[i].marker
              if (seriesName === 'COD') {
                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#fff21c;"></span>'
              } else if (seriesName === '氨氮') {
                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#00B0F0;"></span>'
              } else if (seriesName === '总磷') {
                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#f48183;"></span>'
              } else if (seriesName === '总氮') {
                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#d9f2f4;"></span>'
              } else {
                maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#9ACD32;"></span>'
              }
              s += maker + seriesName + ':' + valueFliter + '<br />'
            }
            return s
          }
        },
        formatter: function (params) {
          var s = params[0].name + '<br />'
          for (var i = 0; i < params.length; i++) {
            // var name = params[i].name
            // 图表title名称
            var seriesName = params[i].seriesName
            // 值
            var value = params[i].value
            var valueFliter
            if (value === 'NaN') {
              valueFliter = ''
            } else {
              // valueFliter = formatter(value)
            }
            var maker = params[i].marker
            if (seriesName === 'COD') {
              maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#fff21c;"></span>'
            } else if (seriesName === '氨氮') {
              maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#00B0F0;"></span>'
            } else if (seriesName === '总磷') {
              maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#f48183;"></span>'
            } else if (seriesName === '总氮') {
              maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#d9f2f4;"></span>'
            } else {
              maker = '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:#9ACD32;"></span>'
            }
            s += maker + seriesName + ':' + valueFliter + '<br />'
        toolbox: { // 打印等工具
          show: false,
          feature: {
            saveAsImage: {}
          }
          return s
        }
      },
      toolbox: { // 打印等工具
        show: false,
        feature: {
          saveAsImage: {}
        }
      },
      grid: { // 网格
        top: '20%',
        left: '7%',
        bottom: '10%',
        right: '5%'
      },
      legend: {
        data: legend,
        textStyle: {
          color: '#fff'
        }
      },
      dataZoom: [{
        type: 'inside',
        start: 0,
        end: 100
      }, {
        start: 0,
        end: 100,
        show: false,
        handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
        handleSize: '80%',
        handleStyle: {
          color: '#fff',
          shadowBlur: 3,
          shadowColor: 'rgba(0, 0, 0, 0.6)',
          shadowOffsetX: 2,
          shadowOffsetY: 2
        }
      }],
      xAxis: { // x 轴设置
        type: 'category',
        boundaryGap: false,
        axisLabel: { // x轴全部显示
          rotate: 20,
          interval: 0,
          textStyle: {
        },
        grid: { // 网格
          top: '20%',
          left: '5%'
        },
        legend: {
          data: legend
        },
        dataZoom: [{
          type: 'inside',
          start: 0,
          end: 100
        }, {
          start: 0,
          end: 100,
          show: false,
          handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
          handleSize: '80%',
          handleStyle: {
            color: '#fff',
            fontSize: 10
            shadowBlur: 3,
            shadowColor: 'rgba(0, 0, 0, 0.6)',
            shadowOffsetX: 2,
            shadowOffsetY: 2
          }
        }],
        xAxis: { // x 轴设置
          type: 'category',
          boundaryGap: false,
          axisLabel: { // x轴全部显示
            rotate: 20,
            interval: 0,
            textStyle: {
              color: '#fff'
            }
          },
          splitLine: { // 网格垂直线为 虚线
            show: true,
            lineStyle: {
              type: 'dashed'
            }
          },
          axisTick: { // x 轴刻度显示
            show: false
          },
          axisLine: {
            lineStyle: {
              color: '#FFFFFF',
              width: 1// 这里是为了突出显示加上的
            }
          },
          data: xdata
        },
        splitLine: { // 网格垂直线为 虚线
          show: true,
          lineStyle: {
            type: 'dashed'
        yAxis: [{
          type: 'value',
          name: yname,
          // max: function (value) {
          //   var max_val_list = [] // 所有显示折线的标准值
          //   if (bzzList && bzzList.length > 0) {
          //     $.each(bzzList, function (index, item) {
          //       max_val_list.push(item.bzhui)
          //     })
          //   }
          //   max_val_list = max_val_list.sort(function (a, b) {
          //     return a - b
          //   }) // 排序
          //   var ma = value.max > max_val_list[max_val_list.length - 1] ? value.max + 5 : max_val_list[max_val_list.length - 1]
          //   return parseInt(ma)
          // },
          axisLabel: {
            formatter: '{value}',
            textStyle: {
              color: '#fff'
            }
          },
          axisPointer: {
            snap: true
          },
          splitLine: {
            show: false
          }, // y轴 网格线不显示,
          axisLine: {
            lineStyle: {
              color: '#FFFFFF',
              width: 1// 这里是为了突出显示加上的
            }
          }
        },
        axisTick: { // x 轴刻度显示
          show: false
        },
        axisLine: {
          lineStyle: {
            color: '#FFFFFF',
            width: 1// 这里是为了突出显示加上的
        }, {
          type: 'value',
          name: dataUnit,
          axisLabel: {
            formatter: '{value}',
            textStyle: {
              color: '#fff'
            }
          },
          axisPointer: {
            snap: true
          },
          splitLine: {
            show: false
          }, // y轴 网格线不显示,
          // inverse: true,
          // nameLocation: 'start',
          // max:500,
          axisLine: {
            lineStyle: {
              color: '#FFFFFF',
              width: 1// 这里是为了突出显示加上的
            }
          }
        },
        data: xdata
      },
      yAxis: [{
        type: 'value',
        name: yname,
        /* max: function (value) {
          var max_val_list = [] // 所有显示折线的标准值
          if (bzzList && bzzList.length > 0) {
            $.each(bzzList, function (index, item) {
              max_val_list.push(item.bzhui)
            })
          }
          max_val_list = max_val_list.sort(function (a, b) {
            return a - b
          }) // 排序
          var ma = value.max > max_val_list[max_val_list.length - 1] ? value.max + 5 : max_val_list[max_val_list.length - 1]
          return parseInt(ma)
        }, */
        axisLabel: {
          formatter: '{value}',
          textStyle: {
            color: '#fff'
          }
        },
        axisPointer: {
          snap: true
        },
        splitLine: {
          show: false
        }, // y轴 网格线不显示,
        axisLine: {
          lineStyle: {
            color: '#FFFFFF',
            width: 1// 这里是为了突出显示加上的
          }
        }
      }, {
        type: 'value',
        name: dataUnit,
        axisLabel: {
          formatter: '{value}',
          textStyle: {
            color: '#fff'
          }
        },
        axisPointer: {
          snap: true
        },
        splitLine: {
          show: false
        }, // y轴 网格线不显示,
        // inverse: true,
        // nameLocation: 'start',
        // max:500,
        axisLine: {
          lineStyle: {
            color: '#FFFFFF',
            width: 1// 这里是为了突出显示加上的
          }
        }
      }],
      series: serLists
        }],
        series: serLists
      }
      this.chart.setOption(option)
    }
      this.myChart.setOption(option)
      /*
      myChart.on('legendselectchanged', function (params) {
        // console.log(params);
        var StdVal = null
        var op = { yAxis: {} }
        if (params.selected.COD) {
          if (bzzList && bzzList.length > 0) {
            for (let i = 0; i < bzzList.length; i++) {
              if (bzzList[i].name == 'COD') {
                StdVal = bzzList[i].bzhui
              }
            }
          }
          op.yAxis.max = function (value) {
            var ma
            if (value.max < StdVal) {
              ma = StdVal
            } else {
              ma = Math.ceil(value.max)
            }
            return ma
          }
        } else if (params.selected['总氮']) {
          if (bzzList && bzzList.length > 0) {
            for (let i = 0; i < bzzList.length; i++) {
              if (bzzList[i].name == '总氮') {
                StdVal = bzzList[i].bzhui
              }
            }
          }
          op.yAxis.max = function (value) {
            var ma
            if (value.max < StdVal) {
              ma = StdVal
            } else {
              ma = Math.ceil(value.max)
            }
            return ma
          }
        } else if (params.selected['氨氮']) {
          if (bzzList && bzzList.length > 0) {
            for (let i = 0; i < bzzList.length; i++) {
              if (bzzList[i].name == '氨氮') {
                StdVal = bzzList[i].bzhui
              }
            }
          }
          op.yAxis.max = function (value) {
            var ma
            if (value.max < StdVal) {
              ma = StdVal
            } else {
              ma = Math.ceil(value.max)
            }
            return ma
          }
        } else if (params.selected['总磷']) {
          if (bzzList && bzzList.length > 0) {
            for (let i = 0; i < bzzList.length; i++) {
              if (bzzList[i].name == '总磷') {
                StdVal = bzzList[i].bzhui
              }
            }
          }
          op.yAxis.max = function (value) {
            var ma
            if (value.max < StdVal) {
              ma = StdVal
            } else {
              ma = Math.ceil(value.max)
            }
            return ma
          }
        }
        myChart.setOption(op)
      })
      */
      /**
   * 解决myChart.on('click',function(){...})事件重复触发的问题
   * Date: 20200720
   */
      this.myChart.off('click')
      /**
   *  图标点击事件
   *  20190426 add
   * */
      /* myChart.on('click', function (params) {
        // console.log('[监测点id=%s]',jcdID)
        // 获取当前时间,小时
        var nowHours = new Date().Format('hh')
        // console.log('[当前小时是:%s]',nowHours);
        // 点击折线图折点对应的时间
        // 需要传的时间为
        var _date = null
        if (params.name.indexOf('时') != -1) {
          var hours = params.name.substring(0, params.name.indexOf('时'))
          // console.log('[坐标轴对应的时间为%s]',hours);
          if (parseInt(hours) < parseInt(nowHours)) {
            _date = new Date().Format('yyyy-MM-dd') + ' ' + hours + ':00:00'
          } else {
            var currentDate = new Date()
            // 24小时之前时间
            var stringDate = new Date(currentDate.getTime() - 24 * 60 * 60 * 1000).Format('yyyy-MM-dd')
            _date = stringDate + ' ' + hours + ':00:00'
          }
          // console.log('[需要传递的时间为:%s]',_date);
        } else if (params.name.indexOf('日') != -1) {
          var day = params.name.substring(0, params.name.indexOf('日') - 1)
          _date = new Date().Format('yyyy-MM') + '-' + day.trim()
        }
        // todo 调接口 查凭证
        if (params.color != 'red') {
          var poltMtrlId
          var monItemId = 28
          for (var i = 0; i < wrwIDS.length; i++) {
            if (params.seriesName == wrwIDS[i].name) {
              poltMtrlId = wrwIDS[i].id
            }
          }
          getCBMX(jcdID, poltMtrlId, monItemId, _date, function (res) {
            createDivByMouse(res, params.event)
          })
        }
        // 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()
    //   }
    // }
  }
}
</script>
<style scoped lang="less">
.grid-content{
    font-size: 8px;
    background-color: #2e4967;
    text-align: center;
    border-radius: 2px;
    margin-right: 10px;
    padding:0 10px
.grid-content {
  font-size: 8px;
  background-color: #2e4967;
  text-align: center;
  border-radius: 2px;
  margin-right: 10px;
  padding: 0 10px
  //>i{
  //    color: #f00;
  //  }
}
.infomation {
  padding: 5px 10px;
}
.form-echrts {
    width: 100%;
    border-top: 1px solid #396d83;
    //margin: 10px 10px 10px 10px;
    .from-search{
        display: flex;
        padding:5px;
        >div{margin-left: 10px}
        .pickerMon{
            display: flex;
            >div:first-child {
                margin-right: 10px;
            }
            .pickerData{
                flex: 1;
                display: flex;
                >span{line-height: 22px}
                .pickerTable {
                    margin-left: 3px;
                }
            }
        }
        /deep/.el-date-editor--datetime{
            width: 100%;
        }
        /deep/.el-input__inner{
            position: relative;
            width:140px;
            background-color: #2e4967;
            color: #ffffff;
            font-size: 12px;
            height: 24px;
            padding: 0;
            border-color:#00fff6;
            text-align: center;
            //padding-left:20px ;
            //padding: 0!important;
        }
        /deep/.el-input__icon{
            display: block;
            width: 140px;
            height: 22px;
            line-height: 22px;
            cursor: pointer;
            font-size: 0;
        }
        .echatsInput{
            color: #00ffff;
            background-color: #2e4967;
            border: none;
            border-radius: 6px;
            width: 80px;
            height: 22px;
            text-align: center;
        }
        input::-webkit-calendar-picker-indicator {
            opacity: 100;
        }
        .detailbtn{
            background-color:#2e4967;
            text-align: center;
            padding: 0 7px;
            line-height: 24px;
            border-radius: 4px;
            margin-right: 6px;
        }
        .detailbtn:hover{
            box-shadow: 0 0 0.03rem #fff700 !important;
            color:#fff700 !important;
            cursor: pointer;
        }
    }
    .el-dialog-div {
        overflow: auto;
  width: 100%;
  border-top: 1px solid #396d83;
  //margin: 10px 10px 10px 10px;
  .from-search {
    display: flex;
    padding: 5px;
    > div {
      margin-left: 10px
    }
    #echarts {
        margin: 0;
        padding: 0;
    .pickerMon {
      display: flex;
      > div:first-child {
        margin-right: 10px;
      }
      .pickerData {
        flex: 1;
        display: flex;
        > span {
          line-height: 22px
        }
        .pickerTable {
          margin-left: 3px;
        }
      }
    }
    /deep/ .el-date-editor--datetime {
      width: 100%;
    }
    /deep/ .el-input__inner {
      position: relative;
      width: 140px;
      background-color: #2e4967;
      color: #ffffff;
      font-size: 12px;
      height: 24px;
      padding: 0;
      border-color: #00fff6;
      text-align: center;
      z-index: 9999;
      //padding-left:20px ;
      //padding: 0!important;
    }
    /deep/ .el-input__icon {
      display: block;
      width: 140px;
      height: 22px;
      line-height: 22px;
      cursor: pointer;
      font-size: 0;
    }
    .echatsInput {
      color: #00ffff;
      background-color: #2e4967;
      border: none;
      border-radius: 6px;
      width: 80px;
      height: 22px;
      text-align: center;
    }
    input::-webkit-calendar-picker-indicator {
      opacity: 100;
    }
    .detailbtn {
      background-color: #2e4967;
      text-align: center;
      padding: 0 7px;
      line-height: 24px;
      border-radius: 4px;
      margin-right: 6px;
    }
    .detailbtn:hover {
      box-shadow: 0 0 0.03rem #fff700 !important;
      color: #fff700 !important;
      cursor: pointer;
    }
  }
  .el-dialog-div {
    overflow: auto;
  }
  #echarts {
    margin: 0;
    padding: 0;
  }
}
</style>