From 60e4a36a165fbe064763ba8cb88dbe0d7aa0a0a0 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Wed, 11 Jun 2025 19:03:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A5=E8=89=BA=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/craft/AddCraft/index.vue | 17 +++++++- src/components/home/CheckCraft/index.vue | 6 +++ src/components/home/Tube/index.vue | 30 +++++++++++-- src/stores/systemStore.ts | 75 ++++++++++++++++---------------- src/types/system.d.ts | 1 + src/views/home/index.vue | 3 ++ 6 files changed, 91 insertions(+), 41 deletions(-) diff --git a/src/components/craft/AddCraft/index.vue b/src/components/craft/AddCraft/index.vue index 57e0f87..446e899 100644 --- a/src/components/craft/AddCraft/index.vue +++ b/src/components/craft/AddCraft/index.vue @@ -52,11 +52,21 @@ const okHandle = async () => { return } // 找到第一个参数不完整的步骤 + const errorMsg: string[] = [] const invalidStepIndex = form.value.stepList.findIndex((step: any, index) => { if (['heat', 'dry', 'anneal'].includes(step.method)) { if (step.params.minutes || step.params.seconds) { step.params.time = (step.params.minutes || 0) * 60 + (step.params.seconds || 0) || undefined } + if (step.params.temperature > 400 && step.method === 'anneal') { + errorMsg.push(`步骤${index + 1}: 退火温度不能超过400度`) + } + if (step.params.temperature > 200 && step.method === 'heat') { + errorMsg.push(`步骤${index + 1}: 加热温度不能超过400度`) + } + if (step.params.temperature > 200 && step.method === 'dry') { + errorMsg.push(`步骤${index + 1}: 烘干温度不能超过400度`) + } } step.params.description = `${index + 1}.` switch (step.method) { @@ -93,6 +103,10 @@ const okHandle = async () => { FtMessage.error(`步骤${invalidStepIndex + 1}: 请填写完整参数`) return } + if (errorMsg.length) { + FtMessage.error(errorMsg.join('; ')) + return + } form.value.steps = JSON.stringify(form.value.stepList) form.value.oresId = oresId @@ -232,7 +246,7 @@ const addStep = (data: any) => {