谐波频谱添加奇次、偶次区分

历史趋势添加线区分指标
This commit is contained in:
GGJ
2024-11-20 10:05:29 +08:00
parent 64fb9141fd
commit 876c29bdaf
3 changed files with 115 additions and 16 deletions

View File

@@ -354,6 +354,9 @@ const refreshTree = () => {
const range = (start: any, end: any, step: any) => {
return Array.from({ length: (end - start) / step + 1 }, (_, i) => start + i * step)
}
const colors = ['#FFCC00', '#009900', '#CC0000']
const lineStyle = [{ type: 'solid', }, { type: 'dashed', }, { type: 'dotted', }]
const titleList: any = ref('')
const init = (flag: boolean) => {
titleList.value = ''
@@ -531,13 +534,14 @@ const init = (flag: boolean) => {
const xname = params[0].value[0]
let str = `${xname}<br>`
params.forEach((el: any, index: any) => {
str += `${el.marker}${el.seriesName.split('(')[0]}${el.value[1] ? el.value[1] + ' ' + el.value[2] : '-'
str += `${el.marker}${el.seriesName.split('(')[0]}${el.value[1] ? el.value[1] + ' ' + (el.value[2] || '') : '-'
}<br>`
})
return str
}
},
color: ['#FFCC00', '#009900', '#CC0000', ...color],
// color: ['#FFCC00', '#009900', '#CC0000', ...color],
xAxis: {
type: 'time',
axisLabel: {
@@ -577,7 +581,13 @@ const init = (flag: boolean) => {
...(index > 0 ? right : null)
})
})
console.log("🚀 ~ result.forEach ~ result:", result)
let ABCName = [...new Set(chartsList.map((item: any) => { return item.anotherName == '电压负序分量' ? '电压不平衡' : item.anotherName == '电压正序分量' ? '电压不平衡' : item.anotherName == '电压零序分量' ? '电压不平衡' : item.anotherName }))];
result.forEach((item: any, index: any) => {
let yMethodList: any = []
@@ -587,9 +597,10 @@ const init = (flag: boolean) => {
if (item.phase == null) {
key = item.anotherName
} else {
key = item.phase
}
if (!acc[key]) {
acc[key] = []
}
@@ -597,13 +608,23 @@ const init = (flag: boolean) => {
return acc
}, {})
)
ABCList.forEach((kk: any) => {
let colorName = kk[0].phase?.charAt(0).toUpperCase()
let lineS = ABCName.findIndex(item => item === (kk[0].anotherName == '电压负序分量' ? '电压不平衡' : kk[0].anotherName == '电压正序分量' ? '电压不平衡' : kk[0].anotherName == '电压零序分量' ? '电压不平衡' : kk[0].anotherName));
let seriesList: any = []
kk.forEach((cc: any) => {
if (cc.statisticalData !== null) {
yMethodList.push(cc.statisticalData?.toFixed(2) - 0)
}
seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit])
})
echartsData.value.options.series.push({
@@ -611,12 +632,15 @@ const init = (flag: boolean) => {
? kk[0].phase + '相' + kk[0].anotherName
: kk[0].anotherName,
type: 'line',
color: colorName == 'A' ? '#FFCC00' : colorName == 'B' ? '#009900' : colorName == 'C' ? '#CC0000' : '',
smooth: true,
symbol: 'none',
lineStyle: lineStyle[lineS],
data: seriesList,
yAxisIndex: index
})
})
let [min, max] = yMethod(yMethodList)
echartsData.value.yAxis[index].min = min
echartsData.value.yAxis[index].max = max