#
luxiaotao1123
2024-09-24 d6e48b72f0b7afd70205d6e88b3f336264891cc3
zy-acs-flow/src/page/bus/BusList.jsx
@@ -32,6 +32,7 @@
    DeleteButton,
    FunctionField,
    Pagination,
    useNotify,
} from 'react-admin';
import { Box, Typography, Button, Chip } from '@mui/material';
import { styled } from '@mui/material/styles';
@@ -97,13 +98,19 @@
const BusList = () => {
    const translate = useTranslate();
    const notify = useNotify();
    const [createDialog, setCreateDialog] = useState(false);
    const [drawerVal, setDrawerVal] = useState(false);
    const onCancel = (busId) => {
        console.log(busId);
        request.get("/bus/cancel/" + busId).then(res => {
            const { code, msg, data } = res.data;
            if (code === 200) {
                notify(msg || 'common.response.success', { type: 'success', messageArgs: { _: msg } });
            } else {
                notify(msg || 'common.response.fail', { type: 'error', messageArgs: { _: msg } });
            }
        })
    }
    return (
@@ -173,19 +180,6 @@
                    <TextField source="memo" label="common.field.memo" sortable={false} emptyText="-" />
                    <FunctionField label="common.field.opt" cellClassName="opt" render={record => (
                        (record.busSts === 15 || true) && (
                            // <DeleteButton label="" sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
                            // <Button
                            //     size="small"
                            //     color="error"
                            //     startIcon={<CancelIcon />}
                            //     sx={{ padding: '1px', fontSize: '.75rem' }}
                            //     onClick={(event) => {
                            //         event.stopPropagation();
                            //         onCancel(record);
                            //     }}
                            // >
                            //     {translate('ra.action.cancel')}
                            // </Button>
                            <ConfirmButton
                                label="ra.action.cancel"
                                size="small"