From 06d7fb698ce6d0efc7ff4224c6b68d2f50feb716 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期一, 21 四月 2025 16:23:46 +0800 Subject: [PATCH] DO单修改及优化 --- rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx | 33 ++++++++++++++++++++++++++++++++- 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx b/rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx index 45a4e4d..5fd0003 100644 --- a/rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx +++ b/rsf-admin/src/page/basicInfo/locType/LocTypeList.jsx @@ -31,6 +31,9 @@ ReferenceArrayInput, AutocompleteInput, DeleteButton, + useRefresh, + Button, + useList } from 'react-admin'; import { Box, Typography, Card, Stack } from '@mui/material'; import { styled } from '@mui/material/styles'; @@ -42,6 +45,8 @@ import PageDrawer from "../../components/PageDrawer"; import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; import * as Common from '@/utils/common'; +import BindModal from "./BindModal"; +import LinkIcon from '@mui/icons-material/Link'; const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ '& .css-1vooibu-MuiSvgIcon-root': { @@ -109,7 +114,10 @@ > <StyledDatagrid preferenceKey='locType' - bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} + bulkActionButtons={<> + <BindButton /> + <BulkDeleteButton /> + </>} rowClick={(id, resource, record) => false} omit={['id', 'createTime', 'createBy', 'memo']} > @@ -150,3 +158,26 @@ } export default LocTypeList; + +const BindButton = () => { + const record = useRecordContext(); + const notify = useNotify(); + const refresh = useRefresh(); + + + const [createDialog, setCreateDialog] = useState(false); + + return ( + <> + <Button onClick={() => setCreateDialog(true)} label={"toolbar.bindmatnr"}> + <LinkIcon /> + </Button> + + <BindModal + open={createDialog} + setOpen={setCreateDialog} + /> + </> + + ) +} -- Gitblit v1.9.1