map
ZZJ
2021-10-29 0bb459c121f04f573230fa98de5ffc75b53f9960
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<template>
  <div class="elec-module">
      <div class="title">电量过低预警</div>
 
      <div class="elec-item"
       v-for="(item,index) in warnArr"
       :key="index">
          <div class="left">
              <img src="/images/InternetDevice/电池.png" alt="">
              <div class="colobox" 
              :style="{'width':`${item.elec/100*29}px`,
              'background-color':`${item.elec >= 30 ? 'rgb(37, 174, 109)' : 'rgb(255, 100, 100)'}`}"></div>
              <div class="elec">电量: {{item.elec}}</div>
          </div>
          <warnDescription 
        :warnDes="{code:item.code,
        time:item.time,
        location:item.location}"/>
      </div>
      
  </div>
</template>
 
<script>
import warnDescription from '@/pages/internetEquipment/components/warnDescription'
export default {
    props :{
         warnArr:{
            type: Array
        }
    },
    components :{
        warnDescription
    }
}
</script>
 
<style scoped lang="scss">
 
.elec-module {
    padding: 20px;
    width: 280px;
    height: 292px;
    background-color: #fff;
    box-shadow: 0px 2px 10px rgba(141, 164, 187, 0.25);
    border-radius: 15px;
    overflow-y: scroll;
 
    .title {
        margin-bottom: 10px;
        font-size: 14px;
        font-weight: 700;
        text-align: left;
    }
 
    .elec-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 4px;
        padding: 20px 5px 20px 5px;
        width: 240px;
        height: 78px;
        background: #F9FAFC;
        border-radius: 10px;
 
        .elec {
            font-weight: 700;
        }
 
        .left {
            position: relative;
            img {
                width: 40px;
                height: 20px;
            }
 
            .colobox {
                position: absolute;
                top: 2px;
                left: 10px;
                width: 29px;
                height: 15px;
                border-radius: 2px;
            }
        }
    }
}
</style>