修改辽宁测试问题

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

View File

@@ -1,279 +1,364 @@
<template> <template>
<div class="default-main online"> <div class="default-main online">
<div class="online_header"> <div class="online_header">
<TableHeader date-picker area ref="tableHeaderRef" showCustomColumn> <TableHeader date-picker area ref="tableHeaderRef" showCustomColumn>
<template #select> <template #select>
<el-form-item label="统计类型"> <el-form-item label="统计类型">
<el-select <el-select
v-model="tableStore.table.params.statisticalType" v-model="tableStore.table.params.statisticalType"
placeholder="请选择统计类型" placeholder="请选择统计类型"
value-key="id" value-key="id"
style="width: 100%" style="width: 100%"
filterable filterable
> >
<el-option <el-option
v-for="item in classificationData" v-for="item in classificationData"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item" :value="item"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="电压等级"> <el-form-item label="电压等级">
<el-select <el-select
v-model="tableStore.table.params.scale" v-model="tableStore.table.params.scale"
multiple multiple
collapse-tags collapse-tags
clearable clearable
placeholder="请选择电压等级" placeholder="请选择电压等级"
style="width: 100%" style="width: 100%"
value-key="id" value-key="id"
filterable filterable
> >
<el-option <el-option
v-for="item in voltageleveloption" v-for="item in voltageleveloption"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item" :value="item"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="终端厂家"> <el-form-item label="终端厂家">
<el-select <el-select
v-model="tableStore.table.params.manufacturer" v-model="tableStore.table.params.manufacturer"
multiple multiple
collapse-tags collapse-tags
clearable clearable
placeholder="请选择终端厂家" placeholder="请选择终端厂家"
style="width: 100%" style="width: 100%"
value-key="id" value-key="id"
filterable filterable
> >
<el-option <el-option
v-for="(item, index) in terminaloption" v-for="(item, index) in terminaloption"
:key="index" :key="index"
:label="item.name" :label="item.name"
:value="item" :value="item"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="干扰源类型"> <el-form-item label="干扰源类型">
<el-select <el-select
v-model="tableStore.table.params.loadType" v-model="tableStore.table.params.loadType"
multiple multiple
collapse-tags collapse-tags
clearable clearable
placeholder="请选择干扰源类型" placeholder="请选择干扰源类型"
style="width: 100%" style="width: 100%"
value-key="id" value-key="id"
filterable filterable
> >
<el-option <el-option
v-for="(item, index) in interfereoption" v-for="(item, index) in interfereoption"
:key="index" :key="index"
:label="item.name" :label="item.name"
:value="item" :value="item"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="电网标志"> <el-form-item label="电网标志">
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志" filterable> <el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志" filterable>
<el-option <el-option
v-for="item in sign" v-for="item in sign"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.algoDescribe" :value="item.algoDescribe"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="筛选数据"> <el-form-item label="筛选数据">
<el-input <el-input
v-model.trim="tableStore.table.params.searchValue" v-model.trim="tableStore.table.params.searchValue"
clearable clearable
style="width: 200px" style="width: 200px"
placeholder="请输入关键字筛选" placeholder="请输入关键字筛选"
/> />
</el-form-item> </el-form-item>
</template> </template>
</TableHeader> </TableHeader>
</div> </div>
<div class="online_main"> <div class="online_main">
<el-tabs v-model="activeName" type="border-card" @tab-click="handleClick"> <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
<el-tab-pane :name="0" :lazy="true" label="谐波畸变率统计表"> <el-tab-pane :name="0" :lazy="true">
<Table <template #label>
ref="tableRef" <span class="custom-tabs-label">
:tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }" <span>谐波畸变率统计表</span>
:scroll-y="{ enabled: true }"
<el-tooltip class="box-item" effect="dark" placement="bottom" popper-class="thd-limit-tip">
/> <template #content>
</el-tab-pane> <div class="thd-limit-tip__row">
<el-tab-pane :name="1" :lazy="true" label="谐波畸变率统计图"> <span>U < 6kV</span>
<charts v-if="activeName == 1" ref="chartsRef" /> <span>5.0</span>
</el-tab-pane> </div>
</el-tabs> <div class="thd-limit-tip__row">
</div> <span>6kV U 20kV</span>
</div> <span>4.0</span>
</template> </div>
<script lang="ts" setup> <div class="thd-limit-tip__row">
import { ref, onMounted, watch } from 'vue' <span>35kV U 66kV</span>
import { useDictData } from '@/stores/dictData' <span>3.0</span>
import DatePicker from '@/components/form/datePicker/index.vue' </div>
import { getAreaDept } from '@/api/harmonic-boot/area' <div class="thd-limit-tip__row">
import TableHeader from '@/components/table/header/index.vue' <span>110kV U 1000kV</span>
import TableStore from '@/utils/tableStore' <span>2.0</span>
import Table from '@/components/table/index.vue' </div>
import charts from './components/charts.vue' </template>
import { filterTree } from '@/utils/tree' <el-icon><WarningFilled /></el-icon>
defineOptions({ </el-tooltip>
name: 'harmonic-boot/area/harmonicDistortionRate' </span>
}) </template>
const tableRef = ref() <Table
const onlineChartsRef = ref() ref="tableRef"
const dictData = useDictData() :tree-config="{ transform: true, parentField: 'uPid', rowField: 'uId' }"
//字典获取电压等级 :scroll-y="{ enabled: true }"
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand') />
//字典获取终端厂家 </el-tab-pane>
const terminaloption = dictData.getBasicData('Dev_Manufacturers') <el-tab-pane :name="1" :lazy="true" label="谐波畸变率统计图">
//字典获取干扰源类型 <charts v-if="activeName == 1" ref="chartsRef" />
const interfereoption = dictData.getBasicData('Interference_Source') </el-tab-pane>
//字典获取统计类型 </el-tabs>
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type']) </div>
//调用区域接口获取区域 </div>
const sign = dictData.getBasicData('power_flag') </template>
const treeData = ref([]) <script lang="ts" setup>
const idArr = ref([]) import { ref, onMounted, watch, h, provide } from 'vue'
const activeName = ref(0) import { useDictData } from '@/stores/dictData'
const getTreeData = async () => { import DatePicker from '@/components/form/datePicker/index.vue'
await getAreaDept().then(res => { import { getAreaDept } from '@/api/harmonic-boot/area'
var data = res.data import TableHeader from '@/components/table/header/index.vue'
data.forEach(element => { import TableStore from '@/utils/tableStore'
idArr.value.push(element.id) import { WarningFilled } from '@element-plus/icons-vue'
}) import Table from '@/components/table/index.vue'
treeData.value = JSON.parse(JSON.stringify(res.data)) import charts from './components/charts.vue'
}) import { filterTree } from '@/utils/tree'
} defineOptions({
getTreeData() name: 'harmonic-boot/area/harmonicDistortionRate'
})
const chartsRef = ref() const tableRef = ref()
const handleClick = (tab: any, e: any) => { const onlineChartsRef = ref()
// console.log(tab,e,"??????????"); const dictData = useDictData()
// if(activeName.value===1){ //字典获取电压等级
tableStore.index() const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
// } //字典获取终端厂家
} const terminaloption = dictData.getBasicData('Dev_Manufacturers')
//字典获取干扰源类型
// const datePickerRef = ref() const interfereoption = dictData.getBasicData('Interference_Source')
const tableHeaderRef = ref() //字典获取统计类型
const tableStore = new TableStore({ const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
publicHeight: 60, //调用区域接口获取区域
showPage: false, const sign = dictData.getBasicData('power_flag')
url: '/harmonic-boot/tHDistortion/getTHDistortionData', const treeData = ref([])
method: 'POST', const idArr = ref([])
column: [ const activeName = ref(0)
{ const getTreeData = async () => {
title: '', await getAreaDept().then(res => {
field: 'name', var data = res.data
align: 'left', data.forEach(element => {
treeNode: true, idArr.value.push(element.id)
width: 350 })
}, treeData.value = JSON.parse(JSON.stringify(res.data))
{ })
title: '电压等级', }
field: 'voltageLevel', getTreeData()
align: 'center',
formatter: function (row) { const chartsRef = ref()
return row.cellValue ? row.cellValue : '/' const handleClick = (tab: any, e: any) => {
} // console.log(tab,e,"??????????");
}, // if(activeName.value===1){
{ tableStore.index()
title: '网络参数', // }
field: 'networkParam', }
align: 'center',
formatter: function (row) { const getDistortionLimit = (voltageLevel: any): number | null => {
return row.cellValue ? row.cellValue : '/' if (voltageLevel === null || voltageLevel === undefined || voltageLevel === '' || voltageLevel === '/') {
} return null
}, }
{ const match = String(voltageLevel).match(/(\d+(\.\d+)?)/)
title: '监测点名称', if (!match) return null
field: 'lineName', const u = Number(match[1])
align: 'center', if (Number.isNaN(u)) return null
formatter: function (row) { if (u < 6) return 5.0
return row.cellValue ? row.cellValue : '/' 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
title: '总谐波畸变率(%)', }
field: 'distortion',
align: 'center', // const datePickerRef = ref()
formatter: function (row) { const tableHeaderRef = ref()
return row.cellValue == 3.14159 ? '暂无数据' : row.cellValue const tableStore = new TableStore({
} publicHeight: 60,
} showPage: false,
], url: '/harmonic-boot/tHDistortion/getTHDistortionData',
method: 'POST',
loadCallback: () => { column: [
tableStore.table.data = tree2List( {
filterTree(tableStore.table.data, node => { title: '',
// 筛选条件name 包含关键词 field: 'name',
return node.name.includes(tableStore.table.params.searchValue) align: 'left',
}), treeNode: true,
Math.random() * 1000 width: 350
) },
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name {
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params) title: '电压等级',
setTimeout(() => { field: 'voltageLevel',
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true) align: 'center',
}, 0) formatter: function (row) {
} return row.cellValue ? row.cellValue : '/'
}) }
},
tableStore.table.params.statisticalType = classificationData[0] {
tableStore.table.params.scale = [] title: '网络参数',
tableStore.table.params.manufacturer = [] field: 'networkParam',
tableStore.table.params.loadType = [] align: 'center',
tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0 formatter: function (row) {
tableStore.table.params.serverName = 'harmonicBoot' return row.cellValue ? row.cellValue : '/'
tableStore.table.params.searchValue = '' }
provide('tableStore', tableStore) },
const tree2List = (list: any, id?: string) => { {
//存储结果的数组 title: '监测点名称',
let arr: any = [] field: 'lineName',
// 遍历 tree 数组 align: 'center',
list.forEach((item: any) => { formatter: function (row) {
item.uPid = id return row.cellValue ? row.cellValue : '/'
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) title: '总谐波畸变率(%)',
// 函数递归对children数组进行tree2List的转换 field: 'distortion',
const children = tree2List(item.children, item.uId) align: 'center',
// 删除item的children属性 render: 'customRender',
delete item.children customRender: props => {
// 把item和children数组添加至结果数组 const val = props.renderValue
//..children: 意思是把children数组展开 if (val === 3.14159 || val === '3.14159') {
arr.push(item, ...children) return h('span', '暂无数据')
}) }
// 返回结果数组 if (val === null || val === undefined || val === '') {
return arr return h('span', '/')
} }
onMounted(() => { const limit = getDistortionLimit(props.renderRow?.voltageLevel)
tableStore.index() const num = Number(val)
}) if (limit !== null && !Number.isNaN(num) && num > limit) {
</script> return h('span', { style: { color: '#f56c6c', fontWeight: 'bold' } }, val)
<style lang="scss" scoped> }
// .online { return h('span', val)
// width: 100%; }
// height: 100%; }
// .online_header { ],
// width: 100%;
// max-height: 140px; loadCallback: () => {
// padding: 10px; tableStore.table.data = tree2List(
// box-sizing: border-box; filterTree(tableStore.table.data, node => {
// } // 筛选条件name 包含关键词
// .online_main { return node.name.includes(tableStore.table.params.searchValue)
// padding: 0 10px; }),
// } Math.random() * 1000
// } )
</style> 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"> <el-tab-pane label="告警数据统计" name="5" lazy v-if="!isReload && VITE_FLAG">
<Gaojingshujutongji v-if="activeName == '5'" /> <Gaojingshujutongji v-if="activeName == '5'" />
</el-tab-pane> </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'" /> <Yunxingzhuangtai v-if="activeName == '6'" />
</el-tab-pane> </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'" /> <Shishishuju v-if="activeName == '7'" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="统计报表" name="8" lazy v-if="!isReload && VITE_FLAG"> <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 VITE_FLAG1 = import.meta.env.VITE_NAME == 'hainan'
// 环境标识 // 环境标识
const IS_LNQR = import.meta.env.VITE_NAME === 'LNqr' const IS_LNQR = import.meta.env.VITE_NAME === 'LNqr'
const IS_LN = import.meta.env.VITE_NAME === 'LN'
import router from '@/router' import router from '@/router'
import { useMonitoringPoint } from '@/stores/monitoringPoint' import { useMonitoringPoint } from '@/stores/monitoringPoint'
import { id } from 'element-plus/es/locale' 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', align: 'center',
width: '180', width: '180',
render: 'buttons', render: 'buttons',
@@ -108,9 +109,11 @@ const tableStore = new TableStore({
], ],
loadCallback: () => { loadCallback: () => {
tableRef.value.getRef().setCurrentRow(tableStore.table.data[0]) tableRef.value.getRef().setCurrentRow(tableStore.table.data[0])
currentChange({ setTimeout(() => {
row: tableStore.table.data[0] currentChange({
}) row: tableStore.table.data[0]
})
}, 100)
} }
}) })
tableStore.table.params.searchValue = '' tableStore.table.params.searchValue = ''