From 4c3dc89f66957b04de723818f11202a1b628fa2b Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Thu, 11 Apr 2024 14:56:37 +0800 Subject: [PATCH] fix: after selecting all, bulk update prompts for unselected data (#4010) --- .../plugin-action-bulk-update/src/client/utils.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-action-bulk-update/src/client/utils.tsx b/packages/plugins/@nocobase/plugin-action-bulk-update/src/client/utils.tsx index ecb88b3bfc..bb973ff0ac 100644 --- a/packages/plugins/@nocobase/plugin-action-bulk-update/src/client/utils.tsx +++ b/packages/plugins/@nocobase/plugin-action-bulk-update/src/client/utils.tsx @@ -7,7 +7,6 @@ import { useCollection_deprecated, useCompile, useLocalVariables, - useRecord, useTableBlockContext, useVariables, } from '@nocobase/client'; @@ -23,18 +22,15 @@ export const useCustomizeBulkUpdateActionProps = () => { const actionSchema = useFieldSchema(); const tableBlockContext = useTableBlockContext(); const { rowKey } = tableBlockContext; - const selectedRecordKeys = - tableBlockContext.field?.data?.selectedRowKeys ?? expressionScope?.selectedRecordKeys ?? {}; + const navigate = useNavigate(); const compile = useCompile(); const { t } = useBulkUpdateTranslation(); const actionField: any = useField(); const { modal } = App.useApp(); const variables = useVariables(); - const record = useRecord(); const { name, getField } = useCollection_deprecated(); const localVariables = useLocalVariables(); - return { async onClick(e, callBack) { const { @@ -44,6 +40,8 @@ export const useCustomizeBulkUpdateActionProps = () => { } = actionSchema?.['x-action-settings'] ?? {}; actionField.data = field.data || {}; actionField.data.loading = true; + const selectedRecordKeys = + tableBlockContext.field?.data?.selectedRowKeys ?? expressionScope?.selectedRecordKeys ?? {}; const assignedValues = {}; const waitList = Object.keys(originalAssignedValues).map(async (key) => {