zy-acs-flow/src/page/components/BulkUpdateButton.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
zy-acs-flow/src/page/loc/LocBulkUpdateContent.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
zy-acs-flow/src/page/loc/LocList.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
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 }}> zy-acs-flow/src/page/loc/LocBulkUpdateContent.jsx
New file @@ -0,0 +1,56 @@ import React, { useState } from 'react'; import { Form, ReferenceInput, AutocompleteInput, NumberInput, } from 'react-admin'; import { Grid, Stack } from '@mui/material'; import MemoInput from "../components/MemoInput"; const LocBulkUpdateContent = () => { return ( <> <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> </> ) } export default LocBulkUpdateContent; zy-acs-flow/src/page/loc/LocList.jsx
@@ -31,6 +31,7 @@ AutocompleteInput, DeleteButton, Button, Pagination, } from 'react-admin'; import { Box, Typography, Card, Stack } from '@mui/material'; import { styled } from '@mui/material/styles'; @@ -46,7 +47,8 @@ import CorporateFareIcon from '@mui/icons-material/CorporateFare'; import LocInit from "./LocInit"; import rowSx from "./rowSx"; import BulkUpdateButton from "./BulkUpdateButton"; import BulkUpdateButton from "../components/BulkUpdateButton"; import LocBulkUpdateContent from './LocBulkUpdateContent'; const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ '& .css-1vooibu-MuiSvgIcon-root': { @@ -103,7 +105,9 @@ const LocBulkActionButtons = () => { return ( <> <BulkUpdateButton /> <BulkUpdateButton> <LocBulkUpdateContent /> </BulkUpdateButton> <BulkDeleteButton mutationMode={OPERATE_MODE} /> </> ); @@ -143,7 +147,8 @@ <MyExportButton /> </TopToolbar> )} perPage={DEFAULT_PAGE_SIZE} pagination={<Pagination rowsPerPageOptions={[10, 20, 50, 100, 300, 500]} />} perPage={20} > <StyledDatagrid preferenceKey='loc'