From a18103baa00f846afc0f6437b9df3ad4f0298400 Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Mon, 19 Feb 2024 18:08:14 +0800 Subject: [PATCH] refactor(Linkage): optimize the parsing of expression variables (#3519) --- .../core/client/src/schema-component/antd/form-v2/utils.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/form-v2/utils.tsx b/packages/core/client/src/schema-component/antd/form-v2/utils.tsx index 33ed629bfd..e87c455085 100644 --- a/packages/core/client/src/schema-component/antd/form-v2/utils.tsx +++ b/packages/core/client/src/schema-component/antd/form-v2/utils.tsx @@ -91,14 +91,13 @@ export const collectFieldStateOfLinkageRules = ({ return; } - // 1. 解析如 `{{$user.name}}` 之类的变量 + // 解析如 `{{$user.name}}` 之类的变量 const { exp, scope: expScope } = await replaceVariables(value.value || value.result, { variables, localVariables, }); try { - // 2. TODO: 需要把里面解析变量的逻辑删除,因为在上一步已经解析过了 const result = evaluate(exp, { now: () => new Date().toString(), ...expScope }); return result; } catch (error) {