From 6c5250f9c22849f1fcfce10e0ee7beea3be533d4 Mon Sep 17 00:00:00 2001 From: SikongJueluo Date: Tue, 22 Jul 2025 02:41:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A4=BA=E6=B3=A2?= =?UTF-8?q?=E5=99=A8=E5=81=9C=E6=AD=A2=E6=8D=95=E8=8E=B7=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=85=8D=E7=BD=AE=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E5=8F=96=E6=B6=88=E7=A4=BA=E6=B3=A2=E5=99=A8?= =?UTF-8?q?=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Oscilloscope/OscilloscopeManager.ts | 5 ----- .../Oscilloscope/OscilloscopeWaveformDisplay.vue | 14 ++++++++++++-- src/views/Project/Oscilloscope.vue | 6 +++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/components/Oscilloscope/OscilloscopeManager.ts b/src/components/Oscilloscope/OscilloscopeManager.ts index 5b3cee3..a200527 100644 --- a/src/components/Oscilloscope/OscilloscopeManager.ts +++ b/src/components/Oscilloscope/OscilloscopeManager.ts @@ -262,16 +262,11 @@ const [useProvideOscilloscope, useOscilloscopeState] = createInjectionState(() = alert.success("测试数据生成成功", 2000); }; - const isOperationInProgress = computed( - () => isApplying.value || isCapturing.value || operationMutex.isLocked() - ); - return { oscData, config, isApplying, isCapturing, - isOperationInProgress, sampleCount, samplePeriodNs, refreshIntervalMs, diff --git a/src/components/Oscilloscope/OscilloscopeWaveformDisplay.vue b/src/components/Oscilloscope/OscilloscopeWaveformDisplay.vue index 4c4b801..c689aec 100644 --- a/src/components/Oscilloscope/OscilloscopeWaveformDisplay.vue +++ b/src/components/Oscilloscope/OscilloscopeWaveformDisplay.vue @@ -104,9 +104,11 @@ const option = computed((): EChartsOption => { return {}; } + const isCapturing = oscManager.isCapturing.value; + const series: LineSeriesOption[] = []; - // 兼容单通道和多通道,确保 yChannels 为 number[][] + // 兼容单通道和多通道,确保 yChannels 为 number[] const yChannels: number[][] = Array.isArray(oscData.value.y[0]) ? (oscData.value.y as number[][]) : [oscData.value.y as number[]]; @@ -126,6 +128,10 @@ const option = computed((): EChartsOption => { lineStyle: { width: 2, }, + // 关闭系列动画 + animation: !isCapturing, + animationDuration: isCapturing ? 0 : 1000, + animationEasing: isCapturing ? "linear" : "cubicOut", }); }); @@ -157,7 +163,7 @@ const option = computed((): EChartsOption => { saveAsImage: {}, }, }, - dataZoom: (oscManager.isCapturing.value) ? [] : [ + dataZoom: [ { type: "inside", start: 0, @@ -198,6 +204,10 @@ const option = computed((): EChartsOption => { show: false, }, }, + // 全局动画开关 + animation: !isCapturing, + animationDuration: isCapturing ? 0 : 1000, + animationEasing: isCapturing ? "linear" : "cubicOut", series: series, }; }); diff --git a/src/views/Project/Oscilloscope.vue b/src/views/Project/Oscilloscope.vue index fc9b869..ac1561e 100644 --- a/src/views/Project/Oscilloscope.vue +++ b/src/views/Project/Oscilloscope.vue @@ -77,14 +77,14 @@
- -