From f7849e3493f98dae28d4ca277d418574eb6db15c Mon Sep 17 00:00:00 2001 From: ChenX Date: Thu, 13 Jul 2023 15:11:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:=E6=A8=A1=E5=9D=97=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E8=A1=A8=E8=BE=BE=E5=BC=8F=E6=B1=82=E5=80=BC=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=90=8E,=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DatabaseServices/Template/Param/TemplateParam.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/DatabaseServices/Template/Param/TemplateParam.ts b/src/DatabaseServices/Template/Param/TemplateParam.ts index b757ce7ea..f29e6a153 100644 --- a/src/DatabaseServices/Template/Param/TemplateParam.ts +++ b/src/DatabaseServices/Template/Param/TemplateParam.ts @@ -1,3 +1,5 @@ +import { InteractionLog, LogType } from "../../../Common/Log"; +import { Intent, Toaster } from "../../../Common/Toaster"; import { eval2 } from "../../../Common/eval"; import { equaln } from "../../../Geometry/GeUtils"; import { AutoRecord, ISPROXYKEY } from "../../AutoRecord"; @@ -174,7 +176,13 @@ export class TemplateParam } catch (error) { - console.log("更新失败:", error); + Toaster({ + message: "有模块的参数表达式求值失败!请查看左下角信息!", + intent: Intent.DANGER, + timeout: 5000, + key: "template_expr_error", + }); + InteractionLog([{ msg: `模块变量:${this.name}的表达式:${this.expr},求值失败!` + error }], LogType.Error); return this.value as number; } }