<template>
  <!-- 安全检测 -->
  <div class="box-1">
    <div class="detection-top"> </div>
    <div class="flex">
      <div class="monitor">
        <div class="t-title">
          <span>监控点位统计</span>
        </div>
        <div class="monitor-statistics">
          <img class="monitor-statistics-icon" src="@/assets/images/t-ico-0.png" />
          <div class="monitor-statistics-item">
            <span class="monitor-statistics-item__label">监控点位</span>
            <countup class="monitor-statistics-item__value" end-val="895" />
          </div>
          <div class="monitor-statistics-item">
            <span class="monitor-statistics-item__label">核心点位</span>
            <countup class="monitor-statistics-item__value" end-val="895" />
          </div>
          <div class="monitor-statistics-item">
            <span class="monitor-statistics-item__label">拥堵次数</span>
            <countup class="monitor-statistics-item__value" end-val="895" />
          </div>
        </div>
        <div class="bg">
          <Title3 title="今日异常告警" />
          <alarmToday />
        </div>
      </div>
      <div class="traffic">
        <div class="t-title">
          <span>交通信息</span>
        </div>
        <div class="traffic-statistics">
          <img class="traffic-statistics-icon" src="@/assets/images/t-ico-2.png" />
          <div class="traffic-statistics-item">
            <span class="traffic-statistics-item__label">当前告警总数</span>
            <countup class="traffic-statistics-item__value" end-val="895" />
          </div>
          <div class="traffic-statistics-item">
            <span class="traffic-statistics-item__label">异常告警总数</span>
            <countup class="traffic-statistics-item__value" end-val="895" />
          </div>
          <div class="traffic-statistics-item">
            <span class="traffic-statistics-item__label">已解除告警数</span>
            <countup class="traffic-statistics-item__value" end-val="895" />
          </div>
        </div>
        <div class="bg">
          <Title3 title="异常告警占比" />
          <div class="flex">
            <alarmRate :dataList="dataList" />
            <alarmList />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
  import countup from 'vue-countup-v3'
  import alarmRate from './alarmRate'
  import alarmList from './alarmList'
  import alarmToday from './alarmToday'

  const dataList = ref([
    {
      name: '云阳',
      value: 20
    },
    {
      name: '奉节',
      value: 10
    },
    {
      name: '巫山',
      value: 70
    }
  ])
  onMounted(() => {})
</script>
<style lang="scss" scoped>
  .box-1 {
    margin-top: vh(120);
    width: vw(820);
    height: vh(950);
    background: linear-gradient(321deg, #0b2f64 0%, #062b57 91%, rgba(5, 40, 79, 0) 100%);
    border-radius: 0px 0px 0px 0px;
    .detection-top {
      width: 100%;
      height: vh(580);
      background-color: #fff;
      .map-img {
        width: 100%;
        height: 100%;
      }
    }

    .monitor {
      width: vw(405);
      margin-right: vw(8);
      &-statistics {
        height: vh(70);
        display: flex;
        align-items: center;
        justify-content: space-evenly;
        background-image: url('@/assets/images/i-data-bg-1.png');
        background-size: 100% 100%;
      }
      &-statistics-icon {
        width: vw(45);
        height: vw(48);
      }
      &-statistics-item {
        &__label {
          font-weight: 400;
          font-size: vw(14);
          color: #fff;
        }
        &__value {
          margin-top: vh(10);
          font-weight: bold;
          font-size: vw(24);
          color: #ffffff;
        }
        &:nth-child(4) {
          .monitor-statistics-item__value {
            color: #e21b1b;
          }
        }
      }
    }
    .traffic {
      width: vw(405);
      &-statistics {
        height: vh(70);
        display: flex;
        align-items: center;
        justify-content: space-evenly;
        background-image: url('@/assets/images/i-data-bg-1.png');
        background-size: 100% 100%;
      }
      &-statistics-icon {
        width: vw(45);
        height: vw(48);
      }
      &-statistics-item {
        &__label {
          font-weight: 400;
          font-size: vw(14);
          color: #fff;
        }
        &__value {
          margin-top: vh(10);
          font-weight: bold;
          font-size: vw(24);
          color: #e21b1b;
          text-align: center;
        }
        &:nth-child(4) {
          .traffic-statistics-item__value {
            color: rgba(167, 0, 0, 0.6);
          }
        }
      }
    }
    .bg {
      padding: vw(5);
      margin-top: vh(8);
      background-image: url('@/assets/images/bg-3.png');
      background-size: 100% 100%;
      &:nth-child(1) {
        margin-right: vw(10);
      }
    }
    .t-title {
      margin: vh(10) auto;
      width: 100%;
      height: vh(32);
      font-weight: 800;
      font-size: vw(16);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      background-image: url('@/assets/images/title-4.png');
      background-size: 100% 100%;
    }
  }
</style>
