<template>
  <div class="risk-identification">
    <div class="title">
      <span class="line"></span>
      <span class="text">风险的识别与管控</span>
    </div>
    <div class="risk-identification__content">
      <div class="check-count">
        <span class="name">安全生产检查</span>
        <span class="value">{{ checkCount }}</span>
      </div>
      <div class="check-result">
        <div class="check-result__item">
          <span class="item-name">今日危险作业数</span>
          <span class="item-value">{{ hazardousWorkCount }}</span>
        </div>
        <div class="check-result__item">
          <span class="item-name">今日施工作业数</span>
          <span class="item-value">{{ constructionWorkCount }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
  import { onMounted, ref } from 'vue';

  const checkCount = ref<number>(0);
  const hazardousWorkCount = ref<number>(0);
  const constructionWorkCount = ref<number>(0);

  onMounted(() => {
    checkCount.value = 270;
    hazardousWorkCount.value = 0;
    constructionWorkCount.value = 0;
  });
</script>

<style scoped lang="scss">
  .title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;

    .line {
      width: 3px;
      height: 16px;
      background: #1777ff;
    }

    .text {
      font-weight: 500;
      font-size: 16px;
      color: #000000;
      line-height: 22px;
    }
  }

  .risk-identification__content {
    width: 310px;
    height: 140px;
    background: linear-gradient(90deg, #ebf3ff 0%, #fafcff 100%);
    border-radius: 4px;
    margin: 0 10px;

    .check-count {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 26px 14px 12px;
      border-bottom: 1px solid rgba(#979797, 0.11);

      .name {
        font-weight: 500;
        font-size: 16px;
        color: #333333;
        line-height: 22px;
      }

      .value {
        font-family: DINAlternate;
        font-weight: 600;
        font-size: 16px;
        color: #333333;
        line-height: 19px;
      }
    }

    .check-result {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 20px 16px 19px 16px;

      .check-result__item {
        display: flex;
        flex-direction: column;
        gap: 4px;

        .item-name {
          font-weight: 400;
          font-size: 14px;
          color: #666666;
          line-height: 20px;
        }

        .item-value {
          font-family: DINAlternate;
          font-weight: 600;
          font-size: 22px;
          color: #333333;
          line-height: 26px;
        }
      }
    }
  }
</style>
