#
luxiaotao1123
2024-11-08 6faab23aa66f4c29f9f83458d2d899341f5725b0
zy-acs-flow/src/page/components/BulkUpdateButton.jsx
File was renamed from zy-acs-flow/src/page/loc/BulkUpdateButton.jsx
@@ -16,11 +16,10 @@
} 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();
@@ -36,7 +35,7 @@
    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)
        );
@@ -71,43 +70,7 @@
                <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 }}>