mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
feat: add EditActionModel and integrate with TableColumnModel
This commit is contained in:
parent
7151737911
commit
9da734b6e3
30
packages/core/client/src/flow/models/EditActionModel.tsx
Normal file
30
packages/core/client/src/flow/models/EditActionModel.tsx
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* This file is part of the NocoBase (R) project.
|
||||
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
||||
* Authors: NocoBase Team.
|
||||
*
|
||||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||
*/
|
||||
|
||||
import type { ButtonProps } from 'antd/es/button';
|
||||
import { ActionModel } from './ActionModel';
|
||||
import { openModeAction } from '../actions/openModeAction';
|
||||
|
||||
export class EditActionModel extends ActionModel {
|
||||
defaultProps: ButtonProps = {
|
||||
type: 'link',
|
||||
title: 'Edit',
|
||||
};
|
||||
}
|
||||
|
||||
EditActionModel.registerFlow({
|
||||
key: 'handleClick',
|
||||
title: '点击事件',
|
||||
on: {
|
||||
eventName: 'click',
|
||||
},
|
||||
steps: {
|
||||
open: openModeAction,
|
||||
},
|
||||
});
|
@ -158,6 +158,13 @@ export class TableActionsColumnModel extends TableColumnModel {
|
||||
use: 'PopupActionModel',
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'edit',
|
||||
label: 'Edit',
|
||||
createModelOptions: {
|
||||
use: 'EditActionModel',
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
<SettingOutlined />
|
||||
|
@ -26,3 +26,4 @@ export * from './TableColumnModel';
|
||||
export * from './TableModel';
|
||||
export * from './ViewActionModel';
|
||||
export * from './PopupActionModel';
|
||||
export * from './EditActionModel';
|
||||
|
Loading…
x
Reference in New Issue
Block a user