zhou zhou
1 天以前 6331e9aa3f0ced66084bb41de3245162ff8ae806
rsf-admin/src/page/task/FlowStepInstanceModal.jsx
@@ -25,6 +25,7 @@
import AddIcon from '@mui/icons-material/Add';
import DeleteIcon from '@mui/icons-material/Delete';
import EditIcon from '@mui/icons-material/Edit';
import MyLocationIcon from '@mui/icons-material/MyLocation';
const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
    '& .css-1vooibu-MuiSvgIcon-root': {
@@ -34,7 +35,7 @@
        cursor: 'auto'
    },
    '& .opt': {
        width: 150
        width: 220
    },
}));
@@ -109,6 +110,20 @@
        }
    };
    const handleJumpCurrent = async (item) => {
        try {
            const res = await request.post(`/flowStepInstance/jumpCurrent/${item.id}`);
            if (res.data.code === 200) {
                notify(res.data.msg || translate('common.response.success'), { type: 'success' });
                fetchData();
            } else {
                notify(res.data.msg, { type: 'error' });
            }
        } catch (error) {
            notify('Jump current failed', { type: 'error' });
        }
    };
    const handleFormClose = () => {
        setFormOpen(false);
        setFormData({});
@@ -177,7 +192,7 @@
                        <TextField source="taskNo" label={translate("table.field.flowStepInstance.taskNo")} />
                        <DateField source="createTime" label={translate("table.field.flowStepInstance.createTime")} showTime />
                        <WrapperField cellClassName="opt" label="common.field.opt" onClick={(e) => e.stopPropagation()} >
                            <RowActions onEdit={handleEdit} onDelete={handleDelete} />
                            <RowActions onEdit={handleEdit} onDelete={handleDelete} onJumpCurrent={handleJumpCurrent} />
                        </WrapperField>
                    </StyledDatagrid>
                </DialogContent>
@@ -215,8 +230,9 @@
    );
};
const RowActions = ({ onEdit, onDelete }) => {
const RowActions = ({ onEdit, onDelete, onJumpCurrent }) => {
    const record = useRecordContext();
    const translate = useTranslate();
    return (
        <Box display="flex">
            <Tooltip title="Edit">
@@ -224,6 +240,11 @@
                    <EditIcon fontSize="small" />
                </IconButton>
            </Tooltip>
            <Tooltip title={translate("toolbar.jumpCurrent")}>
                <IconButton onClick={() => onJumpCurrent(record)} size="small" color="secondary">
                    <MyLocationIcon fontSize="small" />
                </IconButton>
            </Tooltip>
            {/* If there's an issue with event propagation you might need to handle it in onClick */}
            <Tooltip title="Delete">
                <IconButton onClick={() => onDelete(record)} size="small" color="error">