<template>
  <div class="sewage">
    <div class="reply" :style="{ color: color }">污水监测</div>
    <div class="sewage-box">
      <div class="box" v-for="item in echartList" :key="item.id">
        <chart-sewage-corona :config-obj="item"></chart-sewage-corona>
      </div>
    </div>
    <br>
    <div class="echarts-line">
      <div class="reply1" :style="{ color: color }">污水监测</div>
      <div class="echarts-box" v-for="item in lineList" :key="item.id">
        <chart-sewage-line :line-config="item"></chart-sewage-line>
      </div>
    </div>
  </div>
</template>

<script>
import ChartSewageCorona from "@/views/Zoology/chart/ChartSewageCorona";
import ChartSewageLine from "@/views/Zoology/chart/ChartSewageLine";
import { mapState } from 'vuex'
export default {
  name: "Sewage",
  components: {
    ChartSewageCorona,
    ChartSewageLine
  },
  computed: {
    ...mapState(['color'])
  },
  data() {
    return {
      echartList: [
        {
          id: 1,
          data: 52.1,
          unit: 'mg/L',
          max: 200,
          name: '总氮'
        },
        {
          id: 2,
          data: 52.1,
          unit: 'mg/L',
          max: 200,
          name: '化学需氧量'
        },
        {
          id: 3,
          data: 52.1,
          unit: 'mg/L',
          max: 200,
          name: '总磷'
        },
        {
          id: 4,
          data: 52.1,
          unit: 'mg/L',
          max: 200,
          name: '氨氮量'
        },
        {
          id: 5,
          data: 1124,
          unit: 'T/HT',
          max: 2000,
          name: '累计流量'
        },
      ],
      lineList: [
        {
          id: 1,
          unit: 'mg/L',
          time: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', '测试月'],
          data: [120, 132, 101, 134, 90, 230, 210, 210, 245, 203, 124, 214, 210],
          name: '总氮'
        },
        {
          id: 2,
          unit: 'mg/L',
          time: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', '测试月'],
          data: [120, 132, 101, 134, 90, 230, 210, 210, 245, 203, 124, 214, 210],
          name: '化学需氧量'
        },
        {
          id: 3,
          unit: 'mg/L',
          time: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', '测试月'],
          data: [120, 132, 101, 134, 90, 230, 210, 210, 245, 203, 124, 214, 210],
          name: '总磷'
        },
        {
          id: 4,
          unit: 'mg/L',
          time: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', '测试月'],
          data: [120, 132, 101, 134, 90, 230, 210, 210, 245, 203, 124, 214, 210],
          name: '氨氮量'
        },
      ]
    }
  }
}
</script>

<style scoped>
  .sewage{
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 20px 20px 0 20px;
  }
  .reply {
    width: 100%;
    border: 1px solid #ddd;
    height: 50px;
    background-color: #F3F3F3;
    line-height: 50px;
    font-size: 18px;
    box-sizing: border-box;
    padding-left: 20px;
  }
  .sewage-box {
    width: 100%;
    height: 300px;
    display: flex;
    justify-content: space-between;
    border: 1px solid #ddd;
    border-top: 0;
  }
  .box {
    width: 19%;
    height: 100%;
  }
  .echarts-line {
    width: 100%;
    border: 1px solid #ddd;
  }
  .reply1 {
    width: 100%;
    height: 50px;
    background-color: #F3F3F3;
    line-height: 50px;
    font-size: 18px;
    box-sizing: border-box;
    padding-left: 20px;
  }
  .echarts-box {
    width: 100%;
    height: 400px;
    border-top: 1px solid #ddd;
  }
</style>
