feat: add EditActionModel and integrate with TableColumnModel

This commit is contained in:
Zeke Zhang 2025-06-19 07:47:11 +08:00
parent 7151737911
commit 9da734b6e3
3 changed files with 38 additions and 0 deletions

View 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,
},
});

View File

@ -158,6 +158,13 @@ export class TableActionsColumnModel extends TableColumnModel {
use: 'PopupActionModel',
},
},
{
key: 'edit',
label: 'Edit',
createModelOptions: {
use: 'EditActionModel',
},
},
]}
>
<SettingOutlined />

View File

@ -26,3 +26,4 @@ export * from './TableColumnModel';
export * from './TableModel';
export * from './ViewActionModel';
export * from './PopupActionModel';
export * from './EditActionModel';