<template>
  <!-- 安全检测 -->
  <div class="box-detection">
    <!-- 地图 -->
    <div class="detection-top">
      <!-- <Map /> -->
    </div>
    <div class="detection-bom 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="核心点位拥堵次数" />
          <alarmRate />
        </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="pt-20 chart-p">
            <div class="check-label">
              <span class="active">平均</span>
              <span>最大</span>
              <span>最小</span>
            </div>
            <Line />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

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

  onMounted(() => {})
</script>
<style lang="scss" scoped>
  .chart-p {
    position: relative;
    .check-label {
      position: absolute;
      right: vw(20);
      top: vh(15);
      span {
        min-width: vw(55);
        padding: vw(5);
        background: linear-gradient(270deg, rgba(8, 41, 86, 0.16) 0%, #0b61b4 100%);
        border-radius: vw(50);
        margin-left: vw(5);
        display: inline-block;
        font-weight: 400;
        font-size: vw(13);
        color: #0084ff;
        text-align: center;
        font-style: normal;
        text-transform: none;
      }
      .active {
        background: linear-gradient(270deg, #37d8fc 0%, #0084ff 100%);
        border-radius: vw(50);
        border: 1px solid rgba(0, 114, 220, 0.3);
        color: #fff;
      }
    }
  }
  .box-detection {
    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>
