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

104 lines
4.0 KiB
Vue
Raw Normal View History

2024-04-26 09:15:20 +08:00
<template>
<!-- 综合评估详情 -->
2024-05-09 18:00:04 +08:00
<el-dialog draggable title="综合评估统计" v-model="dialogVisible" width="1400px">
2024-04-26 09:15:20 +08:00
<div>
<vxe-table v-bind="defaultAttribute" ref="vxeRef" height="300px" :data="tableData">
2024-05-09 18:00:04 +08:00
<vxe-column field="deptName" title="地市" />
2024-04-27 22:18:58 +08:00
<vxe-column field="assessData" title="综合评估得分" :formatter="formatter" />
2024-05-14 18:28:27 +08:00
<vxe-column field="qualifyData" title="指标合格率(%)" :formatter="formatter" />
2024-04-26 09:15:20 +08:00
<vxe-colgroup title="电压偏差">
2024-04-27 22:18:58 +08:00
<vxe-column field="vdevAssessData" title="评估得分" :formatter="formatter" />
2024-05-14 18:28:27 +08:00
<vxe-column field="vdevQualifyData" title="指标合格率(%)" :formatter="formatter" />
2024-04-26 09:15:20 +08:00
</vxe-colgroup>
2024-04-27 22:18:58 +08:00
<vxe-colgroup title="频率偏差">
<vxe-column field="freqAssessData" title="评估得分" :formatter="formatter" />
2024-05-14 18:28:27 +08:00
<vxe-column field="freqQualifyData" title="指标合格率(%)" :formatter="formatter" />
2024-04-26 09:15:20 +08:00
</vxe-colgroup>
2024-05-14 18:28:27 +08:00
<vxe-colgroup title="电压总谐波畸变率">
2024-04-27 22:18:58 +08:00
<vxe-column field="harmAssessData" title="评估得分" :formatter="formatter" />
2024-05-14 18:28:27 +08:00
<vxe-column field="harmQualifyData" title="指标合格率(%)" :formatter="formatter" />
2024-04-26 09:15:20 +08:00
</vxe-colgroup>
<vxe-colgroup title="电压闪变">
2024-04-27 22:18:58 +08:00
<vxe-column field="flickerAssessData" title="评估得分" :formatter="formatter" />
2024-05-14 18:28:27 +08:00
<vxe-column field="flickerQualifyData" title="指标合格率(%)" :formatter="formatter" />
2024-04-26 09:15:20 +08:00
</vxe-colgroup>
2024-05-14 18:28:27 +08:00
<vxe-colgroup title="三相电压不平衡度">
2024-04-27 22:18:58 +08:00
<vxe-column field="unbalanceAssessData" title="评估得分" :formatter="formatter" />
2024-05-14 18:28:27 +08:00
<vxe-column field="unbalanceQualifyData" title="指标合格率(%)" :formatter="formatter" />
2024-04-26 09:15:20 +08:00
</vxe-colgroup>
2024-05-14 18:28:27 +08:00
2024-04-26 09:15:20 +08:00
</vxe-table>
</div>
<div style="height: 300px; margin-top: 10px">
<MyEChart style="height: 300px" :options="picEChart" />
</div>
</el-dialog>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import MyEChart from '@/components/echarts/MyEchart.vue'
import { defaultAttribute } from '@/components/table/defaultAttribute'
2024-04-29 16:37:07 +08:00
import { getAssessDetail, getAssessTrend } from '@/api/device-boot/panorama'
2024-04-26 09:15:20 +08:00
const dialogVisible: any = ref(false)
2024-04-27 22:18:58 +08:00
const tableData: any = ref([])
const picEChart = ref()
const open = async (row: any) => {
getAssessDetail(row).then(res => {
tableData.value = res.data
2024-04-29 16:37:07 +08:00
})
getAssessTrend(row).then(res => {
2024-04-27 22:18:58 +08:00
picEChart.value = {
title: {
2024-04-29 16:37:07 +08:00
text: '各地市综合评估趋势对比'
2024-04-27 22:18:58 +08:00
},
xAxis: {
2024-05-09 18:00:04 +08:00
name: '时间',
data: res.data[0].children.map((item: any) => item.dataTime)
2024-04-27 22:18:58 +08:00
},
2024-04-29 16:37:07 +08:00
grid: {
bottom: '10px'
},
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,
series: []
2024-04-26 09:15:20 +08:00
}
2024-04-27 22:18:58 +08:00
}
2024-04-29 16:37:07 +08:00
let list: any = []
let time: any = []
res.data.forEach((item: any, num: any) => {
2024-05-09 18:00:04 +08:00
time.push(item.deptName)
list.push([])
2024-04-29 16:37:07 +08:00
item.children.forEach((val: any, i: any) => {
2024-05-09 18:00:04 +08:00
list[num].push(val.score == 3.14159 ? null : val.score)
2024-04-29 16:37:07 +08:00
})
})
list.forEach((item: any, i: any) => {
picEChart.value.options.series.push({
name: time[i],
type: 'line',
data: item
})
})
2024-04-27 22:18:58 +08:00
})
2024-04-26 09:15:20 +08:00
dialogVisible.value = true
}
2024-04-27 22:18:58 +08:00
const formatter = (row: any) => {
if (row.cellValue == 3.14159) {
2024-04-29 16:37:07 +08:00
return '/'
2024-04-27 22:18:58 +08:00
} else {
return row.cellValue
}
}
2024-04-26 09:15:20 +08:00
defineExpose({ open })
</script>
<style lang="scss" scoped></style>