#
luxiaotao1123
2024-09-24 351f8191a009e12b66e1215eaac70f3857a9b504
zy-acs-flow/src/page/bus/BusList.jsx
@@ -47,6 +47,8 @@
import BusListAside from "./BusListAside";
import { getBusStsColor } from '@/utils/color-util';
import CancelIcon from '@mui/icons-material/Cancel';
import request from '@/utils/request';
import ConfirmButton from "../components/ConfirmButton";
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
@@ -99,8 +101,9 @@
    const [createDialog, setCreateDialog] = useState(false);
    const [drawerVal, setDrawerVal] = useState(false);
    const onCancel = (onCancel) => {
        alert(onCancel.busNo);
    const onCancel = (busId) => {
        console.log(busId);
    }
    return (
@@ -171,18 +174,29 @@
                    <FunctionField label="common.field.opt" cellClassName="opt" render={record => (
                        (record.busSts === 15 || true) && (
                            // <DeleteButton label="" sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} />
                            <Button
                            // <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"
                                color="error"
                                startIcon={<CancelIcon />}
                                sx={{ padding: '1px', fontSize: '.75rem' }}
                                onClick={(event) => {
                                    event.stopPropagation();
                                    onCancel(record);
                                data={record.busNo}
                                onConfirm={() => {
                                    onCancel(record.id);
                                }}
                            >
                                {translate('ra.action.cancel')}
                            </Button>
                            />
                        )
                    )} />
                </StyledDatagrid>