fix: 修复示波器停止捕获导致无法配置的问题,并取消示波器动画
This commit is contained in:
@@ -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,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user