修改辽宁测试问题

This commit is contained in:
guanj
2026-07-20 09:30:48 +08:00
parent 22011188a1
commit e77c57f8d0
4 changed files with 389 additions and 287 deletions

View File

@@ -20,7 +20,12 @@
</el-select>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="tableStore.table.params.searchState" clearable placeholder="请选择状态" filterable>
<el-select
v-model="tableStore.table.params.searchState"
clearable
placeholder="请选择状态"
filterable
>
<el-option
v-for="item in statusoption"
:key="item.id"
@@ -432,7 +437,9 @@ const tableStore = new TableStore({
},
loadCallback: () => {
tableRef.value.getRef().setCurrentRow(tableStore.table.data[0])
currentChangeEvent()
setTimeout(() => {
currentChangeEvent()
}, 100)
}
})
const nodeId = ref('')
@@ -440,6 +447,7 @@ const hasDevices = ref(false)
/// 点击行
const currentChangeEvent = () => {
// 确保 tableRef 和当前记录存在
if (!tableRef.value || !tableRef.value.getRef().getCurrentRecord()) {
loading.value = false
dataSource.value = []

View File

@@ -1,279 +1,364 @@
<template>
<div class="default-main online">
<div class="online_header">
<TableHeader date-picker area ref="tableHeaderRef" showCustomColumn>
<template #select>
<el-form-item label="统计类型">
<el-select
v-model="tableStore.table.params.statisticalType"
placeholder="请选择统计类型"
value-key="id"
style="width: 100%"
filterable
>
<el-option
v-for="item in classificationData"
:key="item.id"
:label="item.name"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="电压等级">
<el-select
v-model="tableStore.table.params.scale"
multiple
collapse-tags
clearable
placeholder="请选择电压等级"
style="width: 100%"
value-key="id"
filterable
>
<el-option
v-for="item in voltageleveloption"
:key="item.id"
:label="item.name"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="终端厂家">
<el-select
v-model="tableStore.table.params.manufacturer"
multiple
collapse-tags
clearable
placeholder="请选择终端厂家"
style="width: 100%"
value-key="id"
filterable
>
<el-option
v-for="(item, index) in terminaloption"
:key="index"
:label="item.name"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="干扰源类型">
<el-select
v-model="tableStore.table.params.loadType"
multiple
collapse-tags
clearable
placeholder="请选择干扰源类型"
style="width: 100%"
value-key="id"
filterable
>
<el-option
v-for="(item, index) in interfereoption"
:key="index"
:label="item.name"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="电网标志">
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志" filterable>
<el-option
v-for="item in sign"
:key="item.id"
:label="item.name"
:value="item.algoDescribe"
/>
</el-select>
</el-form-item>
<el-form-item label="筛选数据">
<el-input
v-model.trim="tableStore.table.params.searchValue"
clearable
style="width: 200px"
placeholder="请输入关键字筛选"
/>
</el-form-item>
</template>
</TableHeader>
</div>
<div class="online_main">
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
<el-tab-pane :name="0" :lazy="true" label="谐波畸变率统计表">
<Table
ref="tableRef"
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
:scroll-y="{ enabled: true }"
/>
</el-tab-pane>
<el-tab-pane :name="1" :lazy="true" label="谐波畸变率统计图">
<charts v-if="activeName == 1" ref="chartsRef" />
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<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'
import { filterTree } from '@/utils/tree'
defineOptions({
name: 'harmonic-boot/area/harmonicDistortionRate'
})
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 sign = dictData.getBasicData('power_flag')
const treeData = ref([])
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/tHDistortion/getTHDistortionData',
method: 'POST',
column: [
{
title: '',
field: 'name',
align: 'left',
treeNode: true,
width: 350
},
{
title: '电压等级',
field: 'voltageLevel',
align: 'center',
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
},
{
title: '网络参数',
field: 'networkParam',
align: 'center',
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
},
{
title: '监测点名称',
field: 'lineName',
align: 'center',
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
},
{
title: '总谐波畸变率(%)',
field: 'distortion',
align: 'center',
formatter: function (row) {
return row.cellValue == 3.14159 ? '暂无数据' : row.cellValue
}
}
],
loadCallback: () => {
tableStore.table.data = tree2List(
filterTree(tableStore.table.data, node => {
// 筛选条件name 包含关键词
return node.name.includes(tableStore.table.params.searchValue)
}),
Math.random() * 1000
)
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
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.powerFlag = sign[0]?.algoDescribe || 0
tableStore.table.params.serverName = 'harmonicBoot'
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
const tree2List = (list: any, id?: string) => {
//存储结果的数组
let arr: any = []
// 遍历 tree 数组
list.forEach((item: any) => {
item.uPid = id
item.uId = Math.random() * 1000
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的转换
const children = tree2List(item.children, item.uId)
// 删除item的children属性
delete item.children
// 把item和children数组添加至结果数组
//..children: 意思是把children数组展开
arr.push(item, ...children)
})
// 返回结果数组
return arr
}
onMounted(() => {
tableStore.index()
})
</script>
<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;
// }
// }
</style>
<template>
<div class="default-main online">
<div class="online_header">
<TableHeader date-picker area ref="tableHeaderRef" showCustomColumn>
<template #select>
<el-form-item label="统计类型">
<el-select
v-model="tableStore.table.params.statisticalType"
placeholder="请选择统计类型"
value-key="id"
style="width: 100%"
filterable
>
<el-option
v-for="item in classificationData"
:key="item.id"
:label="item.name"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="电压等级">
<el-select
v-model="tableStore.table.params.scale"
multiple
collapse-tags
clearable
placeholder="请选择电压等级"
style="width: 100%"
value-key="id"
filterable
>
<el-option
v-for="item in voltageleveloption"
:key="item.id"
:label="item.name"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="终端厂家">
<el-select
v-model="tableStore.table.params.manufacturer"
multiple
collapse-tags
clearable
placeholder="请选择终端厂家"
style="width: 100%"
value-key="id"
filterable
>
<el-option
v-for="(item, index) in terminaloption"
:key="index"
:label="item.name"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="干扰源类型">
<el-select
v-model="tableStore.table.params.loadType"
multiple
collapse-tags
clearable
placeholder="请选择干扰源类型"
style="width: 100%"
value-key="id"
filterable
>
<el-option
v-for="(item, index) in interfereoption"
:key="index"
:label="item.name"
:value="item"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="电网标志">
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志" filterable>
<el-option
v-for="item in sign"
:key="item.id"
:label="item.name"
:value="item.algoDescribe"
/>
</el-select>
</el-form-item>
<el-form-item label="筛选数据">
<el-input
v-model.trim="tableStore.table.params.searchValue"
clearable
style="width: 200px"
placeholder="请输入关键字筛选"
/>
</el-form-item>
</template>
</TableHeader>
</div>
<div class="online_main">
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
<el-tab-pane :name="0" :lazy="true">
<template #label>
<span class="custom-tabs-label">
<span>谐波畸变率统计表</span>
<el-tooltip class="box-item" effect="dark" placement="bottom" popper-class="thd-limit-tip">
<template #content>
<div class="thd-limit-tip__row">
<span>U < 6kV</span>
<span>5.0</span>
</div>
<div class="thd-limit-tip__row">
<span>6kV U 20kV</span>
<span>4.0</span>
</div>
<div class="thd-limit-tip__row">
<span>35kV U 66kV</span>
<span>3.0</span>
</div>
<div class="thd-limit-tip__row">
<span>110kV U 1000kV</span>
<span>2.0</span>
</div>
</template>
<el-icon><WarningFilled /></el-icon>
</el-tooltip>
</span>
</template>
<Table
ref="tableRef"
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
:scroll-y="{ enabled: true }"
/>
</el-tab-pane>
<el-tab-pane :name="1" :lazy="true" label="谐波畸变率统计图">
<charts v-if="activeName == 1" ref="chartsRef" />
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, watch, h, provide } 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 { WarningFilled } from '@element-plus/icons-vue'
import Table from '@/components/table/index.vue'
import charts from './components/charts.vue'
import { filterTree } from '@/utils/tree'
defineOptions({
name: 'harmonic-boot/area/harmonicDistortionRate'
})
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 sign = dictData.getBasicData('power_flag')
const treeData = ref([])
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 getDistortionLimit = (voltageLevel: any): number | null => {
if (voltageLevel === null || voltageLevel === undefined || voltageLevel === '' || voltageLevel === '/') {
return null
}
const match = String(voltageLevel).match(/(\d+(\.\d+)?)/)
if (!match) return null
const u = Number(match[1])
if (Number.isNaN(u)) return null
if (u < 6) return 5.0
if (u >= 6 && u <= 20) return 4.0
if (u >= 35 && u <= 66) return 3.0
if (u >= 110 && u <= 1000) return 2.0
return null
}
// const datePickerRef = ref()
const tableHeaderRef = ref()
const tableStore = new TableStore({
publicHeight: 60,
showPage: false,
url: '/harmonic-boot/tHDistortion/getTHDistortionData',
method: 'POST',
column: [
{
title: '',
field: 'name',
align: 'left',
treeNode: true,
width: 350
},
{
title: '电压等级',
field: 'voltageLevel',
align: 'center',
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
},
{
title: '网络参数',
field: 'networkParam',
align: 'center',
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
},
{
title: '监测点名称',
field: 'lineName',
align: 'center',
formatter: function (row) {
return row.cellValue ? row.cellValue : '/'
}
},
{
title: '总谐波畸变率(%)',
field: 'distortion',
align: 'center',
render: 'customRender',
customRender: props => {
const val = props.renderValue
if (val === 3.14159 || val === '3.14159') {
return h('span', '暂无数据')
}
if (val === null || val === undefined || val === '') {
return h('span', '/')
}
const limit = getDistortionLimit(props.renderRow?.voltageLevel)
const num = Number(val)
if (limit !== null && !Number.isNaN(num) && num > limit) {
return h('span', { style: { color: '#f56c6c', fontWeight: 'bold' } }, val)
}
return h('span', val)
}
}
],
loadCallback: () => {
tableStore.table.data = tree2List(
filterTree(tableStore.table.data, node => {
// 筛选条件name 包含关键词
return node.name.includes(tableStore.table.params.searchValue)
}),
Math.random() * 1000
)
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
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.powerFlag = sign[0]?.algoDescribe || 0
tableStore.table.params.serverName = 'harmonicBoot'
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
const tree2List = (list: any, id?: string) => {
//存储结果的数组
let arr: any = []
// 遍历 tree 数组
list.forEach((item: any) => {
item.uPid = id
item.uId = Math.random() * 1000
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的转换
const children = tree2List(item.children, item.uId)
// 删除item的children属性
delete item.children
// 把item和children数组添加至结果数组
//..children: 意思是把children数组展开
arr.push(item, ...children)
})
// 返回结果数组
return arr
}
onMounted(() => {
tableStore.index()
})
</script>
<style lang="scss" scoped>
:deep(.custom-tabs-label) {
.el-icon {
vertical-align: middle;
margin-left: 4px;
color: #000;
cursor: pointer;
}
span {
vertical-align: middle;
margin-right: 4px;
}
}
</style>
<style lang="scss">
.thd-limit-tip {
min-width: 200px;
padding: 10px 12px !important;
line-height: 1.5;
.thd-limit-tip__title {
margin-bottom: 8px;
padding-bottom: 6px;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
font-size: 13px;
font-weight: 600;
}
.thd-limit-tip__row {
display: flex;
justify-content: space-between;
gap: 24px;
padding: 3px 0;
font-size: 12px;
span:last-child {
font-variant-numeric: tabular-nums;
font-weight: 600;
// color: var(--el-color-danger);
}
}
}
</style>

View File

@@ -38,10 +38,15 @@
<el-tab-pane label="告警数据统计" name="5" lazy v-if="!isReload && VITE_FLAG">
<Gaojingshujutongji v-if="activeName == '5'" />
</el-tab-pane>
<el-tab-pane label="监测点运行状态" name="6" lazy v-if="!isReload && !VITE_FLAG1 && !IS_LNQR">
<el-tab-pane
label="监测点运行状态"
name="6"
lazy
v-if="!isReload && !VITE_FLAG1 && !IS_LNQR && !IS_LN"
>
<Yunxingzhuangtai v-if="activeName == '6'" />
</el-tab-pane>
<el-tab-pane label="实时数据" name="7" lazy v-if="!isReload && !VITE_FLAG1 && !IS_LNQR">
<el-tab-pane label="实时数据" name="7" lazy v-if="!isReload && !VITE_FLAG1 && !IS_LNQR">
<Shishishuju v-if="activeName == '7'" />
</el-tab-pane>
<el-tab-pane label="统计报表" name="8" lazy v-if="!isReload && VITE_FLAG">
@@ -79,6 +84,7 @@ const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
const VITE_FLAG1 = import.meta.env.VITE_NAME == 'hainan'
// 环境标识
const IS_LNQR = import.meta.env.VITE_NAME === 'LNqr'
const IS_LN = import.meta.env.VITE_NAME === 'LN'
import router from '@/router'
import { useMonitoringPoint } from '@/stores/monitoringPoint'
import { id } from 'element-plus/es/locale'

View File

@@ -69,7 +69,8 @@ const tableStore = new TableStore({
}
},
{
title: '操作',fixed: 'right',
title: '操作',
fixed: 'right',
align: 'center',
width: '180',
render: 'buttons',
@@ -108,9 +109,11 @@ const tableStore = new TableStore({
],
loadCallback: () => {
tableRef.value.getRef().setCurrentRow(tableStore.table.data[0])
currentChange({
row: tableStore.table.data[0]
})
setTimeout(() => {
currentChange({
row: tableStore.table.data[0]
})
}, 100)
}
})
tableStore.table.params.searchValue = ''