zhangzengfei
2022-07-20 4a800a8fc83c6bd1f86a8e847b079a51a7532c09
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
<template>
  <div class="helmet-equipment">
    <helemetHead />
    <mapIndex />
    <div class="footer">
      <realTimeModule :boundArr="boundArr" />
      <elecModule :lowBatteryArr="lowBatteryArr" />
      <historyModule :warnArr="warnArr" />
    </div>
  </div>
</template>
 
<script>
import helemetHead from "@/pages/internetEquipment/components/helemetHead";
import mapIndex from "@/pages/internetEquipment/module/mapIndex";
import realTimeModule from "@/pages/internetEquipment/module/realTimeModule";
import elecModule from "@/pages/internetEquipment/module/elecModule";
import historyModule from "@/pages/internetEquipment/module/historyModule";
import { lowBattery, historyWarn, outBound } from "@/api/helemt";
 
export default {
  async created() {
    const res = await lowBattery();
    this.lowBatteryArr = res.data.items;
 
    const res2 = await historyWarn();
    console.log(res2.data);
    this.warnArr = res2.data.items;
 
    const res3 = await outBound();
    this.boundArr = res3.data.items;
  },
  data() {
    return {
      boundArr: [],
      warnArr: [],
      lowBatteryArr: [],
    };
  },
  components: {
    helemetHead,
    mapIndex,
    realTimeModule,
    elecModule,
    historyModule,
  },
};
</script>
 
<style scoped lang="scss">
* {
  box-sizing: border-box;
}
 
.helmet-equipment {
  position: relative;
  padding: 20px;
  width: 100%;
  height: 100%;
  background: #fbfcfe;
 
  .map-index {
    margin: 20px 0;
  }
 
  .footer {
    position: absolute;
    top: 540px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    display: flex;
    justify-content: start;
    color: #4f4f4f;
    .real-time-module {
      flex: 2.35;
      height: 100%;
    }
    .elec-module {
      flex: 1;
      margin: 0 20px;
      height: 100%;
    }
 
    .history-module {
      flex: 1;
      height: 100%;
    }
  }
}
</style>