指标越限程度联调

This commit is contained in:
stt
2025-11-14 09:34:39 +08:00
parent d9efb37083
commit c1ebcfed6f
6 changed files with 196 additions and 104 deletions

View File

@@ -66,34 +66,6 @@ const fullscreen = computed(() => {
const echartList = ref()
// const echartList = ref({
// title: {
// text: '指标越限严重度'
// },
// xAxis: {
// data: ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
// },
// yAxis: {
// name: '%', // 给X轴加单位
// interval: 20
// },
// grid: {
// left: '10px',
// right: '20px'
// },
// options: {
// series: [
// {
// type: 'bar',
// name: '越限占比',
// data: [0, 7.5, 36, 0, 80],
// barMaxWidth: 30
// }
// ]
// }
// })
const dailyTrendChartRef = ref()
const tableStore: any = new TableStore({
url: '/harmonic-boot/limitRateDetailD/limitExtentData',
@@ -122,7 +94,7 @@ const tableStore: any = new TableStore({
minWidth: '60',
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.type}</span>`
return `<span style='cursor: pointer;text-decoration: underline;'>${row.maxValue}</span>`
}
},
{
@@ -138,12 +110,32 @@ const tableStore: any = new TableStore({
{
title: '发生日期',
field: 'time',
minWidth: '100'
minWidth: '60',
render: 'customTemplate',
customTemplate: (row: any) => {
if (
row.time !== null &&
row.time !== undefined &&
row.time !== ''
) {
return `<span>${row.time}</span>`
} else {
return `<span>/</span>`
}
}
},
{
title: '越限最高监测点',
field: 'lineName',
minWidth: '90'
minWidth: '90',
render: 'customTemplate',
customTemplate: (row: any) => {
if (row.lineName !== null && row.lineName !== undefined && row.lineName !== '') {
return `<span>${row.lineName}</span>`
} else {
return `<span>/</span>`
}
}
}
],
beforeSearchFun: () => {
@@ -166,12 +158,12 @@ const tableStore: any = new TableStore({
// 定义 x 轴标签顺序
const xAxisLabels = ['闪变', '谐波电压', '谐波电流', '电压偏差', '三相不平衡']
// 根据指标名称顺序提取对应的 maxValue 数据
// 根据指标名称顺序提取对应的 extent 数据
const chartData = xAxisLabels.map(label => {
// 在表格数据中查找对应指标名称的数据项
const item = tableStore.table.data.find((row: any) => row.name === label)
// 如果找到对应项,则返回 maxValue 值,否则返回 0
return item ? parseFloat(item.maxValue) || 0 : 0
// 如果找到对应项,则返回 extent 值,否则返回 0
return item ? item.extent || 0 : 0
})
echartList.value = {
title: {
@@ -183,8 +175,8 @@ const tableStore: any = new TableStore({
},
yAxis: {
name: '%', // 给X轴加单位
interval: 20
name: '%' // 给X轴加单位
// interval: 20
},
grid: {
left: '10px',
@@ -211,8 +203,7 @@ provide('tableStore', tableStore)
// 点击行
const cellClickEvent = ({ row, column }: any) => {
if (column.field != 'name') {
console.log(row)
if (column.field == 'maxValue' && row.lineId) {
dailyTrendChartRef.value.open(row)
}
}