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/basicInfo/matnr/MatnrList.jsx | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 56 insertions(+), 4 deletions(-) diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx index 3140810..9bf7cfc 100644 --- a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx +++ b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx @@ -54,7 +54,10 @@ import PrintIcon from '@mui/icons-material/Print'; import request from '@/utils/request'; import BatchModal from './BatchModal'; +import BatchGropuModal from './BatchGropuModal'; import PrintModal from './PrintModal'; +import LinkIcon from '@mui/icons-material/Link'; +import BindModal from './BindModal'; const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ '& .css-1vooibu-MuiSvgIcon-root': { @@ -84,10 +87,11 @@ overflow: 'hidden', textOverflow: 'ellipsis', display: 'block', - width: '100px', + width: '200px', }, '& .RaDatagrid-table': { - width: '100%' + width: '100%', + position: 'relative', } })); @@ -156,7 +160,6 @@ const [columns, setColumns] = useState([]); const refresh = useRefresh(); - const { refetch } = useListContext(); useEffect(() => { getDynamicFields(); @@ -206,7 +209,7 @@ <TextField key="memo" source="memo" label="common.field.memo" sortable={false} />, ] const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />) - const opt = <WrapperField key="opt" cellClassName="opt" label="common.field.opt"> + const opt = <WrapperField key="opt" cellClassName="fixed" className="fixed" label="common.field.opt"> <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> <EnableButton /> </WrapperField> @@ -238,7 +241,9 @@ <StyledDatagrid preferenceKey='matnr' bulkActionButtons={<> + <BatchGroupButton /> <BatchButton /> + <BindButton /> <PrintButton /> <BulkDeleteButton mutationMode={OPERATE_MODE} /> </>} @@ -358,8 +363,32 @@ ) } +const BatchGroupButton = () => { + const record = useRecordContext(); + const notify = useNotify(); + const refresh = useRefresh(); + + + const [createDialog, setCreateDialog] = useState(false); + + return ( + <> + <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchMatnrGropu"}> + <EditIcon /> + </Button> + + <BatchGropuModal + open={createDialog} + setOpen={setCreateDialog} + /> + </> + + ) +} + const PrintButton = () => { const record = useRecordContext(); + const { resource, selectedIds } = useListContext(); const notify = useNotify(); const refresh = useRefresh(); @@ -374,6 +403,29 @@ <PrintModal open={createDialog} setOpen={setCreateDialog} + rows={selectedIds} + /> + </> + ) +} + +const BindButton = () => { + const record = useRecordContext(); + const notify = useNotify(); + const refresh = useRefresh(); + + + const [createDialog, setCreateDialog] = useState(false); + + return ( + <> + <Button onClick={() => setCreateDialog(true)} label={"toolbar.bindloc"}> + <LinkIcon /> + </Button> + + <BindModal + open={createDialog} + setOpen={setCreateDialog} /> </> -- Gitblit v1.9.1