File was renamed from zy-acs-flow/src/page/loc/BulkUpdateButton.jsx |
| | |
| | | } from 'react-admin'; |
| | | import { Dialog, DialogActions, DialogContent, DialogTitle, Grid, Stack, Divider } from '@mui/material'; |
| | | import UpdateIcon from '@mui/icons-material/Update'; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import ContentSave from '@mui/icons-material/Save'; |
| | | import CloseIcon from '@mui/icons-material/Close'; |
| | | |
| | | const BulkUpdateButton = ({ label = 'ra.action.update' }) => { |
| | | const BulkUpdateButton = ({ label = 'ra.action.update', children }) => { |
| | | const [open, setOpen] = useState(false); |
| | | |
| | | const refresh = useRefresh(); |
| | |
| | | const [updateMany, { loading }] = useUpdateMany(); |
| | | |
| | | const handleSubmit = (data) => { |
| | | delete filteredData['memoWrap']; |
| | | delete data['memoWrap']; |
| | | const filteredData = Object.fromEntries( |
| | | Object.entries(data).filter(([key, value]) => value !== null && value !== undefined) |
| | | ); |
| | |
| | | <Form onSubmit={handleSubmit}> |
| | | <DialogTitle>{translate('ra.action.update')}</DialogTitle> |
| | | <DialogContent> |
| | | <Grid container rowSpacing={2} columnSpacing={2}> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="code" |
| | | reference="code" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.code" |
| | | optionText="data" |
| | | filterToQuery={(val) => ({ data: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <ReferenceInput |
| | | source="locSts" |
| | | reference="locSts" |
| | | > |
| | | <AutocompleteInput |
| | | label="table.field.loc.locSts" |
| | | optionText="name" |
| | | filterToQuery={(val) => ({ name: val })} |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.loc.offset" |
| | | source="offset" |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={12} display="flex" gap={1}> |
| | | <Stack direction="column" spacing={1} width={'100%'}> |
| | | <MemoInput /> |
| | | </Stack> |
| | | </Grid> |
| | | </Grid> |
| | | {children} |
| | | </DialogContent> |
| | | <Divider sx={{ mb: 1 }} /> |
| | | <DialogActions sx={{ mb: 1 }}> |