|
|
|
|
@ -167,65 +167,91 @@ async function getChart() {
|
|
|
|
|
|
|
|
|
|
const currentOption: EChartsOption = {
|
|
|
|
|
title: { text: `${selectMonitorName.value} 电流曲线`, left: 'center' },
|
|
|
|
|
grid: { top: '15%', bottom: '10%', left: '3%', right: '3%' },
|
|
|
|
|
grid: { top: 50, bottom: 70, left: 60, right: 40, containLabel: true },
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis',
|
|
|
|
|
axisPointer: { type: 'shadow', label: { show: true } }
|
|
|
|
|
axisPointer: { type: 'cross', label: { show: true } }
|
|
|
|
|
},
|
|
|
|
|
dataZoom: [{ type: 'slider', start: 0, end: 100 }],
|
|
|
|
|
legend: { right: 0 },
|
|
|
|
|
dataZoom: [
|
|
|
|
|
{ type: 'slider', height: 20, bottom: 8, start: 0, end: 100 },
|
|
|
|
|
{ type: 'inside', zoomOnMouseWheel: true, moveOnMouseMove: true }
|
|
|
|
|
],
|
|
|
|
|
legend: { right: 0, top: 5 },
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: collectTimes,
|
|
|
|
|
axisLine: { lineStyle: { color: '#000' } },
|
|
|
|
|
axisTick: { show: true },
|
|
|
|
|
axisLabel: { color: '#000' }
|
|
|
|
|
axisTick: { show: true, alignWithLabel: true },
|
|
|
|
|
axisLabel: {
|
|
|
|
|
color: '#000',
|
|
|
|
|
rotate: collectTimes.length > 20 ? 45 : 0,
|
|
|
|
|
interval: 'auto',
|
|
|
|
|
formatter: (value: string) => value && value.length > 16 ? value.substring(11, 19) : value
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: [{
|
|
|
|
|
type: 'value',
|
|
|
|
|
name: '电流(A)',
|
|
|
|
|
nameTextStyle: { color: '#000' },
|
|
|
|
|
splitLine: { show: false },
|
|
|
|
|
splitLine: { show: true, lineStyle: { type: 'dashed', color: '#e0e0e0' } },
|
|
|
|
|
axisTick: { show: true },
|
|
|
|
|
axisLine: { lineStyle: { color: '#000' } },
|
|
|
|
|
axisLabel: { color: '#000' }
|
|
|
|
|
axisLabel: {
|
|
|
|
|
color: '#000',
|
|
|
|
|
formatter: (value: number) => Math.abs(value) >= 1000 ? (value / 1000).toFixed(1) + 'k' : value.toFixed(1)
|
|
|
|
|
},
|
|
|
|
|
scale: true,
|
|
|
|
|
splitNumber: 5
|
|
|
|
|
}],
|
|
|
|
|
series: [
|
|
|
|
|
{ name: 'A相电流', type: 'line', smooth: true, symbol: 'circle', symbolSize: 10, data: data.map((item: any) => item.ia) },
|
|
|
|
|
{ name: 'B相电流', type: 'line', smooth: true, symbol: 'circle', symbolSize: 10, data: data.map((item: any) => item.ib) },
|
|
|
|
|
{ name: 'C相电流', type: 'line', smooth: true, symbol: 'circle', symbolSize: 10, data: data.map((item: any) => item.ic) }
|
|
|
|
|
{ name: 'A相电流', type: 'line', smooth: true, symbol: 'circle', symbolSize: 6, data: data.map((item: any) => item.ia) },
|
|
|
|
|
{ name: 'B相电流', type: 'line', smooth: true, symbol: 'circle', symbolSize: 6, data: data.map((item: any) => item.ib) },
|
|
|
|
|
{ name: 'C相电流', type: 'line', smooth: true, symbol: 'circle', symbolSize: 6, data: data.map((item: any) => item.ic) }
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const voltageOption: EChartsOption = {
|
|
|
|
|
title: { text: `${selectMonitorName.value} 电压曲线`, left: 'center' },
|
|
|
|
|
grid: { top: '15%', bottom: '10%', left: '3%', right: '3%' },
|
|
|
|
|
grid: { top: 50, bottom: 70, left: 60, right: 40, containLabel: true },
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis',
|
|
|
|
|
axisPointer: { type: 'shadow', label: { show: true } }
|
|
|
|
|
axisPointer: { type: 'cross', label: { show: true } }
|
|
|
|
|
},
|
|
|
|
|
dataZoom: [{ type: 'slider', start: 0, end: 100 }],
|
|
|
|
|
legend: { right: 0 },
|
|
|
|
|
dataZoom: [
|
|
|
|
|
{ type: 'slider', height: 20, bottom: 8, start: 0, end: 100 },
|
|
|
|
|
{ type: 'inside', zoomOnMouseWheel: true, moveOnMouseMove: true }
|
|
|
|
|
],
|
|
|
|
|
legend: { right: 0, top: 5 },
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: collectTimes,
|
|
|
|
|
axisLine: { lineStyle: { color: '#000' } },
|
|
|
|
|
axisTick: { show: true },
|
|
|
|
|
axisLabel: { color: '#000' }
|
|
|
|
|
axisTick: { show: true, alignWithLabel: true },
|
|
|
|
|
axisLabel: {
|
|
|
|
|
color: '#000',
|
|
|
|
|
rotate: collectTimes.length > 20 ? 45 : 0,
|
|
|
|
|
interval: 'auto',
|
|
|
|
|
formatter: (value: string) => value && value.length > 16 ? value.substring(11, 19) : value
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
yAxis: [{
|
|
|
|
|
type: 'value',
|
|
|
|
|
name: '电压(V)',
|
|
|
|
|
nameTextStyle: { color: '#000' },
|
|
|
|
|
splitLine: { show: false },
|
|
|
|
|
splitLine: { show: true, lineStyle: { type: 'dashed', color: '#e0e0e0' } },
|
|
|
|
|
axisTick: { show: true },
|
|
|
|
|
axisLine: { lineStyle: { color: '#000' } },
|
|
|
|
|
axisLabel: { color: '#000' }
|
|
|
|
|
axisLabel: {
|
|
|
|
|
color: '#000',
|
|
|
|
|
formatter: (value: number) => Math.abs(value) >= 1000 ? (value / 1000).toFixed(1) + 'k' : value.toFixed(1)
|
|
|
|
|
},
|
|
|
|
|
scale: true,
|
|
|
|
|
splitNumber: 5
|
|
|
|
|
}],
|
|
|
|
|
series: [
|
|
|
|
|
{ name: 'A相电压', type: 'line', smooth: true, symbol: 'circle', symbolSize: 10, data: data.map((item: any) => item.va) },
|
|
|
|
|
{ name: 'B相电压', type: 'line', smooth: true, symbol: 'circle', symbolSize: 10, data: data.map((item: any) => item.vb) },
|
|
|
|
|
{ name: 'C相电压', type: 'line', smooth: true, symbol: 'circle', symbolSize: 10, data: data.map((item: any) => item.vc) }
|
|
|
|
|
{ name: 'A相电压', type: 'line', smooth: true, symbol: 'circle', symbolSize: 6, data: data.map((item: any) => item.va) },
|
|
|
|
|
{ name: 'B相电压', type: 'line', smooth: true, symbol: 'circle', symbolSize: 6, data: data.map((item: any) => item.vb) },
|
|
|
|
|
{ name: 'C相电压', type: 'line', smooth: true, symbol: 'circle', symbolSize: 6, data: data.map((item: any) => item.vc) }
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -270,14 +296,28 @@ onMounted(() => {
|
|
|
|
|
getList();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
.chart1 {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 40vh;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.chart1,
|
|
|
|
|
.chart2 {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 40vh;
|
|
|
|
|
height: calc(50vh - 80px);
|
|
|
|
|
min-height: 280px;
|
|
|
|
|
max-height: 400px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media screen and (max-width: 1200px) {
|
|
|
|
|
.chart1,
|
|
|
|
|
.chart2 {
|
|
|
|
|
height: calc(45vh - 60px);
|
|
|
|
|
min-height: 250px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media screen and (max-width: 768px) {
|
|
|
|
|
.chart1,
|
|
|
|
|
.chart2 {
|
|
|
|
|
height: 40vh;
|
|
|
|
|
min-height: 220px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|