修改测试bug
This commit is contained in:
@@ -93,7 +93,8 @@ import { useConfig } from '@/stores/config'
|
||||
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
import { getListByIds } from '@/api/harmonic-boot/cockpit/cockpit'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
import { yMethod, exportCSV } from '@/utils/echartMethod'
|
||||
import { max } from 'lodash'
|
||||
const prop = defineProps({
|
||||
w: { type: [String, Number] },
|
||||
h: { type: [String, Number] },
|
||||
@@ -262,6 +263,11 @@ const setEchart = () => {
|
||||
titleText = afterData[0].anotherName
|
||||
}
|
||||
|
||||
// statisticalData
|
||||
// chartsListBefore.value.map((item: any) => item.statisticalData)
|
||||
// chartsListAfter.value = tableStore.table.data.after
|
||||
|
||||
|
||||
// 构建图例数据
|
||||
const legendData = series.map((item: any, index: number) => {
|
||||
let color = config.layout.elementUiPrimary[0]
|
||||
@@ -291,7 +297,10 @@ const setEchart = () => {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
let [min, max] = yMethod(
|
||||
[...chartsListBefore.value.map((item: any) => item.statisticalData),
|
||||
...chartsListAfter.value.map((item: any) => item.statisticalData)]
|
||||
)
|
||||
echartList.value = {
|
||||
title: {
|
||||
text: titleText
|
||||
@@ -316,12 +325,13 @@ const setEchart = () => {
|
||||
const xname = params[0].value[0]
|
||||
let str = `${xname}<br>`
|
||||
params.forEach((el: any, index: any) => {
|
||||
console.log('🚀 ~ setEchart ~ el:', el)
|
||||
let marker = ''
|
||||
|
||||
marker = `<span style="display:inline-block;border: 2px ${el.color} ${el.value[3]};margin-right:5px;width:40px;height:0px;background-color:#ffffff00;"></span>`
|
||||
|
||||
str += `${marker}${el.seriesName.split('(')[0]}:${
|
||||
el.value[1] != null ? el.value[1] + ' ' + (el.value[2] == 'null' ? '' : el.value[2]) : '-'
|
||||
el.value[1] != null ? el.value[1] + ' ' + (el.value[2] == null ? '' : el.value[2]) : '-'
|
||||
}<br>`
|
||||
})
|
||||
return str
|
||||
@@ -350,7 +360,9 @@ const setEchart = () => {
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
name: beforeData.length > 0 ? beforeData[0].unit : afterData.length > 0 ? afterData[0].unit : ''
|
||||
name: beforeData.length > 0 ? beforeData[0].unit : afterData.length > 0 ? afterData[0].unit : '',
|
||||
max: max,
|
||||
min: min,
|
||||
},
|
||||
grid: {
|
||||
left: '10px',
|
||||
@@ -439,7 +451,7 @@ const shouldShowHarmonicCount = () => {
|
||||
|
||||
return (
|
||||
currentIndicator &&
|
||||
(currentIndicator.name.includes('电压谐波含有率') || currentIndicator.name.includes('电流谐波含有率'))
|
||||
(currentIndicator.name.includes('幅值') || currentIndicator.name.includes('含有率'))
|
||||
)
|
||||
}
|
||||
|
||||
@@ -448,9 +460,9 @@ const getHarmonicTypeName = () => {
|
||||
const currentIndicator = indicatorList.value.find((item: any) => item.id === tableStore.table.params.indicator)
|
||||
|
||||
if (currentIndicator) {
|
||||
if (currentIndicator.name.includes('电压谐波含有率')) {
|
||||
if (currentIndicator.name.includes('电压')) {
|
||||
return '电压'
|
||||
} else if (currentIndicator.name.includes('电流谐波含有率')) {
|
||||
} else if (currentIndicator.name.includes('电流')) {
|
||||
return '电流'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user