From fb6a6482b156527afc4f78ac900c14e4bd63327d Mon Sep 17 00:00:00 2001 From: verou <857149855@qq.com> Date: 星期四, 27 三月 2025 08:31:37 +0800 Subject: [PATCH] fix:菜单修改 --- rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx | 81 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 77 insertions(+), 4 deletions(-) diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx index 4114430..99edfb3 100644 --- a/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx +++ b/rsf-admin/src/page/basicInfo/matnr/MatnrList.jsx @@ -196,7 +196,7 @@ <NumberField key="stagn" source="stagn" label="table.field.matnr.stagn" />, <NumberField key="valid" source="valid" label="table.field.matnr.valid" />, <NumberField key="validWarn" source="validWarn" label="table.field.matnr.validWarn" />, - <NumberField key="flagCheck" source="flagCheck" label="table.field.matnr.flagCheck" />, + <BooleanField key="flagCheck" source="flagCheck" label="table.field.matnr.flagCheck" sortable={false} />, <ReferenceField key="updateBy" source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> <TextField source="nickname" /> </ReferenceField>, @@ -211,7 +211,7 @@ const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />) const opt = <WrapperField key="opt" cellClassName="fixed" className="fixed" label="common.field.opt"> <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> - <EnableButton /> + <PrintButton /> </WrapperField> setColumns([...arr, ...fields, opt]); @@ -242,10 +242,12 @@ preferenceKey='matnr' bulkActionButtons={<> <BatchGroupButton /> + <BatchWarnButton /> + <BatchFlagButton /> <BatchStatusButton /> <BatchLevelButton /> <BindButton /> - <PrintButton /> + <BatchPrintButton /> <BulkDeleteButton mutationMode={OPERATE_MODE} /> </>} rowClick={(id, resource, record) => false} @@ -388,6 +390,54 @@ ) } +const BatchWarnButton = () => { + const record = useRecordContext(); + const notify = useNotify(); + const refresh = useRefresh(); + + + const [createDialog, setCreateDialog] = useState(false); + + return ( + <> + <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchValidWarn"}> + <EditIcon /> + </Button> + + <BatchModal + open={createDialog} + setOpen={setCreateDialog} + fieldType={'validWarn'} + /> + </> + + ) +} + +const BatchFlagButton = () => { + const record = useRecordContext(); + const notify = useNotify(); + const refresh = useRefresh(); + + + const [createDialog, setCreateDialog] = useState(false); + + return ( + <> + <Button onClick={() => setCreateDialog(true)} label={"toolbar.batchFlagCheck"}> + <EditIcon /> + </Button> + + <BatchModal + open={createDialog} + setOpen={setCreateDialog} + fieldType={'flagCheck'} + /> + </> + + ) +} + const BatchGroupButton = () => { const record = useRecordContext(); const notify = useNotify(); @@ -411,7 +461,7 @@ ) } -const PrintButton = () => { +const BatchPrintButton = () => { const record = useRecordContext(); const { resource, selectedIds } = useListContext(); const notify = useNotify(); @@ -434,6 +484,29 @@ ) } +const PrintButton = () => { + const record = useRecordContext(); + + const notify = useNotify(); + const refresh = useRefresh(); + + const [createDialog, setCreateDialog] = useState(false); + + return ( + <> + <Button color="secondary" onClick={() => setCreateDialog(true)} label={"toolbar.print"}> + <PrintIcon /> + </Button> + + <PrintModal + open={createDialog} + setOpen={setCreateDialog} + rows={[record.id]} + /> + </> + ) +} + const BindButton = () => { const record = useRecordContext(); const notify = useNotify(); -- Gitblit v1.9.1