This commit is contained in:
katherinehhh 2025-02-19 15:05:56 +08:00
parent 6c7a20aa2e
commit b5ba47f5b4

View File

@ -67,7 +67,6 @@ const VariablesProvider = ({ children, filterVariables }: any) => {
ctxRef.current = ctx; ctxRef.current = ctx;
} }
}, []); }, []);
/** /**
* 1. Get value from `ctx` based on `path` * 1. Get value from `ctx` based on `path`
* 2. If a `key` does not exist and is an association field, fetch data from api and cache it in `ctx` * 2. If a `key` does not exist and is an association field, fetch data from api and cache it in `ctx`
@ -91,7 +90,7 @@ const VariablesProvider = ({ children, filterVariables }: any) => {
const list = variablePath.split('.'); const list = variablePath.split('.');
const variableName = list[0]; const variableName = list[0];
const _variableToCollectionName = mergeVariableToCollectionNameWithLocalVariables(variablesStore, localVariables); const _variableToCollectionName = mergeVariableToCollectionNameWithLocalVariables(variablesStore, localVariables);
let current = mergeCtxWithLocalVariables(ctxRef.current, localVariables); let current = mergeCtxWithLocalVariables(ctxRef.current, localVariables.concat(builtinVariables));
const { fieldPath, dataSource, variableOption } = getFieldPath(variableName, _variableToCollectionName); const { fieldPath, dataSource, variableOption } = getFieldPath(variableName, _variableToCollectionName);
let collectionName = fieldPath; let collectionName = fieldPath;