fix: useVariablesCtx (#2390)

This commit is contained in:
katherinehhh 2023-08-04 11:29:42 +08:00 committed by GitHub
parent c7a30c314c
commit e3b0f13923
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,8 +28,8 @@ export const useVariablesCtx = (): VariablesCtx => {
const currentUser = useCurrentUserContext(); const currentUser = useCurrentUserContext();
const { field, service, rowKey } = useTableBlockContext(); const { field, service, rowKey } = useTableBlockContext();
const tableData = flattenDeep(service?.data?.data); const tableData = flattenDeep(service?.data?.data);
const contextData = tableData?.filter((v) => (field?.data?.selectedRowKeys || [])?.includes(v[rowKey]));
return useMemo(() => { return useMemo(() => {
const contextData = tableData?.filter((v) => (field?.data?.selectedRowKeys || [])?.includes(v[rowKey]));
return { return {
$user: currentUser?.data?.data || {}, $user: currentUser?.data?.data || {},
$date: { $date: {