From 85c052ba5976c241d365969a857a00164ce92546 Mon Sep 17 00:00:00 2001 From: chenos Date: Sun, 8 Aug 2021 12:06:33 +0800 Subject: [PATCH] feat: improve code --- packages/client/src/resource.ts | 4 +- packages/client/src/schemas/action/index.tsx | 8 +- packages/client/src/schemas/add-new/index.tsx | 95 +++++++++++++++---- .../client/src/schemas/form/DesignableBar.tsx | 8 +- .../src/schemas/table/SimpleDesignableBar.tsx | 93 ++++++++++++++++++ packages/client/src/schemas/table/index.tsx | 43 ++++++++- 6 files changed, 219 insertions(+), 32 deletions(-) create mode 100644 packages/client/src/schemas/table/SimpleDesignableBar.tsx diff --git a/packages/client/src/resource.ts b/packages/client/src/resource.ts index 9a1ab5b2c..c2e8d34d1 100644 --- a/packages/client/src/resource.ts +++ b/packages/client/src/resource.ts @@ -63,7 +63,9 @@ export class Resource { if (!resourceKey) { return Promise.resolve({ data: {} }); } - return request(`${resourceName}:get/${resourceKey}`); + return request(`${resourceName}:get/${resourceKey}`, { + params: options, + }); } create(values: any) { diff --git a/packages/client/src/schemas/action/index.tsx b/packages/client/src/schemas/action/index.tsx index da66d8ce9..f158120b0 100644 --- a/packages/client/src/schemas/action/index.tsx +++ b/packages/client/src/schemas/action/index.tsx @@ -109,14 +109,14 @@ Action.Modal = observer((props: any) => { const { run: runCancel } = useCancelAction(); const isFormDecorator = schema['x-decorator'] === 'Form'; const field = useField(); - console.log('Action.Modal.field', field); + console.log('Action.Modal.field', schema['x-read-pretty']); return ( { @@ -171,6 +171,7 @@ Action.Drawer = observer((props: any) => { const { run: runOk } = useOkAction(); const { run: runCancel } = useCancelAction(); const isFormDecorator = schema['x-decorator'] === 'Form'; + console.log('Action.Modal.field', schema['x-read-pretty']); return ( { maskClosable destroyOnClose footer={ - isFormDecorator && ( + isFormDecorator && + !schema['x-read-pretty'] && (