管道基础大数据平台系统开发-【前端】-新系統界面
TreeWish
2023-02-27 27c5590aab433687c58dbf41e9271f71008834f0
src/components/chart/ProjectCategory.vue
@@ -1,19 +1,16 @@
<template>
  <div class="project-category">
    <div class="content">
        <div
          :class="i % 2 ? 'rank2' : 'rank1'"
          v-for="(item, i) in datalist.slice(0, 8)"
          :key="item.projtype"
        >
          <div class="num">{{ item.count }}个</div>
          <div class="name">{{ item.projtype }}</div>
          <div class="bar">
            <img src="~@/assets/img/Screen/leftBar.png" alt="" />
          </div>
        </div>
      <div
        :class="'rank' + i"
        class="rank"
        v-for="(item, i) in datalist.slice(0, 8)"
        :key="item.projtype"
      >
        <div class="num">{{ item.count }}个</div>
        <div class="name">{{ item.projtype }}</div>
        <div class="bar"></div>
      </div>
      <!-- <div class="rank rank2">
        <div class="num">2个</div>
@@ -80,57 +77,98 @@
.project-category {
  position: relative;
  width: 100%;
  height: 100%;
  height: calc(100% - 30px);
  background: url("~@/assets/img/Screen/projectBg.png") center center;
  background-size: 330px 227px;
  .content {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    height: 90%;
    justify-content: space-between;
    .rank1, .rank2 {
      // box-sizing: border-box;
      // display: flex;
      // flex-direction: column;
      // width: 160px;
      // flex: 1;
      height: 25px;
      // align-items: end;
  background-size: 100% 100%;
  .content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    // height: 85%;
    height: 100%;
    .rank {
      width: 35%;
      display: flex;
      flex-direction: column;
      div {
        margin: 2px 0px;
      }
      .num {
        color: #839ecb;
      }
      .name {
        // margin: 6px;
        color: #fff;
      }
      .bar {
        width: 61px;
        height: 3px;
        // background: url("~@/assets/img/Screen/leftBar.png");
        // background-size: 100% 100%;
        img {
          width: 100%;
          height: 100%;
        }
        background-image: url(../../assets/img/Screen/leftBar.png);
        background-size: 100% 100%;
      }
    }
    .rank1 {
    .rank0,
    .rank6 {
      width: 35%;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      text-align: right;
    }
    .rank2 {
    .rank1,
    .rank7 {
      width: 35%;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      text-align: left;
    }
    .rank2,
    .rank4 {
      width: 35%;
      display: flex;
      flex-direction: column;
      justify-items: flex-end;
      div {
        width: 80%;
        display: flex;
        justify-content: flex-end;
        align-items: flex-end;
      }
      .bar {
        margin-left: calc(80% - 61px);
      }
    }
    .rank3,
    .rank5 {
      width: 35%;
      display: flex;
      flex-direction: column;
      justify-items: flex-end;
      div {
        margin-left: 20%;
        width: 80%;
        align-items: flex-end;
        text-align: left;
        .bar {
          display: flex;
          align-items: center;
          justify-items: flex-end;
        }
      }
    }
  }
}
</style>