Right.vue 3.24 KB
Newer Older
纪泽龙's avatar
纪泽龙 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
<template>
  <div class="wrapper">
    <!-- <img src="/static/img/rightWrapperBg.25536016.png" alt=""> -->
    <div class="right">
      <template v-for="(item, index) in list">
        <div
          class="right-content"
          :class="{ three: index == 2 }"
          :key="item.type"
        >
          <div class="text-icon">
            <i
              class="iconfont"
              :class="[iconClass(item), { iconFontSize: item.type == 4 }]"
            ></i>
          </div>
          <div class="text">
            <div class="top">{{ typeName[item.type] }}</div>
            <div class="bottom">
              {{ item.number }}{{ item.type == 99 ? "M" : "个" }}
            </div>
          </div>
        </div>
      </template>
    </div>
  </div>
</template>

<script>
import { listDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";

export default {
  props: {
    list: {
      type: Array,
    },
  },
  data() {
    return {
      timer: null,
      repeatFinshed: false,
      typeName: {
        1: "调压箱",
        2: "阀门井",
        3: "流量计",
        4: "压力表",
        99: "管线长度",
      },
      iconList: {
        1: "icon-tyxgs",
        2: "icon-fmjgs",
        3: "icon-lljgs",
        4: "icon-ylbgs",
        99: "icon-gdcd",
      },
    };
  },
  created() {},
  methods: {
    iconClass(item) {
      return this.iconList[item.type];
    },
  },
};
</script>

<style lang="scss"  scoped>
.wrapper {
69 70
  width: 270px;
  height: 700px;
纪泽龙's avatar
纪泽龙 committed
71
  position: absolute;
纪泽龙's avatar
纪泽龙 committed
72
  top: 40px;
纪泽龙's avatar
纪泽龙 committed
73
  right: 0;
74
  bottom:0;
纪泽龙's avatar
纪泽龙 committed
75 76 77
  overflow-x: hidden;
  // right: 10px;
  // top: 131px;
纪泽龙's avatar
纪泽龙 committed
78 79 80 81 82
  // background-image: url(/static/img/rightWrapperBg.25536016.png);
  // background-position-x: -72px;
  // background-position-y: center;
  // background-size: 193% 137%;
  // background-repeat: no-repeat;
纪泽龙's avatar
纪泽龙 committed
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
  img {
    // width: 300px;
    // height: 800px;
    // position: absolute;
    // top:0;
    // left:0;
  }

  & > div {
  }
  .right {
    position: absolute;
    right: 10px;
    top: 51px;
    & > .right-content {
      // background-color: #fff;
      width: 247px;
      height: 104px;
      margin-bottom: 29px;
      box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.16);
      background-image: url(../../../../assets/images/listBg.png);
      margin-right: 10px;
      display: flex;
106 107 108
      &:last-child{
        margin-bottom:0px !important;
      }
纪泽龙's avatar
纪泽龙 committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
      &.three {
        margin-right: 0px;
      }
      // align-items: center;
      .text-icon {
        line-height: 102px;
        padding-left: 28px;
        margin-right: 22px;
        margin-left: 30px;
        i {
          color: #7bf8f4;
          font-size: 60px;
        }
      }
      .text {
        font-size: 14px;
        padding-top: 16px;
        .top {
          color: #fff;
          margin-top: 7px;
          margin-bottom: 10px;
          font-weight: 600;
        }
        .bottom {
          color: #7bf8f4;
        }
      }
    }
  }
  // 单独调整下最后一个icon的大小
  .iconFontSize {
    font-size: 50px !important;
  }
  .fade-enter-to,
  .fade-leave {
    opacity: 1;
  }
  .fade-leave-active {
    transition: opacity 0.5s;
  }
  .fade-enter-active {
    transition: opacity 0s;
  }
  .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
    opacity: 0;
  }
}
</style>