修改冀北现场问题

This commit is contained in:
GGJ
2025-12-12 09:26:56 +08:00
parent b36f765d07
commit 46c55d48ec
38 changed files with 1489 additions and 1370 deletions

View File

@@ -1,137 +1,54 @@
<template>
<!-- 综合评估详情 -->
<el-dialog draggable title="综合评估统计" v-model="dialogVisible" width="1400px">
<div>
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="300px" :data="tableData">
<vxe-column field="deptName" title="地市" />
<vxe-column field="assessLevel" title="综合评估结论">
<template #default="scope">
<!-- class="conclusion"
:class="
scope.row.assessLevel == '特质'
? 'background1'
: scope.row.assessLevel == '较差'
? 'background2'
: scope.row.assessLevel == '极差'
? 'background3'
: ''
" -->
<span>
{{ scope.row.assessData }}
</span>
</template>
</vxe-column>
<vxe-column field="qualifyData" title="指标合格率(%)" />
<!-- <vxe-colgroup title="评估结论">
<vxe-column field="vdevAssessLevel" title="电压偏差">
<el-dialog draggable title="区域污染值统计" v-model="dialogVisible" width="1400px">
<div style="display: flex">
<div style="width: 400px">
<vxe-table
v-bind="defaultAttribute"
ref="tableRef"
@current-change="currentChangeEvent"
height="240px"
:row-config="{ isCurrent: true, isHover: true }"
:data="tableData"
>
<vxe-column field="deptName" title="地市" />
<vxe-column field="score" title="污染值" sortable>
<template #default="scope">
<span
class="conclusion"
:class="
scope.row.vdevAssessLevel == '特质'
? 'background1'
: scope.row.vdevAssessLevel == '较差'
? 'background2'
: scope.row.vdevAssessLevel == '极差'
? 'background3'
: ''
"
:style="{
color: setColor(scope.row.score)
}"
>
{{ scope.row.vdevAssessLevel }}
{{ scope.row.score }}
</span>
</template>
</vxe-column>
<vxe-column field="freqAssessLevel" title="频率偏差">
</vxe-table>
</div>
<div class="ml10" style="width: 990px">
<vxe-table v-bind="defaultAttribute" v-loading="loadingTab" ref="vxeRef" height="240px" :data="subdata">
<vxe-column type="seq" width="70"></vxe-column>
<vxe-column field="devName" title="终端名称"></vxe-column>
<vxe-column field="lineName" title="监测点名称" />
<vxe-column field="powerFlag" title="电网标志" />
<vxe-column field="devType" title="终端型号"></vxe-column>
<vxe-column field="manufacturer" title="终端厂家"></vxe-column>
<vxe-column field="vharmonicValue" title="污染值" sortable>
<template #default="scope">
<span
class="conclusion"
:class="
scope.row.freqAssessLevel == '特质'
? 'background1'
: scope.row.freqAssessLevel == '较差'
? 'background2'
: scope.row.freqAssessLevel == '极差'
? 'background3'
: ''
"
:style="{
color: setColor(scope.row.vharmonicValue)
}"
>
{{ scope.row.freqAssessLevel }}
{{ scope.row.vharmonicValue }}
</span>
</template>
</vxe-column>
<vxe-column field="harmAssessLevel" title="电压总谐波畸变率">
<template #default="scope">
<span
class="conclusion"
:class="
scope.row.harmAssessLevel == '特质'
? 'background1'
: scope.row.harmAssessLevel == '较差'
? 'background2'
: scope.row.harmAssessLevel == '极差'
? 'background3'
: ''
"
>
{{ scope.row.harmAssessLevel }}
</span>
</template>
</vxe-column>
<vxe-column field="flickerAssessLevel" title="电压闪变">
<template #default="scope">
<span
class="conclusion"
:class="
scope.row.flickerAssessLevel == '特质'
? 'background1'
: scope.row.flickerAssessLevel == '较差'
? 'background2'
: scope.row.flickerAssessLevel == '极差'
? 'background3'
: ''
"
>
{{ scope.row.flickerAssessLevel }}
</span>
</template>
</vxe-column>
<vxe-column field="unbalanceAssessLevel" title="三相电压不平衡度">
<template #default="scope">
<span
class="conclusion"
:class="
scope.row.unbalanceAssessLevel == '特质'
? 'background1'
: scope.row.unbalanceAssessLevel == '较差'
? 'background2'
: scope.row.unbalanceAssessLevel == '极差'
? 'background3'
: ''
"
>
{{ scope.row.unbalanceAssessLevel }}
</span>
</template>
</vxe-column>
</vxe-colgroup> -->
</vxe-table>
</vxe-table>
</div>
</div>
<div style="height: 300px; margin-top: 10px; position: relative" v-loading="loading">
<!-- <el-select
v-model="time"
size="small"
@change="analysis"
>
<el-option label="年" value="1" />
<el-option label="月" value="3" />
</el-select> -->
<div style="position: absolute; width: 100px; top: 0px; right: 0px; z-index: 1">
<!-- <div style="position: absolute; width: 100px; top: 0px; right: 0px; z-index: 1">
<el-radio-group v-model="city" size="small" @change="analysis">
<el-radio-button label="0"></el-radio-button>
<el-radio-button label="1"></el-radio-button>
@@ -140,133 +57,119 @@
<el-radio-button label="1"></el-radio-button>
<el-radio-button label="3"></el-radio-button>
</el-radio-group>
</div>
</div> -->
<MyEChart style="height: 300px" :options="picEChart" />
</div>
</el-dialog>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { ref, nextTick } from 'vue'
import MyEChart from '@/components/echarts/MyEchart.vue'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { getAssessDetail, getAssessTrend } from '@/api/device-boot/panorama'
import { useDictData } from '@/stores/dictData'
import { getAssessDetail, getAssessTrend, downPollutionSubCalc } from '@/api/device-boot/panorama'
const dictData = useDictData()
const dialogVisible: any = ref(false)
const rowList: any = ref({})
const type = ref('1')
const city = ref('0')
const loading = ref(false)
const tableData: any = ref([])
const subdata: any = ref([])
const picEChart = ref()
const open = async (row: any) => {
getAssessDetail(row).then(res => {
tableData.value = res.data
const tableRef = ref()
const loadingTab = ref(false)
const PollutionList = dictData.getBasicData('Pollution_Calc').filter(item => item.name == '谐波电压')
const open = async (row: any, list: any) => {
console.log('🚀 ~ open ~ list:', list)
// getAssessDetail(row).then(res => {
tableData.value = list
subdata.value = tableData.value[0]?.powerFlagPollutionList || []
nextTick(() => {
setTimeout(() => {
tableRef.value?.setCurrentRow(tableData.value[0])
}, 0)
})
// })
rowList.value = row
analysis()
dialogVisible.value = true
}
const currentChangeEvent = async () => {
loadingTab.value = true
setTimeout(() => {
subdata.value = tableRef.value.getCurrentRecord()?.powerFlagPollutionList || []
loadingTab.value = false
}, 1000)
}
const analysis = () => {
loading.value = true
let time = rowList.value.searchBeginTime.slice(0, 4) + `-01-01`
getAssessTrend({ ...rowList.value, searchBeginTime: time, type: type.value, areaType: city.value }).then(res => {
downPollutionSubCalc({ ...rowList.value, ids: [PollutionList[0].id] }).then(res => {
const first10Items = res.data.slice(0, 10)
picEChart.value = {
title: {
text: '各地市综合评估趋势对比'
text: '污染值排名前十变电站'
},
xAxis: {
name: '',
data: first10Items.map((item: any) => item.subStationName),
axisLabel: {
rotate: 30, // 核心:倾斜 45 度(推荐 30/45/60角度太大易读性差
}
},
grid: {
bottom: 10
},
legend: {
right: 120,
top: 20
show: false
},
// tooltip: {
// formatter: function (params: any) {
// // console.log(123, params)
// var tips = ''
// for (var i = 0; i < params.length; i++) {
// console.log('🚀 ~ getAssessTrend ~ params[i].value:', params[i].value)
// tips +=
// params[i].seriesName +
// ':' +
// `<span style="color:${
// params[i].value > 4.5
// ? ''
// : params[i].value > 4
// ? ''
// : params[i].value > 3
// ? ''
// : params[i].value > 2
// ? '#97017e'
// : params[i].value > 0
// ? '#A52a2a'
// : ''
// }">
// ${
// params[i].value > 4.5
// ? '优质'
// : params[i].value > 4
// ? '良好'
// : params[i].value > 3
// ? '一般'
// : params[i].value > 2
// ? '较差'
// : params[i].value > 0
// ? '极差'
// : ''
// }
// </span>` +
// '</br>'
// }
// return tips
// }
// },
xAxis: {
name: '时间',
data: res.data[0].children.map((item: any) => item.dataTime)
},
grid: {
bottom: '10px',
top: '60px'
},
yAxis: {
name: ''
},
options: {
dataZoom: false,
series: []
series: [
{
// name: time[i],
name: '污染值',
type: 'bar',
data: first10Items.map((item: any) => item.subVStationValue),
itemStyle: {
color: function (params) {
// params.value 是当前柱子的数值
const value = params.value
return setColor(value)
}
}
}
]
}
}
let list: any = []
let time: any = []
let mun: any = []
res.data.forEach((item: any, num: any) => {
time.push(item.deptName)
list.push([])
item.children.forEach((val: any, i: any) => {
mun.push(val.score == 3.14159 ? null : val.score)
list[num].push(val.score == 3.14159 ? null : val.score)
})
})
list.forEach((item: any, i: any) => {
picEChart.value.options.series.push({
name: time[i],
type: 'line',
data: item
})
})
picEChart.value.yAxis.min = Math.min(...mun) < 1 ? 0 : (Math.min(...mun) - 0.5).toFixed(2)
picEChart.value.yAxis.max = Math.max(...mun) > 4.5 ? 5 : (Math.max(...mun) + 0.5).toFixed(2)
loading.value = false
})
}
const setColor = val => {
return val == 3.14159
? ''
: val > 10000
? '#A52a2a'
: val > 1000
? '#ff9900'
: val > 100
? '#ffcc33'
: val > 0
? '#3399ff'
: val == 0
? '#00B07D'
: ''
}
defineExpose({ open })
</script>
<style lang="scss" scoped>
@@ -290,7 +193,7 @@ defineExpose({ open })
color: #fff;
}
.background3 {
background-color: #A52a2a;
background-color: #a52a2a;
color: #fff;
}
:deep(.el-select) {