1
verou
2025-04-10 ccb18c61fd820567b0560fadb520a34d821c482a
rsf-admin/src/page/asnOrderLog/AsnOrderLogList.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';
@@ -43,6 +45,7 @@
import MyField from "../components/MyField";
import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting';
import * as Common from '@/utils/common';
import ReplayIcon from '@mui/icons-material/Replay';
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
@@ -54,7 +57,7 @@
    '& .column-name': {
    },
    '& .opt': {
        width: 200
        width: 300
    },
}));
@@ -161,6 +164,7 @@
                    <WrapperField cellClassName="opt" label="common.field.opt">
                        <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} />
                        <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
                        <RecoverButton />
                    </WrapperField>
                </StyledDatagrid>
            </List>
@@ -179,3 +183,25 @@
}
export default AsnOrderLogList;
const RecoverButton = () => {
    const record = useRecordContext();
    const notify = useNotify();
    const refresh = useRefresh();
    const requestRecover = async () => {
        const { data: { code, data, msg } } = await request.post(`/asnOrder/recover/${record.id}`);
        if (code === 200) {
            notify(msg);
            refresh()
        } else {
            notify(msg);
        }
    }
    return (
        (<Button onClick={requestRecover} label={"toolbar.recover"} color="success">
            <ReplayIcon />
        </Button>)
    )
}