Files
admin-sjzx/src/views/pqs/qualityInspeection/panorama/components/cityMapL.vue

299 lines
8.0 KiB
Vue
Raw Normal View History

2024-04-29 16:37:07 +08:00
<template>
2024-05-09 18:00:04 +08:00
<div :class="show ? 'show' : 'noshow'">
<div class="boxLeft" :style="height">
<!-- 在线监测规模 -->
<div :style="boxHeight">
<div class="title">
2024-04-29 16:37:07 +08:00
<span>在线监测规模</span>
</div>
2024-05-09 18:00:04 +08:00
<div style="display: flex" class="mt2">
<img src="@/assets/img/FGX.png" />
2024-04-29 16:37:07 +08:00
</div>
2024-05-09 18:00:04 +08:00
<MyEChart :style="tabHeight" :options="onlineCharts" />
2024-04-29 16:37:07 +08:00
</div>
2024-05-09 18:00:04 +08:00
<!-- 监测终端状态 -->
<div :style="boxHeight">
<div class="title">
<span>监测终端状态</span>
2024-04-29 16:37:07 +08:00
</div>
2024-05-09 18:00:04 +08:00
<div style="display: flex" class="mt2">
<img src="@/assets/img/FGX.png" />
</div>
<MyEChart :style="tabHeight" :options="terminalCharts" />
</div>
<!-- 监测点 -->
<div :style="boxHeight">
<div class="title">
<span>监测点数据完整率</span>
</div>
2024-04-29 16:37:07 +08:00
2024-05-09 18:00:04 +08:00
<div style="display: flex" class="mt2">
<img src="@/assets/img/FGX.png" />
</div>
<MyEChart :style="tabHeight" :options="dotCharts" />
</div>
</div>
<img
class="imgL"
:style="show ? 'transform: rotate(0deg);' : 'transform: rotate(180deg);'"
@click="show = !show"
src="@/assets/img/QH.png"
/>
2024-04-29 16:37:07 +08:00
</div>
</template>
<script setup lang="ts">
import { onMounted, reactive, ref, provide } from 'vue'
import MyEChart from '@/components/echarts/MyEchart.vue'
import { useDictData } from '@/stores/dictData'
import { mainHeight } from '@/utils/layout'
import { getPracticalRunDeviceInfo, getGridDiagramCityDev, getGridDiagramLineData } from '@/api/device-boot/panorama'
const dictData = useDictData()
2024-05-09 18:00:04 +08:00
const height = mainHeight(30)
const boxHeight = mainHeight(40, 3)
const tabHeight: any = mainHeight(150, 3)
const show = ref(false)
2024-04-29 16:37:07 +08:00
const formRow: any = ref({})
const terminalCharts: any = ref({})
const dotCharts = ref()
const onlineCharts = ref()
const info = (row: any) => {
let form = {
...row,
id: row.orgNo,
deptIndex: row.orgNo,
orgId: row.orgNo,
ids: [],
statisticalType: dictData.getBasicData('Statistical_Type', ['Report_Type'])[0],
isUpToGrid: row.isUpToGrid,
2024-05-09 18:00:04 +08:00
monitorFlag: row.isUpToGrid == 0 ? null : row.isUpToGrid
2024-04-29 16:37:07 +08:00
}
let loadType = dictData.getBasicData('Statistical_Type').find(item => item.code == 'Load_Type')
formRow.value = form
// 变电站
getPracticalRunDeviceInfo(form).then(res => {
onlineCharts.value = {
tooltip: {},
yAxis: {
2024-05-09 18:00:04 +08:00
type: 'value',
name:'个'
2024-04-29 16:37:07 +08:00
},
xAxis: {
type: 'category',
2024-05-09 18:00:04 +08:00
data: ['变电站', '监测终端', '监测点'],
2024-04-29 16:37:07 +08:00
axisLabel: {
color: '#000',
fontSize: 12
}
},
grid: {
top: '30px',
left: '10px',
right: '20px'
},
options: {
dataZoom: null,
series: [
{
2024-05-09 18:00:04 +08:00
name: '个数',
2024-04-29 16:37:07 +08:00
type: 'bar',
data: [
res.data[0].subIndexes.length,
res.data[0].deviceIndexes.length,
res.data[0].lineIndexes.length
],
label: {
show: true,
position: 'top',
2024-05-14 18:28:27 +08:00
fontSize: 10
2024-04-29 16:37:07 +08:00
}
}
]
}
}
})
// 终端
getGridDiagramCityDev({ ...form, deviceInfoParam: form, pageNum: 1, pageSize: 1000 }).then(res => {
terminalCharts.value = {
title: {
text: ''
},
legend: {
show: true,
right: 90
},
xAxis: {
data: ['运行', '检修', '退运']
},
yAxis: [
{
2024-05-09 18:00:04 +08:00
name: '个',
2024-04-29 16:37:07 +08:00
type: 'value'
},
{
type: 'value',
2024-05-14 18:28:27 +08:00
name: '%',
2024-04-29 16:37:07 +08:00
splitLine: {
show: false
},
max: 100
}
],
grid: {
top: '35px',
left: '20px',
right: '20px'
},
options: {
dataZoom: null,
series: [
{
name: '终端个数',
type: 'bar',
data: [res.data[0], res.data[2], res.data[4]],
label: {
show: true,
position: 'top',
2024-05-14 18:28:27 +08:00
fontSize: 10
2024-04-29 16:37:07 +08:00
}
},
{
name: '在线率',
type: 'bar',
yAxisIndex: 1,
data: [res.data[1]],
label: {
show: true,
position: 'top',
2024-05-14 18:28:27 +08:00
fontSize: 10
2024-04-29 16:37:07 +08:00
}
}
]
}
}
})
// 监测点
getGridDiagramLineData({ ...form, statisticalType: loadType }).then(res => {
dotCharts.value = {
title: {
text: ''
},
// str.replace(/\(\d+\)/, "\n$&");
xAxis: {
data: res.data.map((item: any) => {
return item.orgName.length > 4
? item.orgName.slice(0, 4) + '\n ' + item.orgName.slice(4)
: item.orgName
}),
axisLabel: {
color: '#000',
fontSize: 12
}
},
yAxis: {
2024-05-09 18:00:04 +08:00
name: '%',
2024-04-29 16:37:07 +08:00
min: 0,
max: 100
},
grid: {
top: '30px',
left: '0px',
right: '20px'
},
options: {
dataZoom: null,
series: [
{
2024-05-09 18:00:04 +08:00
name: '数据完整率',
2024-04-29 16:37:07 +08:00
type: 'bar',
data: res.data.map((item: any) => item.integrityRate),
label: {
show: true,
position: 'top',
2024-05-14 18:28:27 +08:00
fontSize: 10
2024-04-29 16:37:07 +08:00
}
}
]
}
}
})
}
2024-05-09 18:00:04 +08:00
defineExpose({ info, show })
2024-04-29 16:37:07 +08:00
</script>
<style lang="scss" scoped>
.boxLeft {
2024-05-09 18:00:04 +08:00
background-color: #fff;
width: 100%;
padding: 10px 10px 10px 10px;
border-radius: 5px;
2024-04-29 16:37:07 +08:00
font-size: 13px;
overflow: hidden;
}
.title {
// height: ;
display: flex;
justify-content: space-between;
2024-05-09 18:00:04 +08:00
font-size: 15px;
2024-04-29 16:37:07 +08:00
line-height: 23px;
padding-left: 5px;
width: 100%;
2024-05-09 18:00:04 +08:00
font-weight: 550;
2024-04-29 16:37:07 +08:00
.info {
font-weight: normal;
display: flex;
font-size: 12px;
cursor: pointer;
2024-05-09 18:00:04 +08:00
color: #757575;
2024-04-29 16:37:07 +08:00
}
}
2024-05-09 18:00:04 +08:00
.imgL {
2024-04-29 16:37:07 +08:00
position: absolute;
padding: 10px;
top: calc(50% - 80px);
2024-05-09 18:00:04 +08:00
right: -23px;
transform: rotate(180deg);
2024-04-29 16:37:07 +08:00
height: 200px;
cursor: pointer;
}
2024-05-09 18:00:04 +08:00
.show {
width: 0px;
transition: all 0.3s ease;
.boxLeft {
padding: 0;
2024-04-29 16:37:07 +08:00
}
2024-05-09 18:00:04 +08:00
}
.noshow {
width: 25%;
transition: all 0.3s ease;
.boxLeft {
padding: 10px 10px 10px 10px;
2024-04-29 16:37:07 +08:00
}
2024-05-09 18:00:04 +08:00
}
:deep(.el-card) {
--el-card-padding: 10px !important;
}
:deep(.el-table thead) {
color: #000;
2024-04-29 16:37:07 +08:00
}
</style>