修改测试bug

This commit is contained in:
guanj
2026-02-04 09:35:24 +08:00
parent dd0dab7643
commit 3fdb41c468
21 changed files with 308 additions and 156 deletions

View File

@@ -47,7 +47,6 @@ const init = () => {
tooltip: {
trigger: 'axis',
formatter: (params: any) => {
console.log('🚀 ~ init ~ params:', params)
if (!params || params.length === 0) return ''
// 使用第一个项目的轴标签作为时间标题
@@ -90,8 +89,6 @@ const initData = async (row: any) => {
let [min, max] = yMethod(res.data.map((item: any) => item.value.split(',')).flat())
// 从第一条数据中提取时间作为x轴数据
const firstItem = res.data[0]
const xAxisData = firstItem.time.split(',')
// 定义相位颜色映射
const phaseColors: any = {
@@ -107,6 +104,7 @@ const initData = async (row: any) => {
return a.phasic.localeCompare(b.phasic)
})
.map((item: any) => {
const xAxisData = item.time.split(',')
const values = xAxisData.map((time: string, index: number) => {
// 将传入的日期与时间拼接成完整的时间字符串
const fullTime = `${row.time} ${time}`

View File

@@ -21,7 +21,8 @@
isGroup
></Table>
<!-- 指标日趋势图 -->
<DailyTrendChart v-if="dialogTrendChart" ref="dailyTrendChartRef" @close="dialogTrendChart = false" />
<HarmonicRatio ref="harmonicRatioRef" v-if="dialogFlag" @close="onHarmonicRatioClose" :showIndex="false" />
<!-- <DailyTrendChart v-if="dialogTrendChart" ref="dailyTrendChartRef" @close="dialogTrendChart = false" /> -->
</div>
</template>
<script setup lang="ts">
@@ -31,9 +32,10 @@ import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import MyEchart from '@/components/echarts/MyEchart.vue'
import { getTimeOfTheMonth } from '@/utils/formatTime'
import { ElMessage, ElMessageBox } from 'element-plus'
import DailyTrendChart from '@/components/cockpit/exceedanceLevel/components/dailyTrendChart.vue'
import { getTime } from '@/utils/formatTime'
import HarmonicRatio from '@/components/cockpit/overLimitStatistics/components/harmonicRatio.vue'
const prop = defineProps({
w: { type: [String, Number] },
h: { type: [String, Number] },
@@ -47,7 +49,7 @@ const prop = defineProps({
const TableHeaderRef = ref()
const headerHeight = ref(57)
const harmonicRatioRef: any = ref(null)
const dialogTrendChart = ref(false)
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
@@ -118,7 +120,7 @@ const tableStore: any = new TableStore({
field: 'extent',
minWidth: '70',
formatter: (row: any) => {
return Math.floor(row.cellValue * 100) / 100
return Math.floor(row.cellValue * 100) / 100
}
},
{
@@ -143,23 +145,14 @@ const tableStore: any = new TableStore({
},
loadCallback: () => {
// 定义 x 轴标签顺序
const xAxisLabels = ['长时闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
// 根据指标名称顺序提取对应的 extent 数据
const chartData = xAxisLabels.map(label => {
// 在表格数据中查找对应指标名称的数据项
const item = tableStore.table.data.find((row: any) => row.name === label)
// 如果找到对应项,则返回 extent 值,否则返回 0并保留两位小数
const extentValue = item ? item.extent || 0 : 0
return Math.round(extentValue * 100) / 100
})
echartList.value = {
title: {
text: '指标越限严重度'
},
xAxis: {
data: xAxisLabels
data: tableStore.table.data.map((item: any) => item.name)
},
yAxis: {
@@ -175,7 +168,7 @@ const tableStore: any = new TableStore({
{
type: 'bar',
name: '越限占比',
data: chartData,
data: tableStore.table.data.map((item: any) => Math.floor(item.extent * 100) / 100),
barMaxWidth: 30
}
]
@@ -188,15 +181,32 @@ const tableRef = ref()
provide('tableRef', tableRef)
provide('tableStore', tableStore)
const codeMap = [
{ key: '闪变', code: 'flickerOvertime' },
{ key: '电压偏差', code: 'voltageDevOvertime' },
{ key: '三相', code: 'ubalanceOvertime' },
{ key: '谐波电压', code: 'uharm' },
{ key: '谐波电流', code: 'iharm' },
];
// 点击行
const cellClickEvent = ({ row, column }: any) => {
dialogTrendChart.value = true
if (column.field == 'maxValue' && row.lineId) {
nextTick(() => {
dailyTrendChartRef.value.open(row)
if (column.field == 'maxValue' ) {
if(row.lineId==null){
ElMessage.info('暂无越限监测点!')
}else{
nextTick(() => {
// dailyTrendChartRef.value.open(row)
dialogFlag.value = true
nextTick(() => {
const code = codeMap.find(item => row.name.includes(item.key))?.code || '';
harmonicRatioRef.value.openDialog(row,code,column.title.replace(/次/g, ""))
})
})
}
}
}
@@ -218,6 +228,14 @@ const setTime = () => {
console.warn('获取时间失败time 不是一个有效数组')
}
}
const dialogFlag=ref(false)
// 谐波弹窗关闭时的回调
const onHarmonicRatioClose = () => {
dialogFlag.value = false
// 重新打开指标越限详情弹窗
}
onMounted(() => {
tableStore.index()

View File

@@ -93,15 +93,7 @@ const tableStore: any = new TableStore({
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`
}
},
{
title: '谐波电压越限(%)',
children: loop50('uharm')
},
{
title: '谐波电流越限(%)',
children: loop50('iharm')
},
{
{
title: '电压偏差越限(%)',
field: 'voltageDevOvertime',
width: '100',
@@ -119,6 +111,15 @@ const tableStore: any = new TableStore({
return `<span style='cursor: pointer;text-decoration: underline;'>${row.ubalanceOvertime}</span>`
}
},
{
title: '谐波电压越限(%)',
children: loop50('uharm')
},
{
title: '谐波电流越限(%)',
children: loop50('iharm')
},
// {
// title: '频率偏差越限(%)',

View File

@@ -93,15 +93,7 @@ const tableStore: any = new TableStore({
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`
}
},
{
title: '谐波电压越限(分钟)',
children: loop50('uharm')
},
{
title: '谐波电流越限(分钟)',
children: loop50('iharm')
}, {
}, {
title: '电压偏差越限(分钟)',
field: 'uaberranceOvertime',
width: '100',
@@ -119,6 +111,14 @@ const tableStore: any = new TableStore({
return `<span style='cursor: pointer;text-decoration: underline;'>${row.ubalanceOvertime}</span>`
}
},
{
title: '谐波电压越限(分钟)',
children: loop50('uharm')
},
{
title: '谐波电流越限(分钟)',
children: loop50('iharm')
},
// {
// title: '频率偏差越限(分钟)',

View File

@@ -73,15 +73,7 @@ const tableStore: any = new TableStore({
field: 'flicker',
width: '80'
},
{
title: '谐波电压越限(分钟)',
children: loop50('voltage')
},
{
title: '谐波电流越限(分钟)',
children: loop50('harmonicCurrent')
},
{
{
title: '三相不平衡度越限(分钟)',
field: 'flicker',
width: '100'
@@ -95,7 +87,16 @@ const tableStore: any = new TableStore({
title: '频率偏差越限(分钟)',
field: 'flicker',
width: '100'
}
},
{
title: '谐波电压越限(分钟)',
children: loop50('voltage')
},
{
title: '谐波电流越限(分钟)',
children: loop50('harmonicCurrent')
},
],
beforeSearchFun: () => {},
loadCallback: () => {

View File

@@ -92,15 +92,7 @@ const tableStore: any = new TableStore({
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flicker}</span>`
}
},
{
title: '谐波电压越限(分钟)',
children: loop50('voltage')
},
{
title: '谐波电流越限(分钟)',
children: loop50('harmonicCurrent')
},
{
{
title: '三相不平衡度越限(分钟)',
field: 'flicker',
width: '100'
@@ -114,7 +106,16 @@ const tableStore: any = new TableStore({
title: '频率偏差越限(分钟)',
field: 'flicker',
width: '100'
}
},
{
title: '谐波电压越限(分钟)',
children: loop50('voltage')
},
{
title: '谐波电流越限(分钟)',
children: loop50('harmonicCurrent')
},
],
beforeSearchFun: () => {},
loadCallback: () => {

View File

@@ -93,15 +93,7 @@ const tableStore: any = new TableStore({
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`
}
},
{
title: '谐波电压越限(%)',
children: loop50('uharm')
},
{
title: '谐波电流越限(%)',
children: loop50('iharm')
},
{
{
title: '电压偏差越限(%)',
field: 'voltageDevOvertime',
width: '100',
@@ -119,6 +111,15 @@ const tableStore: any = new TableStore({
return `<span style='cursor: pointer;text-decoration: underline;'>${row.ubalanceOvertime}</span>`
}
},
{
title: '谐波电压越限(%)',
children: loop50('uharm')
},
{
title: '谐波电流越限(%)',
children: loop50('iharm')
},
// {
// title: '频率偏差越限(%)',

View File

@@ -5,10 +5,22 @@
ref="TableHeaderRef"
:showReset="false"
@selectChange="selectChange"
v-if="fullscreen"
:timeKeyList="prop.timeKey"
></TableHeader>
>
<template #select>
<el-form-item label="关键字筛选">
<el-input
maxlength="32"
show-word-limit
style="width: 240px"
v-model.trim="tableStore.table.params.searchValue"
clearable
placeholder="请输入监测点名称"
/>
</el-form-item>
</template>
</TableHeader>
<Table
ref="tableRef"
@cell-click="cellClickEvent"
@@ -189,7 +201,7 @@ const tableStore: any = new TableStore({
field: 'volGrade',
minWidth: '80',
formatter: (row: any) => {
return row.cellValue==0?'/': row.cellValue+'kV' || '/'
return row.cellValue == 0 ? '/' : row.cellValue + 'kV' || '/'
}
},
{
@@ -236,7 +248,8 @@ const tableStore: any = new TableStore({
}
},
{
title: '操作', fixed: 'right',
title: '操作',
fixed: 'right',
width: 150,
render: 'buttons',
buttons: [
@@ -294,6 +307,7 @@ const tableStore: any = new TableStore({
const tableRef = ref()
provide('tableRef', tableRef)
tableStore.table.params.keywords = ''
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
const setTime = () => {
@@ -304,7 +318,6 @@ const setTime = () => {
// ? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
// : prop.timeValue
// )
// if (Array.isArray(time)) {
// tableStore.table.params.searchBeginTime = time[0]
// tableStore.table.params.searchEndTime = time[1]

View File

@@ -1,5 +1,5 @@
<template>
<el-dialog draggable title="趋势图" v-model="dialogVisible" append-to-body width="70%">
<el-dialog draggable :title="titles" v-model="dialogVisible" append-to-body width="70%">
<!-- 总体指标占比详情谐波含有率 -->
<div>
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange">
@@ -7,7 +7,7 @@
<el-form-item>
<DatePicker ref="datePickerRef"></DatePicker>
</el-form-item>
<el-form-item label="统计指标" label-width="80px">
<el-form-item label="统计指标" label-width="80px" v-if="props.showIndex">
<el-select
multiple
:multiple-limit="2"
@@ -107,9 +107,14 @@ defineOptions({
const props = defineProps({
TrendList: {
type: Array
},
showIndex:{
type: Boolean,
default: true
}
})
const titles = ref('趋势图')
const dialogVisible: any = ref(false)
// console.log("🚀 ~ props:", props.TrendList)
const showEchart = ref(true)
@@ -268,6 +273,7 @@ const lineStyle = [{ type: 'solid' }, { type: 'dashed' }, { type: 'dotted' }]
const init = async () => {
loading.value = true
// 选择指标的时候切换legend内容和data数据
echartsData.value = {}
let list: any = []
legendDictList.value?.selectedList?.map((item: any) => {
searchForm.value.index.map((vv: any) => {
@@ -407,6 +413,7 @@ const setEchart = () => {
formatter(params: any) {
const xname = params[0].value[0]
let str = `${xname}<br>`
params.forEach((el: any, index: any) => {
let marker = ''
@@ -651,6 +658,7 @@ watch(
)
const openDialog = async (row: any, field: any, title: any) => {
titles.value = `${row?.lineName ? `${row.lineName}_` : ''}趋势图`
dialogVisible.value = true
trendRequestData.value = row

View File

@@ -92,14 +92,6 @@ const tableStore: any = new TableStore({
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.flickerOvertime}</span>`
}
},
{
title: '谐波电压越限(%)',
children: loop50('uharm')
},
{
title: '谐波电流越限(%)',
children: loop50('iharm')
},
{
title: '电压偏差越限(%)',
@@ -119,7 +111,16 @@ const tableStore: any = new TableStore({
return `<span style='cursor: pointer;text-decoration: underline;'>${row.ubalanceOvertime}</span>`
}
},
{
title: '谐波电压越限(%)',
children: loop50('uharm')
},
{
title: '谐波电流越限(%)',
children: loop50('iharm')
},
// {
// title: '频率偏差越限(%)',
// field: 'freqDevOvertime',

View File

@@ -5,10 +5,22 @@
ref="TableHeaderRef"
:showReset="false"
@selectChange="selectChange"
v-if="fullscreen"
:timeKeyList="prop.timeKey"
></TableHeader>
>
<template #select>
<el-form-item label="关键字筛选">
<el-input
maxlength="32"
show-word-limit
style="width: 240px"
v-model.trim="tableStore.table.params.searchValue"
clearable
placeholder="请输入敏感负荷名称"
/>
</el-form-item>
</template>
</TableHeader>
<Table
ref="tableRef"
@cell-click="cellClickEvent"
@@ -66,7 +78,7 @@ const fullscreen = computed(() => {
const OverLimitDetailsRef = ref()
const tableStore: any = new TableStore({
url: '/cs-harmonic-boot/pqSensitiveUser/getList',
url: '/cs-harmonic-boot/pqSensitiveUser/getListByUser',
method: 'POST',
showPage: fullscreen.value ? true : false,
column: [
@@ -115,7 +127,7 @@ const tableStore: any = new TableStore({
loadCallback: () => {}
})
tableStore.table.params.searchValue = ''
const tableRef = ref()
provide('tableRef', tableRef)
@@ -137,7 +149,6 @@ const setTime = () => {
// ? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
// : prop.timeValue
// )
// if (Array.isArray(time)) {
// tableStore.table.params.searchBeginTime = time[0]
// tableStore.table.params.searchEndTime = time[1]

View File

@@ -4,8 +4,8 @@
<el-dialog draggable title="暂态事件详情 " v-model="dialogVisible" append-to-body width="70%">
<TableHeader datePicker showExport :showReset="false" ref="tableHeaderRef" @selectChange="selectChange">
<template v-slot:select>
<el-form-item label="监测点">
<el-select v-model="tableStore.table.params.lineId" placeholder="请选择监测点名称">
<el-form-item label="监测点" v-if="props.showLine">
<el-select v-model="tableStore.table.params.lineId" filterable placeholder="请选择监测点名称">
<el-option
v-for="item in options"
:key="item.value"
@@ -14,6 +14,21 @@
/>
</el-select>
</el-form-item>
<el-form-item label="暂态类型">
<el-select
v-model="tableStore.table.params.eventType"
style="min-width: 150px"
clearable
placeholder="请选择暂态类型"
>
<el-option
v-for="item in eventList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" isGroup :height="heightRef"></Table>
@@ -46,6 +61,13 @@ import { mainHeight } from '@/utils/layout'
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue'
import { analyseWave } from '@/api/common'
import { getSimpleLine } from '@/api/harmonic-boot/cockpit/cockpit'
interface Props {
showLine?: boolean
}
const props = withDefaults(defineProps<Props>(), {
showLine: true
})
const dialogVisible: any = ref(false)
const waveFormAnalysisRef: any = ref(null)
@@ -62,7 +84,11 @@ const heightRef = ref(mainHeight(168, 2.1).height)
const selectChange = (flag: boolean, h: any) => {
heightRef.value = mainHeight(h, 2.1).height
}
const eventList = [
{ label: '电压暂降', value: '1' },
{ label: '电压中断', value: '2' },
{ label: '电压暂升', value: '3' }
]
const getSimpleLineList = async () => {
const res = await getSimpleLine()
options.value = res.data
@@ -200,9 +226,10 @@ const tableStore: any = new TableStore({
beforeSearchFun: () => {},
loadCallback: () => {}
})
tableStore.table.params.eventType = ''
provide('tableStore', tableStore)
const open = async (time: any) => {
tableStore.table.params.eventType = ''
dialogVisible.value = true
getSimpleLineList()
tableStore.table.params.lineId = ''

View File

@@ -7,7 +7,7 @@
@selectChange="selectChange"
datePicker
v-if="fullscreen"
:timeKeyList="prop.timeKey"
:timeKeyList="prop.timeKey"
></TableHeader>
<el-calendar
v-model="value"
@@ -58,7 +58,7 @@
</template>
</el-calendar>
<!-- 暂态事件列表 -->
<TransientList ref="transientListRef" />
<TransientList ref="transientListRef" :showLine="false" />
</div>
</template>
<script setup lang="ts">
@@ -74,7 +74,7 @@ const prop = defineProps({
h: { type: [String, Number] },
width: { type: [String, Number] },
height: { type: [String, Number] },
timeKey: { type: Array as () => string[] },
timeKey: { type: Array as () => string[] },
timeValue: { type: Object },
interval: { type: Number }
})

View File

@@ -14,6 +14,21 @@
/>
</el-select>
</el-form-item>
<el-form-item label="暂态类型">
<el-select
v-model="tableStore.table.params.eventType"
style="min-width: 150px"
clearable
placeholder="请选择暂态类型"
>
<el-option
v-for="item in eventList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" isGroup :height="heightRef"></Table>
@@ -62,7 +77,11 @@ const heightRef = ref(mainHeight(168, 2.2).height)
const selectChange = (flag: boolean, h: any) => {
heightRef.value = mainHeight(h, 2.2).height
}
const eventList = [
{ label: '电压暂降', value: '1' },
{ label: '电压中断', value: '2' },
{ label: '电压暂升', value: '3' }
]
const getSimpleLineList = async () => {
const res = await getSimpleLine()
options.value = res.data
@@ -201,9 +220,10 @@ const tableStore: any = new TableStore({
beforeSearchFun: () => {},
loadCallback: () => {}
})
tableStore.table.params.eventType = ''
provide('tableStore', tableStore)
const open = async (row: any, searchBeginTime: any, searchEndTime: any) => {
tableStore.table.params.eventType = ''
dialogVisible.value = true
getSimpleLineList()
tableStore.table.params.lineId = row.id

View File

@@ -748,8 +748,10 @@ const initWave = (
rotation: 0,
y: -10
},
max: rmscm[0]?.[1] * 1.06 || 0,
min: rmscu[0]?.[1] - rmscu[0]?.[1] * 0.2 || 0,
// max: rmscm[0]?.[1] * 1.06 || 0,
// min: rmscu[0]?.[1] - rmscu[0]?.[1] * 0.2 || 0,
max: Math.floor((rmscm[0]?.[1] * 1.06 || 0) * 1.1 * 10) / 10,
min: Math.floor((rmscu[0]?.[1] - rmscu[0]?.[1] * 0.2 || 0) * 10) / 10,
boundaryGap: [0, '100%'],
showLastLabel: true,
opposite: false,
@@ -780,11 +782,11 @@ const initWave = (
}
},
grid: {
left: '1%',
left: '60px',
right: '45px',
bottom: '40px',
top: '60px',
containLabel: true
top: '60px'
// containLabel: true
},
dataZoom: [
{
@@ -1077,6 +1079,8 @@ const drawPics = (
boundaryGap: [0, '100%'],
showLastLabel: true,
opposite: false,
// max: Math.floor((rmscm[0]?.[1] * 1.06 || 0) * 1.1 * 10) / 10,
// min: Math.floor((rmscu[0]?.[1] - rmscu[0]?.[1] * 0.2 || 0) * 10) / 10,
nameTextStyle: {
fontSize: '12px',
color: props.DColor ? '#000' : echartsColor.WordColor
@@ -1105,11 +1109,11 @@ const drawPics = (
}
},
grid: {
left: '1%',
left: '60px',
right: '45px',
bottom: '40px',
top: '60px',
containLabel: true
top: '60px'
// containLabel: true
},
dataZoom: [
{

View File

@@ -481,8 +481,10 @@ const initWave = (
},
boundaryGap: [0, '100%'],
showLastLabel: true,
max: max.toFixed(2) * 1.1,
min: min.toFixed(2) > 0 ? min.toFixed(2) - min.toFixed(2) * 0.1 : min.toFixed(2) * 1.1,
// max: max.toFixed(2) * 1.1,
// min: min.toFixed(2) > 0 ? min.toFixed(2) - min.toFixed(2) * 0.1 : min.toFixed(2) * 1.1,
max: Math.floor(max.toFixed(2) * 1.1 * 10) / 10,
min: Math.floor(min.toFixed(2) > 0 ? min.toFixed(2) - min.toFixed(2) * 0.1 : min.toFixed(2) * 1.1 * 10) / 10 ,
opposite: false,
nameTextStyle: {
fontSize: '12px',
@@ -512,11 +514,11 @@ const initWave = (
}
},
grid: {
left: '1%',
left: '60px',
right: '45px',
bottom: '40px',
top: '60px',
containLabel: true
top: '60px'
// containLabel: true
},
dataZoom: [
{
@@ -789,8 +791,8 @@ const drawPics = (
},
boundaryGap: [0, '100%'],
showLastLabel: true,
max: max.toFixed(2) * 1.1,
min: min.toFixed(2) > 0 ? min.toFixed(2) - min.toFixed(2) * 0.1 : min.toFixed(2) * 1.1,
max: Math.floor(max.toFixed(2) * 1.1 * 10) / 10,
min: Math.floor(min.toFixed(2) > 0 ? min.toFixed(2) - min.toFixed(2) * 0.1 : min.toFixed(2) * 1.1 * 10) / 10 ,
opposite: false,
nameTextStyle: {
fontSize: '12px',
@@ -820,11 +822,11 @@ const drawPics = (
}
},
grid: {
left: '1%',
left: '60px',
right: '45px',
bottom: '40px',
top: '60px',
containLabel: true
top: '60px'
// containLabel: true
},
dataZoom: [
{