<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 id="safe-star" class="star"/>
<!-- <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>
<person-table style="flex:1;"/>
<!-- <power-line1 style="flex:1;"/>-->
</div>
</div>
</template>
<script>
// import PowerLine1 from '@/views/popup/components/powerLine1'
import { securityScore, securityFrequency, categoryStatistics } from '@/api/pop'
import * as echarts from 'echarts'
import PersonTable from "@/views/popup/components/personTable";
export default {
name: 'Right',
components: {PersonTable },
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': '*'
},
safeData: [],
num: '*'
}
},
mounted() {
this.initData()
},
methods: {
initStar() {
var myChart = echarts.init(document.getElementById('safe-star'))
const that = this
const option = {
tooltip: {
trigger: 'item'
},
legend: {
right: 20,
top: 10,
data: ['事件频次'],
itemStyle: {
color: '#d5f6fa'
},
textStyle: {
color: '#cce9ff',
fontWeight: 'bold',
fontSize: 14
}
},
radar: [{
indicator: that.safeData.map((item) => {
return { text: item.categoryLevelName, max: that.safeData[0].quantity * 1.2 }
}),
center: ['50%', '55%'],
splitArea: {
areaStyle: {
color: ['#77EADF99', '#26C3BE99', '#64AFE999', '#428BD499'],
shadowColor: 'rgba(0, 0, 0, 0.2)',
shadowBlur: 10
}
},
name: {
color: '#d5f6fa',
fontWeight: 'bold',
fontSize: 14
}
}],
series: [{
type: 'radar',
symbol: 'none',
symbolSize: 4,
lineStyle: {
width: 3,
color: 'rgb(12,228,235)'
},
areaStyle: {
color: new echarts.graphic.RadialGradient(0.1, 0.6, 1, [
{
color: 'rgb(8,91,121,0.8)',
offset: 0
},
{
color: 'rgb(12,228,235,0.8)',
offset: 1
}
])
},
emphasis: {
areaStyle: {
color: new echarts.graphic.RadialGradient(0.1, 0.6, 1, [
{
color: 'rgb(8,91,121,0.5)',
offset: 0
},
{
color: 'rgb(12,228,235,0.5)',
offset: 1
}
])
}
},
data: [{
value: that.safeData.map(item => item.quantity),
name: '事件频次',
symbol: 'rect',
symbolSize: 5,
lineStyle: {
type: 'dashed'
},
label: {
show: true,
fontSize: 14,
fontWeight: 'bold',
color: '#ff9933',
formatter: function (params) {
return params.value
}
}
}]
}]
}
myChart.clear()
myChart.setOption(option, true)
window.addEventListener('resize', function() {
myChart.resize()
})
},
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演播厅']
}
})
categoryStatistics().then(response => {
if (response.code === 200) {
this.safeData = response.data
this.safeData.length = 5
this.initStar()
}
})
// securityFrequency().then(response => {
// if (response.code === 200) {
// this.num = response.data['quantity']
// }
// })
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.star {
width: 100%;
height: 85%;
}
.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>