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
90
91
92
93
94
95
| <template>
| <div class="elec-module">
| <div class="title">电量过低预警</div>
|
| <div class="elec-item" v-for="(item, index) in lowBatteryArr" :key="index">
| <div class="left">
| <img src="/images/InternetDevice/电池.png" alt="" />
| <div
| class="colobox"
| :style="{
| width: `${(item.battery / 100) * 29}px`,
| 'background-color': `${
| item.battery >= 30 ? 'rgb(37, 174, 109)' : 'rgb(255, 100, 100)'
| }`,
| }"
| ></div>
| <div class="elec">电量: {{ item.battery }}</div>
| </div>
| <warnDescription
| :warnDes="{
| code: item.device_sn,
| time: item.updated_at,
| longitude: item.lng,
| latitude: item.lat,
| }"
| />
| </div>
| </div>
| </template>
|
| <script>
| import warnDescription from "@/pages/internetEquipment/components/warnDescription";
| export default {
| props: {
| lowBatteryArr: {
| 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: 5px;
| width: 29px;
| height: 15px;
| border-radius: 2px;
| }
| }
| }
| }
| </style>
|
|