<template>
  <!-- 今日目的地人员数据大到小 前五 -->
  <div class="main">
    <div class="mian-contain">
      <div class="top">
        <div class="top-tit">
          <img src="../../../assets/arrow.png" alt="" />
          <i>今日目的地人员数据大到小 前五</i>
        </div>
        <div class="top-line">
          <img src="../../../assets/top-line.png" alt="" />
        </div>
      </div>
      <div class="container18">
        <div
          class="item-box"
          v-for="(item, index) in monthWarningList"
          :key="index"
        >
          <div class="title">目的地1</div>
          <div class="item-icon">
            <strong v-for="(item1, index1) in 50" :key="index1">
              <i :class="index1 + 1 <= item.percent ? 'bright' : ''"></i>
            </strong>
            <span>{{ item.num }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      monthWarningList: [
        { name: "", num: 5444, percent: 50 },
        { name: "", num: 5114, percent: 30 },
        { name: "", num: 4810, percent: 20 },
        { name: "", num: 4810, percent: 20 },
        { name: "", num: 3810, percent: 20 },
      ],
    };
  },
  created() {
    this.handleData();
  },
  methods: {
    handleData() {
      const total = 5444;
      this.monthWarningList.forEach((item) => {
        item.percent = Math.trunc((item.num / total) * 50);
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.main {
  width: 455px;
  height: 308px;
  border-radius: 8px;
  // background: rgba(26, 52, 125, 0.95);
  padding: 10px;
}
.top {
  height: 45px;
  .top-tit {
    font-size: 18px;
    font-weight: 600;
    line-height: 23.4px;
    text-align: left;
    color: #ffffff;
    img {
      margin-right: 10px;
    }
  }
  .top-line {
    margin-top: -7px;
  }
}
.mian-contain {
  border-radius: 8px;
  padding: 10px;
  background: rgba(29, 65, 171);
  // overflow: hidden;
  height: 100%;
}
.container18 {
  padding: 0 20px;
  .item-box {
    margin-bottom: 3px;
    .title {
      font-size: 15px;
      font-weight: 500;
      line-height: 22.5px;
      text-align: left;
      color: #f1f3ff;
    }
    .item-icon {
      i {
        display: inline-block;
        width: 3px;
        height: 9px;
        border-radius: 5px;
        // background-color: #4c649e;
        margin-right: 3px;
        margin-top: 7px;
      }
      span {
        color: rgba(227, 232, 255, 0.5);
        font-size: 20px;
        margin-left: 28px;
      }
      .bright {
        background: linear-gradient(270deg, #1890ff 0%, #1ee7e7 100%);
      }
    }
  }
}
</style>
