From 00f7dc1686235466eadf1c6c1c9516be007c5e58 Mon Sep 17 00:00:00 2001 From: zhangshun <453905631@qq.com> Date: Mon, 1 Jun 2026 13:07:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A8=A1=E5=9E=8B=E5=BA=93?= =?UTF-8?q?=E6=97=A0=E5=B7=A5=E8=89=BA=E6=95=B0=E6=8D=AE=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/app/modules/preview.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/src/pages/app/modules/preview.ts b/web/src/pages/app/modules/preview.ts index 3ce20f5..411403e 100644 --- a/web/src/pages/app/modules/preview.ts +++ b/web/src/pages/app/modules/preview.ts @@ -629,6 +629,10 @@ function bindProcessPlaceholder(operations: PreviewOperation[]) { }); document.querySelector("#previewPlayBtn")?.addEventListener("click", () => { + if (operations.length === 0) { + notify("当前模型暂无工艺数据"); + return; + } const operation = getSelectedOperation(operations); updateStatus(operation); if (!operation) { @@ -639,7 +643,7 @@ function bindProcessPlaceholder(operations: PreviewOperation[]) { notifyError(`工艺播放数据解析失败:${operation.parseError}`); return; } - if (!operation.parsedCraftPlayData) { + if (!operation.parsedCraftPlayData || operation.parsedCraftPlayData.OPERATION.frames.length === 0) { notify("当前工艺暂无播放数据"); return; } @@ -653,10 +657,14 @@ function bindProcessPlaceholder(operations: PreviewOperation[]) { } function startPreviewPlayback(operation: PreviewOperation) { - if (!runtime?.context.modelObject || !operation.parsedCraftPlayData) { + if (!runtime?.context.modelObject) { notify("模型还未加载完成"); return; } + if (!operation.parsedCraftPlayData || operation.parsedCraftPlayData.OPERATION.frames.length === 0) { + notify("当前工艺暂无播放数据"); + return; + } if (previewPlayback.isPlaying && previewPlayback.operation === operation) { return;