refactor(Linkage): optimize the parsing of expression variables (#3519)
This commit is contained in:
parent
c02e759830
commit
a18103baa0
@ -91,14 +91,13 @@ export const collectFieldStateOfLinkageRules = ({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. 解析如 `{{$user.name}}` 之类的变量
|
// 解析如 `{{$user.name}}` 之类的变量
|
||||||
const { exp, scope: expScope } = await replaceVariables(value.value || value.result, {
|
const { exp, scope: expScope } = await replaceVariables(value.value || value.result, {
|
||||||
variables,
|
variables,
|
||||||
localVariables,
|
localVariables,
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 2. TODO: 需要把里面解析变量的逻辑删除,因为在上一步已经解析过了
|
|
||||||
const result = evaluate(exp, { now: () => new Date().toString(), ...expScope });
|
const result = evaluate(exp, { now: () => new Date().toString(), ...expScope });
|
||||||
return result;
|
return result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user