<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 { width: 270px; height: 857px; position: fixed; top: 80px; right: 0; bottom:0; overflow-x: hidden; // right: 10px; // top: 131px; // background-image: url(/static/img/rightWrapperBg.25536016.png); // background-position-x: -72px; // background-position-y: center; // background-size: 193% 137%; // background-repeat: no-repeat; img { // width: 300px; // height: 800px; // position: absolute; // top:0; // left:0; } & > div { } .right { right: 10px; & > .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; &:last-child{ margin-bottom:0px !important; } &.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>