派生自 wuyushui/SewerAndRainNetwork

chenyabin
2021-04-07 cd80929f0ae8882a98cfe3936b2a96bded1c12d8
src/components/BaseNav/PublicBounced/GasComponents/ECharts.vue
@@ -11,6 +11,7 @@
          <el-button size="mini" round @click="dialogVisible = true">明细表</el-button>
          <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
@@ -20,7 +21,7 @@
            </div>
          </el-dialog>
        </div>
        <div style="width:750px;height:260px;" id="echarts" ref="main">
      <div style="width:100%;height:1.2rem;margin-top:-0.3rem;position:absolute;" id="echarts" ref="main">
        </div>
      </div>
    </div>
@@ -28,6 +29,7 @@
<script>
import PublicDetailedList from '@components/BaseNav/PublicBounced/GasComponents/PublicDetailedList'
export default {
  name: 'ECharts',
  components: {
@@ -200,9 +202,21 @@
    drawChart: function () {
      const myChart = this.$echarts.init(this.$refs.main)
      myChart.setOption(this.options)
      window.onresize = function () {
        var h1 = document.documentElement.clientHeight// 获取屏幕的高度
        if (h1 > 700) {
          myChart.getDom().style.height = 3 + 'rem'
          myChart.getDom().style.width = 6 + 'rem'
        } else {
          myChart.getDom().style.height = 3 + 'rem'
          myChart.getDom().style.width = 6 + 'rem'
        }
        myChart.resize()
      }
    }
  },
  mounted () {
    this.$nextTick(() => {
    this.drawChart()
    const dataWatch = JSON.parse(JSON.stringify(this.$attrs.getWasteWaterMonitoring))
    console.log(dataWatch)
@@ -210,11 +224,15 @@
      this.dataDate.push(dataWatch[i].MonTimeStr.substring(10, 17))
    }
    console.log(this.dataDate)
    })
  }
}
</script>
<style scoped lang="less">
#Tab {
  height: 3rem;
}
    .Infomation {
        margin-left: 10px;
    }
@@ -229,19 +247,22 @@
        border: none;
        padding: 0 15px;
    }
    .form-echrts{
      width: 100%;
      height: 100%;
      border: 1px solid #396d83;
  border-top: 1px solid #396d83;
      //margin: 10px 10px 10px 10px;
      .el-dialog-div{
        //height: 50vh!important;
        overflow: auto;
        //overflow: hidden;
      }
      #echarts {
        margin: 0;
        padding: 0;
    height: 3rem;
        //border: 1px solid #396d83;
        //margin: 10px 10px 10px 10px;
    }