<template> <div class="left"> <div class="block" style="justify-content: center;height: 29%;padding-top: 10px"> <div class="item"> <el-image :src="require('@/assets/popup/人员.png')" class="base-map-image" mode="fill" /> <div style="color: #B3F3F6;text-shadow: 0 0 2px #d1ffff;"> 一期主楼、录制楼</div> <div class="num">{{list["0"]}}<span class="unit">人</span></div> </div> <div class="item"> <el-image :src="require('@/assets/popup/人员.png')" class="base-map-image" mode="fill" /> <div style="color: #B3F3F6;text-shadow: 0 0 2px #d1ffff;"> 二期主楼</div> <div class="num">{{list["1"]}}<span class="unit">人</span></div> </div> <div class="item"> <el-image :src="require('@/assets/popup/访客.png')" class="base-map-image" mode="fill" /> <div style="color: #B3F3F6;text-shadow: 0 0 2px #d1ffff;"> 今日访客量</div> <div class="num">{{list["2"]}}<span class="unit">人</span></div> </div> <div class="item"> <el-image :src="require('@/assets/popup/今日事件.png')" class="base-map-image" mode="fill" /> <div style="color: #B3F3F6;text-shadow: 0 0 2px #d1ffff;"> 今日事件数</div> <div class="num">{{list["3"]}}<span class="unit">件</span></div> </div> <div class="item"> <el-image :src="require('@/assets/popup/今日处置.png')" class="base-map-image" mode="fill" /> <div style="color: #B3F3F6;text-shadow: 0 0 2px #d1ffff;"> 事件处置数</div> <div class="num">{{list["4"]}}<span class="unit">件</span></div> </div> <div class="item"> <el-image :src="require('@/assets/popup/离线.png')" class="base-map-image" mode="fill" /> <div style="color: #B3F3F6;text-shadow: 0 0 2px #d1ffff;">设备离线率</div> <div class="num">{{list["5"]}}<span class="unit"></span></div> </div> </div> <div class="block" style="flex-direction: column;"> <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">员工通勤安防系数组件</div> <staff-line1 style="flex:1;"/> </div> <div class="block" style="flex-direction: column;"> <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">重点区域防控系数组件</div> <area-bar1 style="flex: 1"/> </div> </div> </template> <script> import StaffLine1 from '@/views/popup/components/staffLine1' import AreaBar1 from '@/views/popup/components/areaBar1' import { getTodayNumber, getPeopleNumber, getDeviceNumber, offlineRate, eventNum } from '@/api/pop' export default { name: 'Left', components: { AreaBar1, StaffLine1 }, data() { return { titleImg: require('@/assets/popup/title.png'), // 背景图片 titleAll: require('@/assets/popup/title-all.png'),// 背景图片 list: { '0': '*', '1': '*', '2': '*', '3': '*', '4': '*', '5': '*' } } }, created() { this.initData() }, methods: { initData() { getPeopleNumber().then(response => { if (response.code === 200) { this.list['0'] = response.data[1] + (response.data[3] ? response.data[3] : 0) this.list['1'] = response.data[2] } }) getTodayNumber().then(response => { if (response.code === 200) { this.list['2'] = response.data['今日访客量'] } }) // getDeviceNumber().then(response => { // if (response.code === 200) { // // this.list['3'] = response.data['设备总数'] // // this.list['4'] = response.data['设备在线率'].replace('%', '') // } // }) offlineRate().then(response => { if (response.code === 200) { this.list['5'] = response.data['设备离线率'] } }) eventNum().then(response => { if (response.code === 200) { this.list['3'] = response.data['今日事件数'] this.list['4'] = response.data['今日事件处置数'] } }) } } } </script> <style rel="stylesheet/scss" lang="scss" scoped> .left{ width: 100%; height: 100%; overflow: hidden; .block{ height: 33%; width: 500px; display: flex; flex-wrap: wrap; background: linear-gradient(to top left, rgba(5, 30, 61, 0.62), #0D3F7E9D); border-radius: 5px; box-shadow: 4px 4px 40px rgba(0, 0, 0, .05); border-color: rgba(0, 0, 0, .05); margin: 10px; } .title{ text-shadow: 0 0 5px #d1ffff; width: 500px; height: 35px; background-repeat: no-repeat; -webkit-background-size: 100% 100%; background-size: 100% 100%; color: white; font-weight: bold; padding-top: 8px; padding-left: 30px; font-family: 黑体; letter-spacing: 1px; } .base-map-image{ width: 45px; height: 40px; } .area-map-image{ margin-right: 10px; margin-left: 5px; width: 100%; height: 80%; } .item{ width: 33%; font-weight: bold; text-align: center; font-size: 15px; .num{ text-shadow: 0 0 5px #ffb441; color: #ffb441; font-size: 18px; padding-top: 2px; } .unit{ color: #B3F3F6; font-size: 13px; } } } </style>