修改事件展示查询问题

This commit is contained in:
GGJ
2024-10-10 09:56:34 +08:00
parent bef7796668
commit 3958928ebb
10 changed files with 203 additions and 192 deletions

View File

@@ -36,6 +36,7 @@ import { queryStatistical } from '@/api/system-boot/csstatisticalset'
import MyEchart from '@/components/echarts/MyEchart.vue'
import { getDeviceHarmonicSpectrumData, getRealTimeTableList } from '@/api/cs-device-boot/EquipmentDelivery.ts'
import { mainHeight } from '@/utils/layout'
import { yMethod } from '@/utils/echartMethod'
const searchForm: any = ref({})
searchForm.value = {
index: []
@@ -75,7 +76,7 @@ const init = () => {
})
//查询谐波频谱
getDeviceHarmonicSpectrumData(params.value).then(res => {
res.data.length > 3 ? height = mainHeight(275, 3 ).height : height = mainHeight(275, res.data.length ).height
res.data.length > 3 ? height = mainHeight(275, 3).height : height = mainHeight(275, res.data.length).height
chartsList.value = res.data
//数据根据相别组装成新数组
chartsList.value.map((item: any) => {
@@ -154,27 +155,29 @@ const init = () => {
},
boundaryGap: false
},
yAxis: [
{
type: 'value',
name:
item.thdDataVOS.length != 0 &&
item.thdDataVOS[0].list &&
item.thdDataVOS[0].list[0].unit,
splitLine: {
show: false
},
axisTick: {
show: true
},
axisLine: {
show: true,
lineStyle: {
color: '#000'
}
yAxis:
{
type: 'value',
name:
item.thdDataVOS.length != 0 &&
item.thdDataVOS[0].list &&
item.thdDataVOS[0].list[0].unit,
splitLine: {
show: false
},
axisTick: {
show: true
},
axisLine: {
show: true,
lineStyle: {
color: '#000'
}
}
],
},
splitNumber: 5,
minInterval: 1,
}
,
series: []
}
}
@@ -185,7 +188,7 @@ const init = () => {
item.thdDataVOS[0].list.map((ss: any) => {
return ss.frequency + '次'
})
let aar: any = []
//y轴数据
item.thdDataVOS.map((vv: any) => {
item.echartsData.options.series.push({
@@ -199,6 +202,7 @@ const init = () => {
// }e
},
data: vv.list.map((vvs: any) => {
aar.push(vvs.statisticalData)
return vvs.statisticalData
}),
smooth: true, // 这里设置平滑曲线
@@ -207,6 +211,10 @@ const init = () => {
//legend数据
item.echartsData.options.legend.data.push(vv.phase + '相')
})
let [min, max] = yMethod(aar)
item.echartsData.options.yAxis.max = max
item.echartsData.options.yAxis.min = min
})
loading.value = false
})