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

556 lines
17 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="`height:calc(${boxHeight.height} - 40px)`">
<div class="title">
2024-04-29 16:37:07 +08:00
<span>指标合格率统计</span>
<span class="info" @click="open(0)">
详情
<ArrowRight style="width: 12px" />
</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="`height:calc(${EchHeight.height} - 40px)`" :options="passingCharts" />
</div>
<!-- 稳态指标超标占比 -->
<div :style="`height:calc(${boxHeight.height} + 40px)`">
<div class="title">
<span>稳态指标超标占比</span>
<span class="info" @click="open(1)">
详情
<ArrowRight style="width: 12px" />
</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" />
2024-04-29 16:37:07 +08:00
</div>
2024-05-09 18:00:04 +08:00
<div>
<div class="monitoringPoints">
<div>在线监测点数{{ monitorList.onlineNum }}</div>
<div>超标监测点数{{ monitorList.overNum }}</div>
<div>超标监测点占比{{ monitorList.overRatio }}</div>
2024-04-29 16:37:07 +08:00
</div>
2024-05-09 18:00:04 +08:00
<MyEChart :style="`height:calc(${EchHeight.height} + 10px)`" :options="exceededCharts" />
2024-04-29 16:37:07 +08:00
</div>
</div>
2024-05-09 18:00:04 +08:00
<!-- 暂态事件统计 -->
<div :style="`height:calc(${boxHeight.height} - 10px)`">
<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" />
</div>
<MyEChart :style="`height:calc(${EchHeight.height} - 10px)`" :options="statisticsCharts" />
</div>
<!-- 稳态电能质量指标水平评估 -->
<div>
<div class="title">
<span>技术监督管理</span>
<!-- <span class="info" @click="open(3)">
详情
<ArrowRight style="width: 12px" />
</span> -->
</div>
<div style="display: flex" class="mt2">
<img src="@/assets/img/FGX.png" />
</div>
<div style="height: 150px" class="boxR">
<el-segmented v-model="active" :options="Voltage" block />
<el-row
style="height: calc(100% - 45px); display: flex; justify-content: space-around"
class="ml10 mr10 mt5"
>
<el-col :span="11" class="col pt10">
<div>
<span>异常问题总数</span>
<span style="color: #2dcd28">60</span>
</div>
<div>
<span style="width: 120px">已关联工单数</span>
<span style="color: #81b337">60</span>
</div>
<div>
<span style="width: 120px"> 工单转换率</span>
<span style="color: #338dff">60%</span>
</div>
</el-col>
<el-col :span="11" class="col pt10" :offset="0.5">
<div>
<span>异常问题总数</span>
<span style="color: #2dcd28">60</span>
</div>
<div>
<span style="width: 120px">已关联工单数</span>
<span style="color: #81b337">60</span>
</div>
<div>
<span style="width: 120px"> 工单转换率</span>
<span style="color: #338dff">60%</span>
</div>
</el-col>
</el-row>
</div>
</div>
<!-- 指标合格率统计 -->
<statistics ref="statisticsRef" />
<!-- 稳态指标超标占比 -->
<exceeded ref="exceededRef" />
</div>
<img
class="imgR"
:style="show ? 'transform: rotate(180deg);' : 'transform: rotate(0deg);'"
@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 statistics from '../components/city/statistics.vue'
2024-05-09 18:00:04 +08:00
import exceeded from '../components/city/exceeded.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 { ArrowRight } from '@element-plus/icons-vue'
2024-05-09 18:00:04 +08:00
import { getAssessDetail, evaluationDetail, getGeneralSituation } from '@/api/device-boot/panorama'
2024-04-29 16:37:07 +08:00
const dictData = useDictData()
2024-05-09 18:00:04 +08:00
const height = mainHeight(30)
const show = ref(false)
const boxHeight: any = mainHeight(220, 3)
const EchHeight: any = mainHeight(320, 3)
2024-04-29 16:37:07 +08:00
const statisticsRef = ref()
2024-05-09 18:00:04 +08:00
const exceededRef = ref()
2024-04-29 16:37:07 +08:00
const formRow: any = ref({})
const monitorList: any = ref({})
const statisticsCharts: any = ref({})
2024-05-09 18:00:04 +08:00
2024-04-29 16:37:07 +08:00
const passingCharts = ref()
const exceededCharts = ref()
2024-05-09 18:00:04 +08:00
const Voltage: any = [
{
label: '技术监督计划',
value: '0'
},
{
label: '在线监测',
value: '1'
},
{
label: '用户投诉',
value: '2'
},
{
label: '谐波普测',
value: '3'
}
2024-04-29 16:37:07 +08:00
]
2024-05-09 18:00:04 +08:00
const active: any = ref(Voltage[0].value)
2024-04-29 16:37:07 +08:00
const open = (e: number) => {
if (e == 0) {
statisticsRef.value.open(formRow.value)
2024-05-09 18:00:04 +08:00
} else if (e == 1) {
exceededRef.value.open(formRow.value)
2024-04-29 16:37:07 +08:00
}
}
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
}
formRow.value = form
// 指标合格率统计
getAssessDetail(form).then(res => {
let data = [
{
name:
'电压偏差:' +
(res.data[0].vdevQualifyData == 3.14159 ? '暂无数据' : res.data[0].vdevQualifyData + '%'),
value: res.data[0].vdevQualifyData == 3.14159 ? '暂无数据' : res.data[0].vdevQualifyData
},
{
name:
'频率偏差:' +
(res.data[0].freqQualifyData == 3.14159 ? '暂无数据' : res.data[0].freqQualifyData + '%'),
value: res.data[0].freqQualifyData == 3.14159 ? '暂无数据' : res.data[0].freqQualifyData
},
{
name:
'电压总谐波畸变率:' +
(res.data[0].harmQualifyData == 3.14159 ? '暂无数据' : res.data[0].harmQualifyData + '%'),
value: res.data[0].harmQualifyData == 3.14159 ? '暂无数据' : res.data[0].harmQualifyData
},
{
name:
'闪变:' +
(res.data[0].flickerQualifyData == 3.14159 ? '暂无数据' : res.data[0].flickerQualifyData + '%'),
value: res.data[0].flickerQualifyData == 3.14159 ? '暂无数据' : res.data[0].flickerQualifyData
},
{
name:
'三相电压不平衡度:' +
(res.data[0].unbalanceQualifyData == 3.14159 ? '暂无数据' : res.data[0].unbalanceQualifyData + '%'),
value: res.data[0].unbalanceQualifyData == 3.14159 ? '暂无数据' : res.data[0].unbalanceQualifyData
}
]
let optionData = getData(data)
passingCharts.value = {
tooltip: {
show: true,
trigger: 'item',
formatter: '{b}'
},
xAxis: {
show: false
},
yAxis: {
show: false
},
legend: {
data: data.map((item: any) => item.name),
type: 'scroll',
orient: 'vertical',
icon: 'roundRect',
right: '10',
itemGap: 15,
itemWidth: 12,
itemHeight: 12,
textStyle: {
fontSize: '0.85rem'
}
},
options: {
dataZoom: null,
series: optionData.series
}
}
function getData(data: any) {
var res: any = {
series: [],
yAxis: []
}
for (let i = 0; i < data.length; i++) {
res.series.push({
type: 'pie',
clockWise: false, //顺时加载
hoverAnimation: false, //鼠标移入变大
radius: [70 - i * 15 + '%', 80 - i * 15 + '%'],
center: ['30%', '50%'],
label: {
show: false
},
data: [
{
value: data[i].value,
name: data[i].name
},
{
value: 100 - data[i].value,
name: '',
itemStyle: {
color: 'rgba(0,0,0,0)',
borderWidth: 0
},
tooltip: {
show: false
},
hoverAnimation: true
}
]
})
res.series.push({
name: '',
type: 'pie',
silent: true,
z: 1,
clockWise: false, //顺时加载
hoverAnimation: false, //鼠标移入变大
radius: [70 - i * 15 + '%', 80 - i * 15 + '%'],
center: ['30%', '50%'],
label: {
show: false
},
data: [
{
value: 7.5,
itemStyle: {
color: '#E3F0FF',
borderWidth: 0
},
tooltip: {
show: false
},
hoverAnimation: false
}
]
})
}
return res
}
})
// 稳态指标超标占比
evaluationDetail(form).then(res => {
monitorList.value = res.data[0]
exceededCharts.value = {
tooltip: {},
yAxis: {
name: '%',
type: 'value',
max: 100
},
legend: {
data: ['超标监测点数', '超标天数']
},
xAxis: {
type: 'category',
2024-04-29 18:30:32 +08:00
data: res.data[0].list?.map((item: any) => {
2024-04-29 16:37:07 +08:00
return item.targetName.length > 4
? item.targetName.slice(0, 4) + '\n ' + item.targetName.slice(4)
: item.targetName
}),
axisLabel: {
color: '#000',
2024-05-09 18:00:04 +08:00
fontSize: 12,
interval:0
2024-04-29 16:37:07 +08:00
}
},
grid: {
top: '30px',
left: '10px',
right: '20px'
},
options: {
dataZoom: null,
series: [
{
name: '超标监测点数',
type: 'bar',
2024-04-29 18:30:32 +08:00
data: res.data[0].list?.map((item: any) => item.overNum),
2024-04-29 16:37:07 +08:00
label: {
show: true,
position: 'top',
fontSize: 12,
formatter: function (params: any) {
return `${params.value == 3.14159 ? '' : params.value}`
}
}
},
{
name: '超标天数',
type: 'bar',
2024-04-29 18:30:32 +08:00
data: res.data[0].list?.map((item: any) => item.overDay),
2024-04-29 16:37:07 +08:00
label: {
show: true,
position: 'top',
fontSize: 12,
formatter: function (params: any) {
return `${params.value == 3.14159 ? '' : params.value}`
}
}
}
]
}
}
})
// 稳态电能质量指标水平评估
getGeneralSituation({ ...form, monitorFlag: form.isUpToGrid == 0 ? 2 : 1 }).then(res => {
statisticsCharts.value = {
tooltip: {},
yAxis: {
type: 'value'
},
legend: {
show: false
},
xAxis: {
type: 'category',
data: ['电压暂升', '电压暂降', '短时中断']
},
grid: {
top: '30px',
left: '10px',
right: '20px'
},
options: {
dataZoom: null,
series: [
{
name: '暂态个数',
type: 'bar',
data: [res.data[0].upCount, res.data[0].sagsCount, res.data[0].breakCount],
label: {
show: true,
position: 'top',
fontSize: 12
}
}
]
}
}
})
}
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;
2024-04-29 16:37:07 +08:00
font-size: 13px;
overflow: hidden;
2024-05-09 18:00:04 +08:00
border-radius: 5px;
2024-04-29 16:37:07 +08:00
}
2024-05-09 18:00:04 +08:00
.title {
// height: ;
2024-04-29 16:37:07 +08:00
display: flex;
2024-05-09 18:00:04 +08:00
justify-content: space-between;
font-size: 15px;
line-height: 23px;
padding-left: 5px;
width: 100%;
font-weight: 550;
.info {
font-weight: normal;
display: flex;
font-size: 12px;
cursor: pointer;
color: #757575;
}
}
.TJTop {
display: flex;
img {
height: 1.2rem;
width: 1.2rem;
margin-right: 5px;
}
2024-04-29 16:37:07 +08:00
}
.evaluate {
margin: 10px 0;
display: flex;
justify-content: space-around;
text-align: center;
overflow-x: auto;
overflow-y: hidden;
2024-05-09 18:00:04 +08:00
.line {
display: inline-block;
width: 0.5rem;
height: 0.5rem;
border-radius: 0.25rem;
background: var(--el-color-primary);
margin-right: 2px;
margin-bottom: 1px;
}
2024-04-29 16:37:07 +08:00
}
.boxR {
2024-05-09 18:00:04 +08:00
margin: 10px 0 0 0;
2024-04-29 16:37:07 +08:00
.num {
color: #2478f2;
}
.top {
display: flex;
justify-content: space-between;
}
.bottom {
margin: 0;
border: 0px;
}
2024-05-09 18:00:04 +08:00
.harmonic {
display: grid;
.progress {
display: flex;
align-items: center;
.text {
width: 50px;
font-size: 12px;
}
.el-progress {
flex: 1;
}
2024-04-29 16:37:07 +08:00
}
}
}
2024-05-09 18:00:04 +08:00
:deep(.el-select) {
min-width: 120px;
}
.col {
2024-04-29 16:37:07 +08:00
display: grid;
2024-05-09 18:00:04 +08:00
grid-template-columns: 1fr;
border-radius: 10px;
2024-04-29 16:37:07 +08:00
text-align: center;
2024-05-09 18:00:04 +08:00
background-color: #edededc0;
2024-04-29 16:37:07 +08:00
}
2024-05-09 18:00:04 +08:00
.imgR {
position: absolute;
padding: 10px;
top: calc(50% - 80px);
left: -23px;
height: 200px;
cursor: pointer;
}
.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-progress__text) {
font-size: 0.8rem !important ;
}
.monitoringPoints {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
margin-top: 10px;
margin-bottom: 10px;
2024-04-29 16:37:07 +08:00
}
</style>