From ab78655004872b1167a78275f98d73fd5cf53620 Mon Sep 17 00:00:00 2001 From: chenos Date: Sun, 20 Feb 2022 01:37:47 +0800 Subject: [PATCH] fix(client): update action initializer --- .../TableRecordActionInitializer/index.tsx | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/client/src/schema-initializer/Initializers/TableRecordActionInitializer/index.tsx b/packages/client/src/schema-initializer/Initializers/TableRecordActionInitializer/index.tsx index aaf79c84f..2b8cf183e 100644 --- a/packages/client/src/schema-initializer/Initializers/TableRecordActionInitializer/index.tsx +++ b/packages/client/src/schema-initializer/Initializers/TableRecordActionInitializer/index.tsx @@ -168,9 +168,49 @@ export const TableRecordActionInitializer = observer((props: any) => { properties: { drawer: { type: 'void', + 'x-decorator': 'Form', + 'x-decorator-props': { + useValues: '{{ cm.useValuesFromRecord }}', + }, 'x-component': 'Action.Drawer', title: '{{ t("Edit record") }}', - properties: {}, + properties: { + grid: { + type: 'void', + 'x-component': 'Grid', + 'x-item-initializer': 'FormItemInitializer', + properties: {}, + }, + footer: { + type: 'void', + 'x-component': 'Action.Drawer.Footer', + properties: { + actions: { + type: 'void', + // 'x-action-initializer': 'DrawerForm', + 'x-component': 'ActionBar', + 'x-component-props': {}, + properties: { + action1: { + title: '{{ t("Cancel") }}', + 'x-component': 'Action', + 'x-component-props': { + useAction: '{{ cm.useCancelAction }}', + }, + }, + action2: { + title: '{{ t("Submit") }}', + 'x-component': 'Action', + 'x-component-props': { + type: 'primary', + useAction: '{{ cm.useUpdateAction }}', + }, + }, + }, + }, + }, + }, + }, }, }, },