修改测试问题

This commit is contained in:
GGJ
2024-10-15 15:31:36 +08:00
parent a05cc2deab
commit 223e698c9b
9 changed files with 1720 additions and 1812 deletions

View File

@@ -424,7 +424,15 @@ const init = (flag: boolean) => {
fontSize: 14
},
backgroundColor: 'rgba(0,0,0,0.35)',
borderWidth: 0
borderWidth: 0,
formatter(params) {
const xname = params[0].value[0];
let str = `${xname}<br>`;
params.forEach((el, index) => {
str += `${el.marker}${el.seriesName.split('(')[0]}${el.value[1]}${el.value[2]}<br>`;
});
return str;
},
},
color: ['#FFCC00', '#009900', '#CC0000', ...color],
xAxis: {
@@ -448,66 +456,68 @@ const init = (flag: boolean) => {
}
}
if (chartsList.length > 0) {
echartsData.value.yAxis=[]
unitList.forEach((item: any, index: any) => {
let right = {
position: 'right',
offset: (index - 1) * 80,
}
echartsData.value.yAxis.push({
name: item,
yAxisIndex: index,
splitLine: {
show: false,
},
...(index > 0 ? right : null)
})
})
result.forEach((item: any, index: any) => {
let yMethodList: any = []
let ABCList = Object.values(item.reduce((acc, item) => {
let key = item.phase;
if (!acc[key]) {
acc[key] = [];
echartsData.value.yAxis = []
unitList.forEach((item: any, index: any) => {
let right = {
position: 'right',
offset: (index - 1) * 80,
}
acc[key].push(item);
return acc;
}, {}));
ABCList.forEach((kk: any,) => {
let seriesList: any = []
kk.forEach((cc: any) => {
if (cc.statisticalData) {
yMethodList.push(cc.statisticalData?.toFixed(2) - 0)
echartsData.value.yAxis.push({
name: item,
yAxisIndex: index,
splitNumber: 5,
minInterval: 1,
splitLine: {
show: false,
},
...(index > 0 ? right : null)
})
})
result.forEach((item: any, index: any) => {
let yMethodList: any = []
let ABCList = Object.values(item.reduce((acc, item) => {
let key = item.phase;
if (!acc[key]) {
acc[key] = [];
}
acc[key].push(item);
return acc;
}, {}));
ABCList.forEach((kk: any,) => {
let seriesList: any = []
kk.forEach((cc: any) => {
if (cc.statisticalData) {
yMethodList.push(cc.statisticalData?.toFixed(2) - 0)
seriesList.push([cc.time, cc.statisticalData?.toFixed(2)])
})
}
seriesList.push([cc.time, cc.statisticalData?.toFixed(2),cc.unit])
})
echartsData.value.options.series.push({
name: kk[0].phase + '相' + item[0].anotherName,
type: 'line',
smooth: true,
symbol: 'none',
data: seriesList,
yAxisIndex: index
echartsData.value.options.series.push({
name: kk[0].phase + '相' + item[0].anotherName,
type: 'line',
smooth: true,
symbol: 'none',
data: seriesList,
yAxisIndex: index
})
})
let [min, max] = yMethod(yMethodList)
echartsData.value.yAxis[index].min = min
echartsData.value.yAxis[index].max = max
})
let [min, max] = yMethod(yMethodList)
echartsData.value.yAxis[index].min = min
echartsData.value.yAxis[index].max = max
})
}
}
// console.log("🚀 ~ .1111 ~ echartsData.value :", echartsData.value)