diff --git a/packages/api/src/app.ts b/packages/api/src/app.ts index 4f56813818..f73ae28dd1 100644 --- a/packages/api/src/app.ts +++ b/packages/api/src/app.ts @@ -41,9 +41,8 @@ const plugins = [ '@nocobase/plugin-collections', '@nocobase/plugin-ui-router', '@nocobase/plugin-ui-schema', - // '@nocobase/plugin-action-logs', - // '@nocobase/plugin-pages', '@nocobase/plugin-users', + '@nocobase/plugin-action-logs', // '@nocobase/plugin-file-manager', // '@nocobase/plugin-permissions', // '@nocobase/plugin-automations', diff --git a/packages/client/src/schemas/add-new/index.tsx b/packages/client/src/schemas/add-new/index.tsx index b9bfd8a5d4..5d5dda74dd 100644 --- a/packages/client/src/schemas/add-new/index.tsx +++ b/packages/client/src/schemas/add-new/index.tsx @@ -384,6 +384,150 @@ function generateCardItemSchema(component) { config: cloneDeep(barChartConfig), }, }, + 'Ref.ActionLogs': { + type: 'array', + name: 'table', + 'x-decorator': 'CardItem', + 'x-component': 'Table', + default: [], + 'x-component-props': { + useResource: '{{ Table.useActionLogsResource }}', + collectionName: 'action_logs', + rowKey: 'id', + // dragSort: true, + showIndex: true, + refreshRequestOnChange: true, + pagination: { + pageSize: 10, + }, + }, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Table.ActionBar', + properties: { + [uid()]: { + type: 'void', + title: '筛选', + 'x-align': 'left', + 'x-component': 'Table.Filter', + 'x-component-props': { + fieldNames: [], + }, + }, + }, + }, + [uid()]: { + type: 'void', + title: '操作', + 'x-component': 'Table.Operation', + 'x-component-props': { + className: 'nb-table-operation', + }, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Action', + 'x-component-props': { + icon: 'EllipsisOutlined', + }, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Action.Dropdown', + 'x-component-props': {}, + properties: { + [uid()]: { + type: 'void', + name: 'action1', + title: '查看', + 'x-component': 'Menu.Action', + 'x-component-props': { + style: { + minWidth: 150, + }, + }, + 'x-action-type': 'view', + properties: { + [uid()]: { + type: 'void', + title: '查看', + 'x-component': 'Action.Drawer', + 'x-component-props': { + bodyStyle: { + background: '#f0f2f5', + // paddingTop: 0, + }, + }, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Tabs', + 'x-component-props': { + singleton: true, + }, + properties: { + [uid()]: { + type: 'void', + title: '详情', + 'x-component': 'Tabs.TabPane', + 'x-component-props': {}, + properties: { + [uid()]: { + type: 'void', + 'x-component': 'Grid', + 'x-component-props': { + // addNewComponent: 'AddNew.PaneItem', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + column1: { + type: 'void', + title: '创建时间', + 'x-component': 'Table.Column', + properties: { + created_at: { + type: 'string', + 'x-component': 'DatePicker', + 'x-read-pretty': true, + 'x-component-props': { + format: 'YYYY-MM-DD HH:mm:ss', + }, + }, + }, + }, + column2: { + type: 'void', + title: '操作类型', + 'x-component': 'Table.Column', + properties: { + type: { + type: 'string', + 'x-component': 'Select', + 'x-read-pretty': true, + enum: [ + { label: '新增数据', value: 'create' }, + { label: '更新数据', value: 'update' }, + { label: '删除数据', value: 'destroy' }, + ], + }, + }, + }, + }, + }, }; return defaults[component]; } @@ -602,12 +746,12 @@ AddNew.CardItem = observer((props: any) => {