skyouc
2025-03-25 8dfdd82adc2250be4c4d7b7f79b2b6e4e47e728d
rsf-admin/src/page/warehouseAreas/WarehouseAreasList.jsx
@@ -31,6 +31,8 @@
    ReferenceArrayInput,
    AutocompleteInput,
    DeleteButton,
    useRefresh,
    Button
} from 'react-admin';
import { Box, Typography, Card, Stack } from '@mui/material';
import { styled } from '@mui/material/styles';
@@ -40,9 +42,10 @@
import MyCreateButton from "../components/MyCreateButton";
import MyExportButton from '../components/MyExportButton';
import PageDrawer from "../components/PageDrawer";
import MyField from "../components/MyField";
import BatchModal from "./BatchModal";
import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
import * as Common from '@/utils/common';
import EditIcon from '@mui/icons-material/Edit';
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
@@ -132,7 +135,12 @@
            >
                <StyledDatagrid
                    preferenceKey='warehouseAreas'
                    bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />}
                    bulkActionButtons={
                        <>
                            <BatchButton />
                            <BulkDeleteButton mutationMode={OPERATE_MODE} />
                        </>
                    }
                    rowClick={(id, resource, record) => false}
                    omit={['id', 'createTime', 'createBy', 'memo']}
                >
@@ -181,3 +189,27 @@
}
export default WarehouseAreasList;
const BatchButton = () => {
    const record = useRecordContext();
    const notify = useNotify();
    const refresh = useRefresh();
    const [createDialog, setCreateDialog] = useState(false);
    return (
        <>
            <Button onClick={() => setCreateDialog(true)} label={"toolbar.batch"}>
                <EditIcon />
            </Button>
            <BatchModal
                open={createDialog}
                setOpen={setCreateDialog}
            />
        </>
    )
}