Files
admin-sjzx/src/views/pqs/harmonicMonitoring/area/qualifiedRate/index.vue

354 lines
12 KiB
Vue
Raw Normal View History

2024-11-13 16:21:08 +08:00
<template>
<div class="default-main online">
<div class="online_header">
<TableHeader date-picker area ref="tableHeaderRef">
<template #select>
<el-form-item label="统计类型:">
2025-04-25 15:15:25 +08:00
<el-select
v-model="tableStore.table.params.statisticalType"
placeholder="请选择统计类型"
value-key="id"
style="width: 100%"
>
<el-option
v-for="item in classificationData"
:key="item.id"
:label="item.name"
:value="item"
></el-option>
2024-11-13 16:21:08 +08:00
</el-select>
</el-form-item>
<el-form-item label="电压等级:">
2025-04-25 15:15:25 +08:00
<el-select
v-model="tableStore.table.params.scale"
multiple
collapse-tags
clearable
placeholder="请选择电压等级"
style="width: 100%"
value-key="id"
>
<el-option
v-for="item in voltageleveloption"
:key="item.id"
:label="item.name"
:value="item"
></el-option>
2024-11-13 16:21:08 +08:00
</el-select>
</el-form-item>
<el-form-item label="终端厂家:">
2025-04-25 15:15:25 +08:00
<el-select
v-model="tableStore.table.params.manufacturer"
multiple
collapse-tags
clearable
placeholder="请选择终端厂家"
style="width: 100%"
value-key="id"
>
<el-option
v-for="(item, index) in terminaloption"
:key="index"
:label="item.name"
:value="item"
></el-option>
2024-11-13 16:21:08 +08:00
</el-select>
</el-form-item>
<el-form-item label="干扰源类型:">
2025-04-25 15:15:25 +08:00
<el-select
v-model="tableStore.table.params.loadType"
multiple
collapse-tags
clearable
placeholder="请选择干扰源类型"
style="width: 100%"
value-key="id"
>
<el-option
v-for="(item, index) in interfereoption"
:key="index"
:label="item.name"
:value="item"
></el-option>
2024-11-13 16:21:08 +08:00
</el-select>
</el-form-item>
2025-04-29 15:59:23 +08:00
<el-form-item label="电网标志">
2026-01-20 14:18:41 +08:00
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
<el-option
v-for="item in sign"
:key="item.id"
:label="item.name"
:value="item.algoDescribe"
/>
</el-select>
</el-form-item>
2024-11-13 16:21:08 +08:00
</template>
</TableHeader>
</div>
<div class="online_main">
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
2025-04-25 09:18:50 +08:00
<el-tab-pane :name="0" :lazy="true" label="稳态合格率统计表">
2025-04-25 15:15:25 +08:00
<Table
ref="tableRef"
2025-04-30 16:00:26 +08:00
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
2025-04-25 15:15:25 +08:00
:scroll-y="{ enabled: true }"
v-if="activeName == 0"
/>
2024-11-13 16:21:08 +08:00
</el-tab-pane>
2025-04-25 09:18:50 +08:00
<el-tab-pane :name="1" :lazy="true" label="稳态合格率统计图">
2024-11-13 16:21:08 +08:00
<charts v-if="activeName == 1" ref="chartsRef" />
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
2024-11-13 16:21:08 +08:00
<script lang="ts" setup>
import { ref, onMounted, watch } from 'vue'
import { useDictData } from '@/stores/dictData'
import DatePicker from '@/components/form/datePicker/index.vue'
import { getAreaDept } from '@/api/harmonic-boot/area'
import TableHeader from '@/components/table/header/index.vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import charts from './components/charts.vue'
defineOptions({
name: 'harmonic-boot/area/qualifiedRate'
})
const tableRef = ref()
const onlineChartsRef = ref()
const dictData = useDictData()
//字典获取电压等级
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
//字典获取终端厂家
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
//字典获取干扰源类型
const interfereoption = dictData.getBasicData('Interference_Source')
//字典获取统计类型
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
//调用区域接口获取区域
const treeData = ref([])
2025-04-29 15:59:23 +08:00
const sign = dictData.getBasicData('power_flag')
2024-11-13 16:21:08 +08:00
const idArr = ref([])
const activeName = ref(0)
const getTreeData = async () => {
await getAreaDept().then(res => {
var data = res.data
data.forEach(element => {
idArr.value.push(element.id)
})
treeData.value = JSON.parse(JSON.stringify(res.data))
})
}
getTreeData()
const chartsRef = ref()
const handleClick = (tab: any, e: any) => {
// console.log(tab,e,"??????????");
// if(activeName.value===1){
tableStore.index()
// }
}
// const datePickerRef = ref()
const tableHeaderRef = ref()
const tableStore = new TableStore({
publicHeight: 60,
showPage: false,
url: '/harmonic-boot/steadyQualify/getSteadyQualifyData',
method: 'POST',
column: [
2025-04-25 15:15:25 +08:00
{ title: '', field: 'name', align: 'left', treeNode: true, width: 350 },
{
title: '电压等级',
field: 'voltageLevel',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 80,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
},
{
title: '网络参数',
field: 'networkParam',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 120,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
},
{
title: '监测点名称',
field: 'lineName',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 120,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
},
{
title: '厂家',
field: 'factoryName',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 80,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
},
{
title: '谐波电压(%)',
field: 'harmonicVoltage',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 80,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
},
{
title: '电压偏差(%)',
field: 'voltageOffset',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 80,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
},
{
title: '三相电压不平衡度(%)',
field: 'voltageUnbalance',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 100,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
},
{
title: '间谐波电压含有率(%)',
field: 'interHarmonic',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 100,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
},
{
title: '谐波电流(%)',
field: 'harmonicCurrent',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 80,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
},
{
title: '负序电流(%)',
field: 'negativeCurrent',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 80,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
},
{
title: '频率偏差(%)',
field: 'freqOffset',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 80,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
},
{
title: '闪变(%)',
field: 'flicker',
align: 'center',
2026-01-20 14:18:41 +08:00
minWidth: 80,
2025-04-25 15:15:25 +08:00
formatter: function (row) {
return row.cellValue != 3.14159 ? row.cellValue : '/'
}
}
2024-11-13 16:21:08 +08:00
],
loadCallback: () => {
2025-04-30 16:00:26 +08:00
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
2024-11-13 16:21:08 +08:00
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
2026-01-20 14:18:41 +08:00
2024-11-13 16:21:08 +08:00
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
setTimeout(() => {
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
}, 0)
}
})
tableStore.table.params.statisticalType = classificationData[0]
tableStore.table.params.scale = []
tableStore.table.params.manufacturer = []
tableStore.table.params.loadType = []
tableStore.table.params.serverName = 'harmonicBoot'
2025-04-29 15:59:23 +08:00
tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0
2024-11-13 16:21:08 +08:00
provide('tableStore', tableStore)
2025-04-30 16:00:26 +08:00
// const tree2List = (list: any, pid?: string) => {
// //存储结果的数组
// let arr: any = []
// // 遍历 tree 数组
// list.forEach((item: any) => {
// // item.comFlag = item.comFlag == null ? 3 : item.comFlag
// item.valueOver == 3.14159 ? 0 : item.valueOver >= 90 ? 1 : item.valueOver && item.valueOver < 90 ? 2 : 3
// item.pid = pid
// // 判断item是否存在children
// if (!item.children) return arr.push(item)
// // 函数递归对children数组进行tree2List的转换
// const children = tree2List(item.children, item.id)
// // 删除item的children属性
// delete item.children
// // 把item和children数组添加至结果数组
// //..children: 意思是把children数组展开
// arr.push(item, ...children)
// })
// // 返回结果数组
// return arr
// }
const tree2List = (list: any, id?: string) => {
2024-11-13 16:21:08 +08:00
//存储结果的数组
let arr: any = []
// 遍历 tree 数组
list.forEach((item: any) => {
2025-04-30 16:00:26 +08:00
item.uPid = id
item.uId = Math.random() * 1000
2024-11-13 16:21:08 +08:00
item.valueOver == 3.14159 ? 0 : item.valueOver >= 90 ? 1 : item.valueOver && item.valueOver < 90 ? 2 : 3
// 判断item是否存在children
if (!item.children) return arr.push(item)
// 函数递归对children数组进行tree2List的转换
2025-04-30 16:00:26 +08:00
const children = tree2List(item.children, item.uId)
2024-11-13 16:21:08 +08:00
// 删除item的children属性
delete item.children
// 把item和children数组添加至结果数组
//..children: 意思是把children数组展开
arr.push(item, ...children)
})
// 返回结果数组
return arr
2026-01-20 14:18:41 +08:00
}
2025-04-25 15:15:25 +08:00
onMounted(() => {
tableStore.index()
})
2024-11-13 16:21:08 +08:00
</script>
2024-11-13 16:21:08 +08:00
<style lang="scss" scoped>
// .online {
// width: 100%;
// height: 100%;
// .online_header {
// width: 100%;
// max-height: 140px;
// padding: 10px;
// box-sizing: border-box;
// }
// .online_main {
// padding: 0 10px;
// }
2025-04-25 15:15:25 +08:00
// }
</style>