mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 19:08:45 +08:00
bulkAction 可以配置不要求选中
This commit is contained in:
parent
b86e69b479
commit
a2fa03a322
@ -35,7 +35,8 @@ const ActionProps = [
|
||||
'mergeData',
|
||||
'index',
|
||||
'copy',
|
||||
'payload'
|
||||
'payload',
|
||||
'requireSelected'
|
||||
];
|
||||
import {filterContents} from './Remark';
|
||||
import {ClassNamesFn, themeable} from '../theme';
|
||||
|
@ -307,7 +307,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
handleBulkAction(selectedItems: Array<any>, unSelectedItems: Array<any>, e: React.UIEvent<any>, action: Action) {
|
||||
const {store, primaryField, onAction, messages, pageField, stopAutoRefreshWhenModalIsOpen} = this.props;
|
||||
|
||||
if (!selectedItems.length) {
|
||||
if (!selectedItems.length && action.requireSelected !== false) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -971,7 +971,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
|
||||
{
|
||||
key: `bulk-${index}`,
|
||||
data: ctx,
|
||||
disabled: btn.disabled || !selectedItems.length,
|
||||
disabled: btn.disabled || (btn.requireSelected !== false ? !selectedItems.length : false),
|
||||
onAction: this.handleBulkAction.bind(
|
||||
this,
|
||||
selectedItems.concat(),
|
||||
|
Loading…
Reference in New Issue
Block a user