qa-regulatory-gwj-vue/src/views/map/components/zhongda.vue

540 lines
22 KiB
Vue
Raw Normal View History

2023-11-07 10:04:37 +08:00
<template>
<div class="renyuan">
<div class="block1">
<div class="options">
<div v-for="(item,index) in block1OptionsList" :key="index" class="option">
{{ item.title }}<count-to :start-val="0" :end-val="+item.count" :duration="3600"/>
</div>
</div>
</div>
<div class="block2">
<layout-title title="重大危险源统计"/>
<div class="content">
<div id="main2"/>
</div>
</div>
<div class="block3">
<layout-title title="危险源列表"/>
<div class="content">
<div class="table">
<div class="tr">
<div class="td">危险源名称</div>
<div class="td">液位</div>
<div class="td">温度</div>
<div class="td">状态</div>
</div>
<div v-infinite-scroll="false" :infinite-scroll-disabled="false" class="scroll">
<div v-for="(item,index) in block3List" :key="index" class="tr">
<div class="td">{{ item.MAJORDANGERSOURCE_NAME }}</div>
<div class="td">{{ item.STORAGETANK_LIQUIDLEVEL }}</div>
<div class="td">{{ item.STORAGETANK_TEMPERATURE }}</div>
<div class="td">
<span v-if="item.MAJORDANGERSOURCE_STATUS == 1"></span>
<span v-if="item.MAJORDANGERSOURCE_STATUS == 2"></span>
<span v-if="item.MAJORDANGERSOURCE_STATUS == 3"></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="block4">
<layout-title title="报警处置情况"/>
<div class="content">
<div id="main3"/>
</div>
</div>
<div class="block5">
<layout-title title="报警信息"/>
<div class="content">
<div class="table">
<div class="tr">
<div class="td">设备名称</div>
<div class="td">报警时间</div>
<div class="td">处置状态</div>
</div>
<div v-infinite-scroll="false" :infinite-scroll-disabled="false" class="scroll">
<div v-for="(item,index) in block5List" :key="index" class="tr">
<div class="td">{{ item.MAJORDANGERSOURCE_NAME }}</div>
<div class="td">{{ item.CREATTIME }}</div>
<div class="td">
<span v-if="item.DISPOSAL_STATUS == -1"></span>
<span v-if="item.DISPOSAL_STATUS == 0"></span>
<span v-if="item.DISPOSAL_STATUS == 1"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import layoutTitle from './title.vue'
import CountTo from 'vue-count-to'
import * as echarts from 'echarts'
import { requestFN } from '@/utils/request'
let myChart2 = null
let myChart3 = null
export default {
components: {
CountTo,
layoutTitle
},
data() {
return {
block1OptionsList: [],
block3List: [],
block5List: [],
loading: false,
currentPage: 1,
count: 0,
totalPage: 0
}
},
mounted() {
window.onresize = function() {
myChart2 && myChart2.resize()
myChart3 && myChart3.resize()
}
// this.initEcharts2()
this.getFindDeclarationLevelChartData()
this.getFindAlarmDisposalChartData()
},
beforeDestroy() {
myChart2 = null
myChart3 = null
},
created() {
this.getFindMajorDangerSourceListAll()
this.getListDisposal()
this.getFindMajorDangerSourceCount()
},
methods: {
initEcharts1(o) {
myChart2 = echarts.init(document.querySelector('#main2'))
const img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMYAAADGCAYAAACJm/9dAAABS2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxMzggNzkuMTU5ODI0LCAyMDE2LzA5LzE0LTAxOjA5OjAxICAgICAgICAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIi8+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgo8P3hwYWNrZXQgZW5kPSJyIj8+IEmuOgAAE/9JREFUeJztnXmQVeWZxn/dIA2UgsriGmNNrEQNTqSio0IEFXeFkqi4kpngEhXjqMm4MIldkrE1bnGIMmPcUkOiIi6gJIragLKI0Songo5ZJlHGFTADaoRuhZ4/nnPmnO4+l+7bfc85d3l+VV18373n3Ptyvve53/5+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ELw5gELAxjErAwjEnAwjAmAQvDmAQsDGMSsDCMScDCMCYBC8OYBCwMYxKwMIxJwMIwJgELw5gELAxjErAwjEnAwjAmAQvDmAQsDGMSsDCMScDCMCYBC8OYBCwMYxKwMIxJwMIwJgELw5gELAxjErAwjEnAwj
const trafficWay = o.seriesData
const data = []
const color = ['#ee0e44', '#fc5600', '#9628a3', '#fedc00']
for (let i = 0; i < trafficWay.length; i++) {
data.push(
{
value: trafficWay[i].value,
name: trafficWay[i].name,
itemStyle: {
normal: {
borderWidth: 5,
shadowBlur: 20,
borderColor: color[i],
shadowColor: color[i]
}
}
},
{
value: 2,
name: '',
itemStyle: {
normal: {
label: {
show: false
},
labelLine: {
show: false
},
color: 'rgba(0, 0, 0, 0)',
borderColor: 'rgba(0, 0, 0, 0)',
borderWidth: 0
}
}
}
)
}
const seriesOption = [
{
name: '',
type: 'pie',
clockWise: false,
radius: [55, 59],
hoverAnimation: false,
itemStyle: {
normal: {
label: {
show: false
},
labelLine: {
show: false
}
}
},
data: data
}
]
const option = {
color: color,
graphic: {
elements: [
{
type: 'image',
z: 3,
style: {
image: img,
width: 88,
height: 88
},
left: 'center',
top: 'center'
}
]
},
tooltip: {
trigger: 'item'
},
legend: {
icon: 'circle',
orient: 'vertical',
data: ['一级', '二级', '三级', '四级'],
right: '30px',
top: 'center',
textStyle: {
color: '#fff'
},
itemGap: 10
},
series: seriesOption
}
myChart2.setOption(option)
},
initEcharts2(o) {
myChart3 = echarts.init(document.querySelector('#main3'))
const data = o
const series = []
for (let i = 0; i < data.seriesData.length; i++) {
series.push({
name: data.legendData[i],
type: 'bar',
data: data.seriesData[i]
})
}
const option = {
color: ['#3db1ee', '#0def67', '#fc5008'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {
left: '2%',
right: '5%',
bottom: '12%',
top: '16%',
containLabel: true
},
legend: {
top: 0,
data: data.legendData,
textStyle: {
color: '#fff'
}
},
dataZoom: [
{
show: true,
height: 5,
xAxisIndex: [0],
bottom: '5%',
right: '5%',
start: 0,
end: 50,
moveHandleSize: '3',
moveHandleStyle: {
color: '#2a569e'
},
fillerColor: '#2a569e',
textStyle: {
color: 'transparent'
},
borderColor: '#3a7a95'
},
{
type: 'inside',
show: true,
start: 0,
end: 25
}
],
xAxis: {
type: 'category',
data: data.xAxisData,
axisLabel: {
rotate: 45,
textStyle: {
color: 'rgba(255,255,255,0.5)'
}
},
axisLine: {
show: true,
lineStyle: {
color: 'rgba(255,255,255,0.5)'
}
}
},
yAxis: {
type: 'value',
axisLine: {
show: true,
lineStyle: {
color: 'rgba(255,255,255,0.5)'
}
},
splitLine: {
show: false
}
},
series
}
myChart3.setOption(option)
},
// 重大危险源统计
getFindDeclarationLevelChartData() {
requestFN('/api/homemajor/findDeclarationLevelChartData').then(res => {
this.$nextTick(() => {
this.initEcharts1(res.chartData)
})
})
},
// 危险源列表
getFindMajorDangerSourceListAll() {
requestFN('/api/homemajor/findMajorDangerSourceListAll').then(res => {
if (res.varList) {
// created by liuJiaNan description:数据展示多条可能出现滚动调所以只展示3条
this.block3List = []
this.block3List = res.varList
}
})
},
// 报警信息
getListDisposal() {
requestFN('/api/homemajor/listDisposal').then(res => {
if (res.varList) {
// created by liuJiaNan description:数据展示多条可能出现滚动调所以只展示3条
this.block5List = []
this.block5List = res.varList
}
})
},
getFindMajorDangerSourceCount() {
requestFN('/api/homemajor/findMajorDangerSourceCount').then(res => {
this.block1OptionsList = [
{ title: '重大危险源', count: res.pd.COUNTSOURCE },
{ title: '监测点数', count: res.pd.COUNTSOURCE * 2 },
{ title: '监测天数', count: res.pd.COUNTDAYS }
]
})
},
getFindDisposalCount() {
requestFN('/api/homemajor/findDisposalCount').then(res => {
this.top_risk_list1 = [
{ title: '报警数', value: res.pd.COUNTALARM },
{ title: '已处置', value: res.pd.COUNTDISPOSED },
{ title: '处置中', value: res.pd.COUNTDISPOSAL }
]
})
},
getFindAlarmChartData() {
requestFN('/api/homemajor/findAlarmChartData').then(res => {
this.$nextTick(() => {
this.initEcharts3(res.chartData)
})
})
},
getVideoInfo(id) {
requestFN('/api/homemajor/getVideoInfo', { VIDOMANAGER_ID: id }).then(res => {
this.$nextTick(() => {
this.videoForm = res.pd
this.dialogVideo = true
})
})
},
getFindAlarmDisposalChartData() {
requestFN('/api/homemajor/findAlarmDisposalChartData').then(res => {
this.$nextTick(() => {
this.initEcharts2(res.chartData)
})
})
},
initMap() {
this.iframeSrc = config.weburl + 'static/mapshowimage.html?t=' + Math.random()
requestFN('/api/homemajor/listMajordangersourceLocation').then(res => {
this.$nextTick(() => {
const boxList = this.initMapData()
// eslint-disable-next-line no-new-object
var wallMap = new Object() // 一公司外墙
const iframe = document.querySelector('#iframe')
// 处理兼容行问题
if (iframe.attachEvent) {
iframe.attachEvent('onload', function() {
this.contentWindow.postMessage(
{
'varList': res.varList,
'boxList': boxList,
'wallMap': wallMap,
'LONGITUDE': 119.65138731427636,
'LATITUDE': 39.93429609044706,
'distance': 800, // 距屏幕中心点距离单位m
'rotate': 60, // 旋转角(单位°)
'tilt': 45 // 倾斜角(单位°)
}, '*')
})
} else {
iframe.onload = function() {
this.contentWindow.postMessage(
{
'varList': res.varList,
'boxList': boxList,
'wallMap': wallMap,
'LONGITUDE': 119.65138731427636,
'LATITUDE': 39.93429609044706,
'distance': 800, // 距屏幕中心点距离单位m
'rotate': 60, // 旋转角(单位°)
'tilt': 45 // 倾斜角(单位°)
}, '*')
}
}
})
})
},
load() {
this.loading = true
this.currentPage += 1
this.getUnitPersonnel('1')
},
getUnitPersonnel(index) {
requestFN(
'/map/getUnitPersonnel?showCount=20' + '&currentPage=' + this.currentPage,
{
CORPINFO_ID: this.corpInfoId,
AREA: this.area,
GANGKOU: this.gangkou,
INDEX: index
}
).then((data) => {
this.block3List = this.block3List.concat(data.varList)
this.totalPage = data.page.totalPage
this.currentPage = data.page.currentPage
this.loading = false
})
}
}
}
</script>
<style lang="scss" scoped>
.renyuan {
.block1 {
width: 410px;
background-color: rgba(0, 0, 0, 0.3);
.options {
padding: 10px;
border: 1px solid;
border-image: linear-gradient(to bottom, rgba(58, 122, 149, 0.4), rgba(58, 122, 149, 1)) 1;
display: flex;
flex-wrap: wrap;
.option {
flex:1;
background-image: url("../../../assets/map/anquan/label.png");
background-size: 100% 100%;
background-repeat: no-repeat;
width: 125px;
height: 25px;
font-size: 12px;
line-height: 25px;
text-align: center;
color: #fff;
}
}
}
.block2,.block4 {
margin-top: 10px;
width: 410px;
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
.content {
border: 1px solid;
border-image: linear-gradient(to bottom, rgba(58, 122, 149, 0), rgba(58, 122, 149, 1)) 1;
border-top: none;
padding: 5px 10px;
#main2,#main3 {
width: 405px;
height: 150px;
}
}
}
.block3,.block5 {
margin-top: 10px;
width: 410px;
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
.content {
border: 1px solid;
border-image: linear-gradient(to bottom, rgba(58, 122, 149, 0), rgba(58, 122, 149, 1)) 1;
border-top: none;
padding: 10px;
.table {
margin-top: 10px;
.scroll {
max-height: 100px;
overflow-y: auto;
&::-webkit-scrollbar {
width: 5px;
}
&::-webkit-scrollbar-thumb {
border-radius: 5px;
background: rgba(2, 30, 81, 0.851);
}
&::-webkit-scrollbar-track {
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
}
.tr {
&:nth-child(odd) {
background-color: transparent;
}
}
}
.tr {
display: flex;
&:nth-child(odd) {
background-color: rgba(42, 86, 158, 0.53);
}
.td {
flex: 1;
text-align: center;
font-size: 12px;
color: #fff;
padding: 5px;
}
}
}
}
}
}
</style>