From baae04a6dd25424f612149036538d083536698e4 Mon Sep 17 00:00:00 2001 From: chenos Date: Thu, 18 Mar 2021 22:36:05 +0800 Subject: [PATCH] feat: add create/update/destroy action logs views --- .../src/collections/action_logs.ts | 77 ++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/packages/plugin-action-logs/src/collections/action_logs.ts b/packages/plugin-action-logs/src/collections/action_logs.ts index b45c26fe8..3581de2eb 100644 --- a/packages/plugin-action-logs/src/collections/action_logs.ts +++ b/packages/plugin-action-logs/src/collections/action_logs.ts @@ -131,10 +131,85 @@ export default { details: ['descriptions'], sort: ['-created_at'], }, + { + developerMode: true, + type: 'table', + name: 'create', + title: '新增数据', + labelField: 'created_at', + actions: [ + { + name: 'filter', + type: 'filter', + title: '过滤', + }, + ], + fields: ['created_at', 'user', 'collection', 'type', 'index'], + detailsOpenMode: 'drawer', // window + details: ['descriptions'], + filter: { + and: [ + { + type: 'create', + } + ], + }, + sort: ['-created_at'], + }, + { + developerMode: true, + type: 'table', + name: 'update', + title: '更新数据', + labelField: 'created_at', + actions: [ + { + name: 'filter', + type: 'filter', + title: '过滤', + }, + ], + fields: ['created_at', 'user', 'collection', 'type', 'index'], + detailsOpenMode: 'drawer', // window + details: ['descriptions'], + filter: { + and: [ + { + type: 'update', + } + ], + }, + sort: ['-created_at'], + }, + { + developerMode: true, + type: 'table', + name: 'destroy', + title: '删除数据', + labelField: 'created_at', + actions: [ + { + name: 'filter', + type: 'filter', + title: '过滤', + }, + ], + fields: ['created_at', 'user', 'collection', 'type', 'index'], + detailsOpenMode: 'drawer', // window + details: ['descriptions'], + filter: { + and: [ + { + type: 'destroy', + } + ], + }, + sort: ['-created_at'], + }, { type: 'table', name: 'table2', - title: '表格视图', + title: '操作日志列表', labelField: 'created_at', actions: [ {