2024-04-26 09:15:20 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<!-- 综合评估详情 -->
|
2025-12-15 09:33:34 +08:00
|
|
|
|
<el-dialog draggable title="稳态电能质量水平评估" v-model="dialogVisible" width="1400px">
|
2025-12-12 09:26:56 +08:00
|
|
|
|
<div style="display: flex">
|
|
|
|
|
|
<div style="width: 400px">
|
|
|
|
|
|
<vxe-table
|
|
|
|
|
|
v-bind="defaultAttribute"
|
|
|
|
|
|
ref="tableRef"
|
2025-12-15 09:33:34 +08:00
|
|
|
|
@cell-click="currentChangeEvent"
|
2025-12-14 12:47:53 +08:00
|
|
|
|
height="250px"
|
2025-12-12 09:26:56 +08:00
|
|
|
|
:row-config="{ isCurrent: true, isHover: true }"
|
|
|
|
|
|
:data="tableData"
|
2025-12-15 09:33:34 +08:00
|
|
|
|
style="cursor: pointer"
|
2025-12-12 09:26:56 +08:00
|
|
|
|
>
|
|
|
|
|
|
<vxe-column field="deptName" title="地市" />
|
|
|
|
|
|
<vxe-column field="score" title="污染值" sortable>
|
2024-06-02 17:55:37 +08:00
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<span
|
2025-12-12 09:26:56 +08:00
|
|
|
|
:style="{
|
|
|
|
|
|
color: setColor(scope.row.score)
|
|
|
|
|
|
}"
|
2024-06-02 17:55:37 +08:00
|
|
|
|
>
|
2025-12-12 09:26:56 +08:00
|
|
|
|
{{ scope.row.score }}
|
2024-06-02 17:55:37 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</vxe-column>
|
2025-12-12 09:26:56 +08:00
|
|
|
|
</vxe-table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="ml10" style="width: 990px">
|
2025-12-15 09:33:34 +08:00
|
|
|
|
<vxe-table
|
|
|
|
|
|
v-bind="defaultAttribute"
|
|
|
|
|
|
@cell-click="clickAttribute"
|
|
|
|
|
|
v-loading="loadingTab"
|
|
|
|
|
|
ref="vxeRef"
|
|
|
|
|
|
height="250px"
|
|
|
|
|
|
:data="subdata"
|
|
|
|
|
|
style="cursor: pointer"
|
|
|
|
|
|
>
|
2025-12-14 12:47:53 +08:00
|
|
|
|
<vxe-column type="seq" width="70" title="序号"></vxe-column>
|
|
|
|
|
|
<vxe-column field="subName" title="变电站名称" min-width="120"></vxe-column>
|
|
|
|
|
|
<vxe-column field="lineName" title="监测点名称" align="center" min-width="120"></vxe-column>
|
|
|
|
|
|
<vxe-column field="objName" title="监测对象名称" align="center" min-width="100"></vxe-column>
|
|
|
|
|
|
<vxe-column field="loadType" title="干扰源类型" align="center" min-width="100"></vxe-column>
|
|
|
|
|
|
<vxe-column field="powerFlag" title="监测位置" align="center" min-width="100"></vxe-column>
|
|
|
|
|
|
<vxe-column field="vharmonicValue" title="污染值" sortable min-width="80">
|
2024-06-02 17:55:37 +08:00
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
<span
|
2025-12-12 09:26:56 +08:00
|
|
|
|
:style="{
|
|
|
|
|
|
color: setColor(scope.row.vharmonicValue)
|
|
|
|
|
|
}"
|
2024-06-02 17:55:37 +08:00
|
|
|
|
>
|
2025-12-12 09:26:56 +08:00
|
|
|
|
{{ scope.row.vharmonicValue }}
|
2024-06-02 17:55:37 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</vxe-column>
|
2025-12-12 09:26:56 +08:00
|
|
|
|
</vxe-table>
|
|
|
|
|
|
</div>
|
2024-04-26 09:15:20 +08:00
|
|
|
|
</div>
|
2024-06-02 17:55:37 +08:00
|
|
|
|
<div style="height: 300px; margin-top: 10px; position: relative" v-loading="loading">
|
2025-12-12 09:26:56 +08:00
|
|
|
|
<!-- <div style="position: absolute; width: 100px; top: 0px; right: 0px; z-index: 1">
|
2024-06-13 13:32:50 +08:00
|
|
|
|
<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>
|
2024-06-12 16:16:02 +08:00
|
|
|
|
</el-radio-group>
|
2024-06-13 13:32:50 +08:00
|
|
|
|
<el-radio-group v-model="type" size="small" @change="analysis">
|
2024-06-12 16:16:02 +08:00
|
|
|
|
<el-radio-button label="1">年</el-radio-button>
|
|
|
|
|
|
<el-radio-button label="3">月</el-radio-button>
|
|
|
|
|
|
</el-radio-group>
|
2025-12-12 09:26:56 +08:00
|
|
|
|
</div> -->
|
2024-06-12 16:16:02 +08:00
|
|
|
|
|
2025-12-15 09:33:34 +08:00
|
|
|
|
<MyEChart style="height: 300px" :options="picEChart" @echartClick="echartClick" />
|
2024-04-26 09:15:20 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
2025-12-12 09:26:56 +08:00
|
|
|
|
import { ref, nextTick } from 'vue'
|
2024-04-26 09:15:20 +08:00
|
|
|
|
import MyEChart from '@/components/echarts/MyEchart.vue'
|
|
|
|
|
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
2025-12-12 09:26:56 +08:00
|
|
|
|
import { useDictData } from '@/stores/dictData'
|
2025-12-14 12:47:53 +08:00
|
|
|
|
import { getAssessDetail, getAssessTrend, downPollutionSensitiveUser } from '@/api/device-boot/panorama'
|
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
|
const router = useRouter()
|
2025-12-12 09:26:56 +08:00
|
|
|
|
const dictData = useDictData()
|
2024-04-26 09:15:20 +08:00
|
|
|
|
const dialogVisible: any = ref(false)
|
2024-06-02 17:55:37 +08:00
|
|
|
|
const rowList: any = ref({})
|
2024-06-13 13:32:50 +08:00
|
|
|
|
const type = ref('1')
|
|
|
|
|
|
const city = ref('0')
|
2024-06-02 17:55:37 +08:00
|
|
|
|
const loading = ref(false)
|
2024-04-27 22:18:58 +08:00
|
|
|
|
const tableData: any = ref([])
|
2025-12-12 09:26:56 +08:00
|
|
|
|
const subdata: any = ref([])
|
2024-04-27 22:18:58 +08:00
|
|
|
|
const picEChart = ref()
|
2025-12-12 09:26:56 +08:00
|
|
|
|
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)
|
2024-04-29 16:37:07 +08:00
|
|
|
|
})
|
2025-12-12 09:26:56 +08:00
|
|
|
|
// })
|
2024-06-02 17:55:37 +08:00
|
|
|
|
rowList.value = row
|
2024-06-13 13:32:50 +08:00
|
|
|
|
analysis()
|
2024-06-02 17:55:37 +08:00
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
|
}
|
2025-12-12 09:26:56 +08:00
|
|
|
|
const currentChangeEvent = async () => {
|
|
|
|
|
|
loadingTab.value = true
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
subdata.value = tableRef.value.getCurrentRecord()?.powerFlagPollutionList || []
|
|
|
|
|
|
loadingTab.value = false
|
|
|
|
|
|
}, 1000)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-13 13:32:50 +08:00
|
|
|
|
const analysis = () => {
|
2024-06-02 17:55:37 +08:00
|
|
|
|
loading.value = true
|
|
|
|
|
|
let time = rowList.value.searchBeginTime.slice(0, 4) + `-01-01`
|
2025-12-14 12:47:53 +08:00
|
|
|
|
downPollutionSensitiveUser({ ...rowList.value, ids: [PollutionList[0].id], deptId: rowList.value.id }).then(res => {
|
2025-12-12 09:26:56 +08:00
|
|
|
|
const first10Items = res.data.slice(0, 10)
|
2024-04-27 22:18:58 +08:00
|
|
|
|
picEChart.value = {
|
|
|
|
|
|
title: {
|
2025-12-14 12:47:53 +08:00
|
|
|
|
text: '污染值排名前十敏感及重要用户'
|
2024-06-12 16:16:02 +08:00
|
|
|
|
},
|
2024-06-05 17:01:09 +08:00
|
|
|
|
|
2024-04-27 22:18:58 +08:00
|
|
|
|
xAxis: {
|
2025-12-12 09:26:56 +08:00
|
|
|
|
name: '',
|
2025-12-14 12:47:53 +08:00
|
|
|
|
data: first10Items.map((item: any) => item.projectName.split('(')[0].trim()),
|
2025-12-12 09:26:56 +08:00
|
|
|
|
axisLabel: {
|
2025-12-15 09:33:34 +08:00
|
|
|
|
rotate: 20 // 核心:倾斜 45 度(推荐 30/45/60,角度太大易读性差)
|
2025-12-12 09:26:56 +08:00
|
|
|
|
}
|
2024-04-27 22:18:58 +08:00
|
|
|
|
},
|
2024-04-29 16:37:07 +08:00
|
|
|
|
grid: {
|
2025-12-12 09:26:56 +08:00
|
|
|
|
bottom: 10
|
|
|
|
|
|
},
|
|
|
|
|
|
legend: {
|
|
|
|
|
|
show: false
|
2024-04-29 16:37:07 +08:00
|
|
|
|
},
|
2024-04-27 22:18:58 +08:00
|
|
|
|
yAxis: {
|
2024-04-29 16:37:07 +08:00
|
|
|
|
name: ''
|
2024-04-27 22:18:58 +08:00
|
|
|
|
},
|
|
|
|
|
|
options: {
|
2024-04-29 16:37:07 +08:00
|
|
|
|
dataZoom: false,
|
2025-12-12 09:26:56 +08:00
|
|
|
|
series: [
|
|
|
|
|
|
{
|
|
|
|
|
|
// name: time[i],
|
|
|
|
|
|
name: '污染值',
|
|
|
|
|
|
type: 'bar',
|
2025-12-14 12:47:53 +08:00
|
|
|
|
data: first10Items.map((item: any) => item.subValue),
|
2025-12-12 09:26:56 +08:00
|
|
|
|
itemStyle: {
|
|
|
|
|
|
color: function (params) {
|
|
|
|
|
|
// params.value 是当前柱子的数值
|
|
|
|
|
|
const value = params.value
|
|
|
|
|
|
return setColor(value)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2024-04-26 09:15:20 +08:00
|
|
|
|
}
|
2024-04-27 22:18:58 +08:00
|
|
|
|
}
|
2024-04-29 16:37:07 +08:00
|
|
|
|
|
2024-06-02 17:55:37 +08:00
|
|
|
|
loading.value = false
|
2024-04-27 22:18:58 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
2025-12-12 09:26:56 +08:00
|
|
|
|
const setColor = val => {
|
|
|
|
|
|
return val == 3.14159
|
|
|
|
|
|
? ''
|
|
|
|
|
|
: val > 10000
|
|
|
|
|
|
? '#A52a2a'
|
|
|
|
|
|
: val > 1000
|
|
|
|
|
|
? '#ff9900'
|
|
|
|
|
|
: val > 100
|
|
|
|
|
|
? '#ffcc33'
|
|
|
|
|
|
: val > 0
|
|
|
|
|
|
? '#3399ff'
|
|
|
|
|
|
: val == 0
|
|
|
|
|
|
? '#00B07D'
|
|
|
|
|
|
: ''
|
|
|
|
|
|
}
|
2025-12-15 09:33:34 +08:00
|
|
|
|
const echartClick = (res: any) => {
|
|
|
|
|
|
router.push({
|
2025-12-14 12:47:53 +08:00
|
|
|
|
name: 'harmonic-boot/qydetailedAnalysis/pollutionReport',
|
|
|
|
|
|
query: {
|
|
|
|
|
|
type: '4',
|
2025-12-15 09:33:34 +08:00
|
|
|
|
name: res.name,
|
|
|
|
|
|
t: Date.now()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
const clickAttribute = (row: any) => {
|
|
|
|
|
|
router.push({
|
|
|
|
|
|
name: 'harmonic-boot/qydetailedAnalysis/pollutionReport',
|
|
|
|
|
|
query: {
|
|
|
|
|
|
type: '1',
|
|
|
|
|
|
name: row.row.lineName,
|
2025-12-14 12:47:53 +08:00
|
|
|
|
t: Date.now()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2024-04-26 09:15:20 +08:00
|
|
|
|
defineExpose({ open })
|
|
|
|
|
|
</script>
|
2024-05-27 10:37:50 +08:00
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
:deep(.el-dialog__body) {
|
|
|
|
|
|
max-height: none !important;
|
|
|
|
|
|
}
|
2024-06-02 17:55:37 +08:00
|
|
|
|
.conclusion {
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
padding: 0 10px;
|
|
|
|
|
|
height: 24px;
|
|
|
|
|
|
line-height: 24px;
|
|
|
|
|
|
|
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.background1 {
|
|
|
|
|
|
background-color: #339966;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
}
|
|
|
|
|
|
.background2 {
|
|
|
|
|
|
background-color: #97017e;
|
|
|
|
|
|
color: #fff;
|
|
|
|
|
|
}
|
|
|
|
|
|
.background3 {
|
2025-12-12 09:26:56 +08:00
|
|
|
|
background-color: #a52a2a;
|
2024-06-02 17:55:37 +08:00
|
|
|
|
color: #fff;
|
|
|
|
|
|
}
|
|
|
|
|
|
:deep(.el-select) {
|
|
|
|
|
|
min-width: 80px !important;
|
|
|
|
|
|
}
|
2024-05-27 10:37:50 +08:00
|
|
|
|
</style>
|