<template>
  <div class="index">
    <div class="index-left"></div>
    <div class="index-right">
      <div class="one-card">
        <div class="one-card-content">
            <div>
              <p>节水量</p>
              <font><span class="font26">4.00</span>m³</font>
            </div>
            <div>
              <p>节碳量</p>
              <font><span class="font26">0.67</span>kg</font>
            </div>
             <div>
              <p>原水箱液位：<span class="font26">{{ baseData.vd500.toFixed(2) }}</span>m</p>
              <p>历史最高：<span class="font26">{{ baseData.vd500Max.toFixed(2) }}</span>m</p>
              <p>历史最低：<span class="font26">{{ baseData.vd500Min.toFixed(2) }}</span>m</p>
            </div>
            <div>
              <p>净水箱液位：<span class="font26">{{ baseData.vd504.toFixed(2) }}</span>m</p>
              <p>历史最高：<span class="font26">{{ baseData.vd504Max.toFixed(2) }}</span>m</p>
              <p>历史最低：<span class="font26">{{ baseData.vd504Min.toFixed(2) }}</span>m</p>
            </div>
             <div>
              <p>UF产水</p>
              <p>瞬时流量：<span class="font26">{{ baseData.vd2700.toFixed(2) }}</span> m³/H</p>
              <p>累计流量：<span class="font26">{{ baseData.vd2716.toFixed(2) }}</span>m³</p>
            </div>
            <div>
              <p>自来水前端</p>
              <p>瞬时流量：<span class="font26">{{ baseData.vd2800.toFixed(2) }}</span> m³/H</p>
              <p>累计流量：<span class="font26">{{ baseData.vd2816.toFixed(2) }}</span>m³</p>
            </div>
            <div >
              <p>供水</p>
              <p>瞬时流量：<span class="font26">{{ baseData.vd2850.toFixed(2) }}</span> m³/H</p>
              <p>累计流量：<span class="font26">{{ baseData.vd2866.toFixed(2) }}</span>m³</p>
            </div>
            <div >
              <p>自来水后端</p>
              <p>瞬时流量：<span class="font26">{{ baseData.vd2750.toFixed(2) }}</span> m³/H</p>
              <p>累计流量：<span class="font26">{{ baseData.vd2766.toFixed(2) }}</span>m³</p>
            </div>
            <div>
              <p>原水水质</p>
              <p>余氯：<span class="font26">{{ baseData.vd2600.toFixed(2) }}</span> mg/L</p>
              <p>浊度：<span class="font26">{{ baseData.vd2610.toFixed(2) }}</span> mg/L</p>
              <p>氨氮：<span class="font26">{{ baseData.vd2620.toFixed(2) }}</span> mg/L</p>
              <p>COD：<span class="font26">{{ baseData.vd2630.toFixed(2) }}</span> mg/L</p>
            </div>
            <div>
              <p>净水水质</p>
              <p>余氯：<span class="font26">{{ baseData.vd2500.toFixed(2) }}</span> mg/L</p>
              <p>浊度：<span class="font26">{{ baseData.vd2510.toFixed(2) }}</span> mg/L</p>
              <p>氨氮：<span class="font26">{{ baseData.vd2520.toFixed(2) }}</span> mg/L</p>
              <p>COD：<span class="font26">{{ baseData.vd2530.toFixed(2) }}</span> mg/L</p>
            </div>
          </div>
        
      </div>
    </div>
  </div>
</template>
  
  <script>
import Menus from "@/components/Menus.vue";
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
import myApi from "@/api/myApi.js";
export default {
  name: "index",
  components: {
    Menus,
  },
  setup() {
    const state = reactive({
      baseData: {
        vd500: 2,
        vd500Max: 12,
        vd500Min: 0.8,
        vd504: 3,
        vd504Max: 11,
        vd504Min: 0.4,
        vd2700: 13.4,
        vd2716: 12.99,
        vd2800: 12.3,
        vd2816: 4.56,
        vd2850: 12.3,
        vd2866: 34.5,
        vd2750: 15.4,
        vd2766: 7.89,
        vd2600: 12,
        vd2610: 3.23,
        vd2620: 23.4,
        vd2630: 12.3,
        vd2500: 12,
        vd2510: 3.23,
        vd2520: 23.4,
        vd2530: 12.3
      }
    });
    onMounted(() => {
      getBaseInfo();
    })
    const getBaseInfo = async () => {
      const res = await myApi.getBaseInfo();
      state.baseData = res.data;
    }
    return {
      ...toRefs(state)
    };
  },
};
</script>
  <style lang="scss" scoped>
.mt10 {
  margin-top: 10px;
}
.index {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  .index-left {
    width: 69%;
    border: 1px solid rgb(179, 174, 174);
  }
  .index-right {
    width: 30%;
    display: flex;
        justify-content: space-between;
        flex-direction: column;
        .one-card {
          width: 100%;
          height: 100%;
          box-shadow: 0 0 8px #99ACB0 inset;
          
          h2 {
            padding: 20px;
            text-align: center;
          }
          .one-card-content {
            width: 100%;
            height: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-around;
            align-items: center;

            >div {
              width: 46%;
              // height: 22%;
              border: 1px solid rgb(197, 195, 195);
              display: flex;
              flex-direction: column;
              background:#3CB6CC;
              // align-items: center;
              justify-content: center;
              text-align: center;
              padding: 10px;
              border-radius: 10px;
              font-size: 20px;
              line-height: 40px;
              margin: 10px 0;
              color: #fff;
            }
          }
        }
  }
}
</style>