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

339 lines
9.2 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>
<div class="TJTop">
<img src="@/assets/img/TJ.png" />
终端在线率
<span>{{ onlineRate }}%</span>
</div>
<MyEChart :style="`height: calc(${tabHeight.height} - 27px)`" :options="terminalCharts" />
2024-05-09 18:00:04 +08:00
</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'
2024-04-29 16:37:07 +08:00
import MyEChart from '@/components/echarts/MyEchart.vue'
import { useDictData } from '@/stores/dictData'
import { mainHeight } from '@/utils/layout'
import { getGridDiagramAreaData, getGridDiagramCityDev, getGridDiagramLineData } from '@/api/device-boot/panorama'
import { useConfig } from '@/stores/config'
const config = useConfig()
2024-04-29 16:37:07 +08:00
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 onlineRate = ref(0)
2024-05-09 18:00:04 +08:00
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
// 变电站
getGridDiagramAreaData(form).then(res => {
2024-04-29 16:37:07 +08:00
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].subNum,
res.data[0].deviceNum,
res.data[0].lineNum
2024-04-29 16:37:07 +08:00
],
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 => {
onlineRate.value = res.data[1]
let data = [
{
name: '运行',
value: res.data[0] - 0
},
{
name: '检修',
value: res.data[2] - 0
},
{
name: '退役',
value: res.data[4] - 0
}
]
2024-04-29 16:37:07 +08:00
terminalCharts.value = {
title: {
text: data[0].value + data[1].value + data[2].value,
left: '26%',
top: '40%',
textStyle: {
fontWeight: 600,
fontSize: 16
},
subtext: '总数',
subtextStyle: {
fontWeight: 550,
fontSize: 14
}
},
tooltip: {
trigger: 'item'
2024-04-29 16:37:07 +08:00
},
legend: {
orient: 'vertical',
top: 'center',
right: '10%',
formatter: function (e: any) {
return e + ' ' + data.filter(item => item.name == e)[0].value + '台'
}
2024-04-29 16:37:07 +08:00
},
xAxis: {
show: false
2024-04-29 16:37:07 +08:00
},
yAxis: {
show: false
2024-04-29 16:37:07 +08:00
},
color: [config.layout.elementUiPrimary[0], '#FFBF00', '#FF9100'],
2024-04-29 16:37:07 +08:00
options: {
dataZoom: null,
series: [
{
type: 'pie',
center: ['30%', '50%'],
radius: ['40%', '60%'],
2024-04-29 16:37:07 +08:00
label: {
show: false,
position: 'outside',
textStyle: {
//数值样式
}
},
data: data
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) => {
let title = item.orgName.replace(/\(\d+\)/g, '')
// return title.length > 5
return title.length > 6
? title.length > 11
? title.slice(0, 5) + '\n ' + title.slice(5, 10) + '\n ' + title.slice(10)
: title.slice(0, 5) + '\n ' + title.slice(5)
: title
2024-04-29 16:37:07 +08:00
}),
axisLabel: {
color: '#000',
fontSize: 12,
interval: 0
2024-04-29 16:37:07 +08:00
}
},
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',
bottom: 0
2024-04-29 16:37:07 +08:00
},
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
}
.TJTop {
margin-top: 10px;
display: flex;
img {
height: 1.2rem;
width: 1.2rem;
margin-right: 5px;
}
span {
color: #2dcd28;
}
}
2024-05-27 10:37:50 +08:00
:deep(.el-dialog__body) {
max-height: none !important;
}
2024-04-29 16:37:07 +08:00
</style>