From 1dd993cf842ced0e49bb962bca09c10ad37dd89a Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 08 十一月 2024 13:56:17 +0800 Subject: [PATCH] # --- zy-acs-flow/src/page/loc/LocList.jsx | 7 ++----- zy-acs-flow/src/page/loc/BulkUpdateButton.jsx | 6 ++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/zy-acs-flow/src/page/loc/BulkUpdateButton.jsx b/zy-acs-flow/src/page/loc/BulkUpdateButton.jsx index 9be7c09..572f8ee 100644 --- a/zy-acs-flow/src/page/loc/BulkUpdateButton.jsx +++ b/zy-acs-flow/src/page/loc/BulkUpdateButton.jsx @@ -12,6 +12,7 @@ NumberInput, TextInput, useTranslate, + useResourceContext, } from 'react-admin'; import { Dialog, DialogActions, DialogContent, DialogTitle, Grid, Stack, Divider } from '@mui/material'; import UpdateIcon from '@mui/icons-material/Update'; @@ -19,12 +20,13 @@ import ContentSave from '@mui/icons-material/Save'; import CloseIcon from '@mui/icons-material/Close'; -const BulkUpdateButton = ({ resource, label = 'ra.action.update', ...rest }) => { +const BulkUpdateButton = ({ label = 'ra.action.update' }) => { const [open, setOpen] = useState(false); const refresh = useRefresh(); const notify = useNotify(); const translate = useTranslate(); + const resource = useResourceContext(); const unselectAll = useUnselectAll(resource); const { selectedIds } = useListContext(); @@ -34,10 +36,10 @@ const [updateMany, { loading }] = useUpdateMany(); const handleSubmit = (data) => { + delete filteredData['memoWrap']; const filteredData = Object.fromEntries( Object.entries(data).filter(([key, value]) => value !== null && value !== undefined) ); - delete filteredData['memoWrap']; if (Object.keys(filteredData).length > 0) { updateMany( resource, diff --git a/zy-acs-flow/src/page/loc/LocList.jsx b/zy-acs-flow/src/page/loc/LocList.jsx index d06d296..753e1f2 100644 --- a/zy-acs-flow/src/page/loc/LocList.jsx +++ b/zy-acs-flow/src/page/loc/LocList.jsx @@ -100,13 +100,10 @@ />, ] -const LocBulkActionButtons = (props) => { +const LocBulkActionButtons = () => { return ( <> - <BulkUpdateButton - {...props} - resource="loc" - /> + <BulkUpdateButton /> <BulkDeleteButton mutationMode={OPERATE_MODE} /> </> ); -- Gitblit v1.9.1