From dff9fb32c1bac52d378a6d196f670b92610c01d3 Mon Sep 17 00:00:00 2001 From: ZZJ <zzjdsg2300@163.com> Date: 星期四, 16 十二月 2021 17:21:49 +0800 Subject: [PATCH] 自适应2 --- src/pages/internetEquipment/views/helemetEquipment.vue | 173 +++++++++++++++++++-------------------------------------- 1 files changed, 59 insertions(+), 114 deletions(-) diff --git a/src/pages/internetEquipment/views/helemetEquipment.vue b/src/pages/internetEquipment/views/helemetEquipment.vue index 31a83f4..d9e407a 100644 --- a/src/pages/internetEquipment/views/helemetEquipment.vue +++ b/src/pages/internetEquipment/views/helemetEquipment.vue @@ -3,122 +3,48 @@ <helemetHead /> <mapIndex /> <div class="footer"> - <realTimeModule :warnArr="warnArr"/> - <elecModule :warnArr="warnArr"/> - <historyModule :warnArr="warnArr"/> + <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 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 { - data (){ + 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 { - warnArr:[{ - code:"A100640819DA3B", - image:"/images/settings/background.png", - location:"鏈濋槼绉戞妧鍥�", - time:"2021-09-21 12:23", - longitude:"23.2344", - latitude:"45.4455", - warn:"鏈湪鐢靛瓙鍥存爮鍖哄煙" - },{ - code:"A100640819DA3B", - image:"/images/settings/background.png", - location:"鏈濋槼绉戞妧鍥�", - time:"2021-09-21 12:23", - longitude:"23.2344", - latitude:"45.4455", - warn:"鏈湪鐢靛瓙鍥存爮鍖哄煙" - }, - { - code:"A100640819DA3B", - image:"/images/settings/background.png", - location:"鏈濋槼绉戞妧鍥�", - time:"2021-09-21 12:23", - longitude:"23.2344", - latitude:"45.4455", - warn:"鏈湪鐢靛瓙鍥存爮鍖哄煙" - }, - { - code:"A100640819DA3B", - image:"/images/settings/background.png", - location:"鏈濋槼绉戞妧鍥�", - time:"2021-09-21 12:23", - longitude:"23.2344", - latitude:"45.4455", - warn:"鏈湪鐢靛瓙鍥存爮鍖哄煙" - }, - { - code:"A100640819DA3B", - image:"/images/settings/background.png", - location:"鏈濋槼绉戞妧鍥�", - time:"2021-09-21 12:23", - longitude:"23.2344", - latitude:"45.4455", - warn:"鏈湪鐢靛瓙鍥存爮鍖哄煙" - }, - { - code:"A100640819DA3B", - image:"/images/settings/background.png", - location:"鏈濋槼绉戞妧鍥�", - time:"2021-09-21 12:23", - longitude:"23.2344", - latitude:"45.4455", - warn:"鏈湪鐢靛瓙鍥存爮鍖哄煙" - }, - { - code:"A100640819DA3B", - image:"/images/settings/background.png", - location:"鏈濋槼绉戞妧鍥�", - time:"2021-09-21 12:23", - longitude:"23.2344", - latitude:"45.4455", - warn:"鏈湪鐢靛瓙鍥存爮鍖哄煙" - }, - { - code:"A100640819DA3B", - image:"/images/settings/background.png", - location:"鏈濋槼绉戞妧鍥�", - time:"2021-09-21 12:23", - longitude:"23.2344", - latitude:"45.4455", - warn:"鏈湪鐢靛瓙鍥存爮鍖哄煙" - }, - { - code:"A100640819DA3B", - image:"/images/settings/background.png", - location:"鏈濋槼绉戞妧鍥�", - time:"2021-09-21 12:23", - longitude:"23.2344", - latitude:"45.4455", - warn:"鏈湪鐢靛瓙鍥存爮鍖哄煙" - }, - { - code:"A100640819DA3B", - image:"/images/settings/background.png", - location:"鏈濋槼绉戞妧鍥�", - time:"2021-09-21 12:23", - longitude:"23.2344", - latitude:"45.4455", - warn:"鏈湪鐢靛瓙鍥存爮鍖哄煙" - }] - } + boundArr: [], + warnArr: [], + lowBatteryArr: [], + }; }, components: { helemetHead, mapIndex, realTimeModule, elecModule, - historyModule - } - -} + historyModule, + }, +}; </script> <style scoped lang="scss"> @@ -127,20 +53,39 @@ } .helmet-equipment { - padding: 20px; - width: 100%; - height: 100%; - background: #FBFCFE; + position: relative; + padding: 20px; + width: 100%; + height: 100%; + background: #fbfcfe; - .map-index { - margin: 20px 0; + .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%; } - .footer { - height: 292px; - display: flex; - justify-content: space-between; - color: #4F4F4F; + .history-module { + flex: 1; + height: 100%; } + } } </style> \ No newline at end of file -- Gitblit v1.8.0