From 0d3a5be1512815a38f37ae81e7d9fc0948fd3f16 Mon Sep 17 00:00:00 2001 From: verou <857149855@qq.com> Date: 星期二, 25 三月 2025 13:54:57 +0800 Subject: [PATCH] 1 --- rsf-admin/src/page/warehouseAreas/WarehouseAreasList.jsx | 41 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 36 insertions(+), 5 deletions(-) diff --git a/rsf-admin/src/page/warehouseAreas/WarehouseAreasList.jsx b/rsf-admin/src/page/warehouseAreas/WarehouseAreasList.jsx index c3f9c1f..a44e1fb 100644 --- a/rsf-admin/src/page/warehouseAreas/WarehouseAreasList.jsx +++ b/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': { @@ -60,7 +63,7 @@ const filters = [ <SearchInput source="condition" alwaysOn />, - + <TextField source="warehouseId" label="table.field.warehouseAreas.wareId" alwaysOn />, <TextInput source="uuid" label="table.field.warehouseAreas.uuid" />, <TextInput source="name" label="table.field.warehouseAreas.name" />, <TextInput source="code" label="table.field.warehouseAreas.code" />, @@ -132,10 +135,13 @@ > <StyledDatagrid preferenceKey='warehouseAreas' - bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} + bulkActionButtons={ + <> + <BatchButton /> + <BulkDeleteButton mutationMode={OPERATE_MODE} /> + </> + } rowClick={(id, resource, record) => false} - expand={() => <WarehouseAreasPanel />} - expandSingle={true} omit={['id', 'createTime', 'createBy', 'memo']} > <NumberField source="id" /> @@ -145,6 +151,7 @@ {/* <ReferenceField source="shipperId" label="table.field.warehouseAreas.shipperId" reference="shipper" link={false} sortable={false}> <TextField source="name" /> </ReferenceField> */} + <TextField source="warehouseId$" label="table.field.warehouseAreas.wareId" /> <TextField source="shipperId$" label="table.field.warehouseAreas.shipperId" /> <NumberField source="supplierId" label="table.field.warehouseAreas.supplierId" /> <TextField source="flagMinus$" label="table.field.warehouseAreas.flagMinus" sortable={false} /> @@ -182,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} + /> + </> + + ) +} -- Gitblit v1.9.1