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 @@