<template> <div class="right"> <div class="block" style="justify-content: center;height: 29%;"> <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">安全防护梯度指标组件</div> <div class="item"> <el-image :src="require('@/assets/popup/safe.png')" class="base-map-image" mode="fill" /> <div class="item-text"> <div class="num">{{list["0"]}}<span class="unit">分</span></div> <div style="color: #B3F3F6;">一期主楼</div> </div> </div> <div class="item"> <el-image :src="require('@/assets/popup/safe.png')" class="base-map-image" mode="fill" /> <div class="item-text"> <div class="num">{{list["1"]}}<span class="unit">分</span></div> <div style="color: #B3F3F6;">二期主楼</div> </div> </div> <div class="item"> <el-image :src="require('@/assets/popup/safe.png')" class="base-map-image" mode="fill" /> <div class="item-text"> <div class="num">{{list["2"]}}<span class="unit">分</span></div> <div style="color: #B3F3F6;">录制楼</div> </div> </div> <div class="item"> <el-image :src="require('@/assets/popup/safe.png')" class="base-map-image" mode="fill" /> <div class="item-text"> <div class="num">{{list["3"]}}<span class="unit">分</span></div> <div style="color: #B3F3F6;">1600演播厅</div> </div> </div> </div> <div class="block" style="flex-direction: column;"> <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">安防事件频次因数组件</div> <div :style="{backgroundImage:'url('+line+')', flex: 1}" class="case-bg"> <div :style="{backgroundImage:'url('+ ball +')'}" class="ball-bg"> <div class="num case-text">{{num}}<span class="unit">次</span></div> <div :style="{backgroundImage:'url('+ bottom +')'}" class="bottom-bg"/> </div> </div> </div> <div class="block" style="flex-direction: column;"> <div :style="{backgroundImage:'url('+titleImg+')'}" class="title">巡视人员分布因数组件</div> <power-line1 style="flex:1;"/> </div> </div> </template> <script> import PowerLine1 from '@/views/popup/components/powerLine1'; import { securityScore, securityFrequency } from '@/api/pop' export default { name: 'Right', components: { PowerLine1 }, data() { return { titleImg: require('@/assets/popup/title.png'), // 背景图片 titleAll: require('@/assets/popup/title-all.png'), // 背景图片 line: require('@/assets/popup/line.png'), // 背景图片 ball: require('@/assets/popup/ball.png'), // 背景图片 bottom: require('@/assets/popup/bottom.png'), // 背景图片 list: { '1': '*', '2': '*', '3': '*' }, num: '*' } }, mounted() { this.initData() }, methods: { initData() { securityScore().then(response => { if (response.code === 200) { this.list['0'] = response.data['一期主楼'] this.list['1'] = response.data['二期主楼'] this.list['2'] = response.data['录制楼'] this.list['3'] = response.data['1600演播厅'] } }) securityFrequency().then(response => { if (response.code === 200) { this.num = response.data['quantity'] } }) } } } </script> <style rel="stylesheet/scss" lang="scss" scoped> .right{ 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: 60px; height: 60px; } .area-map-image{ margin-right: 10px; margin-left: 5px; width: 100%; height: 80%; } .item{ width: 50%; height: 50px; display: flex; justify-content: left; align-items: center; padding: 0 8%; } .item-text{ text-shadow: 0 0 2px #d1ffff; flex: 1; font-weight: bold; text-align: center; font-size: 18px; } .num{ text-shadow: 0 0 5px #ffb441; color: #ffb441; font-size: 20px; padding-top: 2px; } .unit{ color: #B3F3F6; font-size: 14px; margin-left: 1px; } .case-bg{ width: 100%; height: 100%; background-repeat: no-repeat; -webkit-background-size: 100% 100%; background-size: 100% 100%; display: unset; .ball-bg{ position: relative; left: 20%; width: 60%; height: 100%; background-repeat: no-repeat; -webkit-background-size: 100% 100%; background-size: 100% 100%; } .bottom-bg{ position: relative; left: 2%; top: 50%; width: 100%; height: 30%; background-repeat: no-repeat; -webkit-background-size: 100% 100%; background-size: 100% 100%; } .case-text{ font-weight: bold; position: relative; text-align: center; left: 0%; top: 45%; width: 100%; height: 30px; } } } </style>