<template>
  <el-row class="mianBox-af">
    <el-row class="headerBox">
      <el-col class="title">
        <img src="../../../assets/image-af/title1.png" alt="" />
        设备工况
      </el-col>
    </el-row>
    <el-row class="contentBox">
      <el-col>
        <div ref="echartD1" class="echartD"></div>
        <div class="equipmentNumber greenNumber">1280</div>
        <div class="equipmentName">设备总数</div>
      </el-col>
      <el-col>
        <div ref="echartD2" class="echartD"></div>
        <div class="equipmentNumber yellowNumber">1280</div>
        <div class="equipmentName">告警次数</div>
      </el-col>
      <el-col>
        <div ref="echartD3" class="echartD"></div>
        <div class="equipmentNumber blueNumber">1280</div>
        <div class="equipmentName">离线总数</div>
      </el-col>
    </el-row>
  </el-row>
</template>

<script>
import * as echarts from "echarts";
import echartsGet from "./echart";
export default {
  data() {
    return {
      isCheck: "info",
      option: null,
    };
  },
  mounted() {
    echarts.init(this.$refs.echartD1).setOption(echartsGet(.2, ['rgba(47,255,91,0)',`rgba(47,255,91,.4)`,'rgba(47,255,91,1)',],'处置率'));
    echarts.init(this.$refs.echartD2).setOption(echartsGet(.8, ['rgba(225,199,47,0)','rgba(225,199,47,.4)','rgba(225,199,47,1)',],'告警率'));
    echarts.init(this.$refs.echartD3).setOption(echartsGet(.4, ['rgba(5,60,125,0)','rgba(47,174,225,.4)', 'rgba(47,174,225,1)'],'离线率'));
  },
  watch: {
    "$store.state.windowWidth"() {
      echarts.init(this.$refs.echartD1).resize();
      echarts.init(this.$refs.echartD2).resize();
      echarts.init(this.$refs.echartD3).resize();
    },
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.mianBox-af {
  .contentBox{
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    overflow: hidden;
    .el-col{
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      .echartD{
        flex: 1;
        width: 100%;
        height: 100%;
        min-height: 95px;
      }
      .equipmentNumber{
        width: 115px;
        height: 35px;
        font-size: 30px;
        font-weight: 700;
        color: #FFF;
        font-family: "DS", "DS-B", "DS-BB", "DS-BS";
        text-align: center;
        line-height: 35px;
      }
      .equipmentName{
        font-size: 14px;
      }
      .equipmentNumber.greenNumber{
        border-bottom: 2px solid #2FFF5B;
        background: linear-gradient(to bottom, transparent  0%,#2fff5b5c 100%);
      }
      .equipmentNumber.yellowNumber{
        border-bottom: 2px solid #FFC72F;
        background: linear-gradient(to bottom, transparent  0%,#e1c72f66 100%);
      }
      .equipmentNumber.blueNumber{
        border-bottom: 2px solid #2FAEFF;
        background: linear-gradient(to bottom, transparent  0%,#2faee166 100%);
      }
    }
  }
}
</style>