fix: 修复 #10134 引发的 CRUD2 中单元格中通用动作不执行问题 (#10189)

This commit is contained in:
liaoxuezhi 2024-05-09 17:45:52 +08:00 committed by GitHub
parent a4aa44a799
commit 37de6ea70f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1056,23 +1056,35 @@ export default class CRUD2 extends React.Component<CRUD2Props, any> {
// @ts-ignore
return this[`handle${upperFirst(action.actionType)}`](data);
}
// const {onAction, data: ctx} = this.props;
// return this.props.onAction?.(
// undefined,
// action,
// ctx,
// throwErrors,
// undefined
// );
}
@autobind
handleAction(
e: React.UIEvent<any> | undefined,
action: ActionObject,
ctx: object
ctx: object,
throwErrors: boolean = false,
delegate?: IScopedContext
) {
return this.doAction(action, ctx);
if (
[
'stopAutoRefresh',
'reload',
'search',
'startAutoRefresh',
'loadMore'
].includes(action.actionType as any)
) {
return this.doAction(action, ctx, throwErrors);
} else {
return this.props.onAction(
e,
action,
ctx,
throwErrors,
delegate || this.context
);
}
}
unSelectItem(item: any, index: number) {