From 9125c48d8b101d3834d823bc4130b43c2cb41e15 Mon Sep 17 00:00:00 2001 From: yujinlong Date: Thu, 24 Oct 2024 14:45:03 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat=EF=BC=9A=E5=85=AC=E5=85=B1form?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=9B=9E=E8=B0=83=E7=B1=BB=E5=9E=8B=E8=A1=A5?= =?UTF-8?q?=E5=85=85&=E8=A1=A8=E6=A0=BC=E6=93=8D=E4=BD=9C=E5=88=97?= =?UTF-8?q?=E5=8F=AF=E8=AE=BE=E7=BD=AE=E8=87=AA=E5=AE=9A=E4=B9=89icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/src/types/form.ts | 32 +++++++++---------- .../Table/src/components/RenderComponent.vue | 15 +++++++++ .../Table/src/components/TableAction.vue | 25 ++++++++++++--- src/components/Table/src/types/tableAction.ts | 28 ++++++++-------- 4 files changed, 66 insertions(+), 34 deletions(-) create mode 100644 src/components/Table/src/components/RenderComponent.vue diff --git a/src/components/Form/src/types/form.ts b/src/components/Form/src/types/form.ts index 3239dbeb..8eddcbe9 100644 --- a/src/components/Form/src/types/form.ts +++ b/src/components/Form/src/types/form.ts @@ -124,8 +124,8 @@ export interface FormProps { // Show confirmation button showSubmitButton?: boolean - resetFunc?: () => Promise - submitFunc?: () => Promise + resetFunc?: (() => Promise) | (() => void) + submitFunc?: (() => Promise) | (() => void) transformDateFunc?: (date: any) => string colon?: boolean, // 表单是否初始状态是只读属性 @@ -145,9 +145,9 @@ export interface FormSchema { subLabel?: string // Help text on the right side of the text helpMessage?: - | string - | string[] - | ((renderCallbackParams: RenderCallbackParams) => string | string[]) + | string + | string[] + | ((renderCallbackParams: RenderCallbackParams) => string | string[]) // BaseHelp component props helpComponentProps?: Partial // Label width, if it is passed, the labelCol and WrapperCol configured by itemProps will be invalid @@ -158,13 +158,13 @@ export interface FormSchema { component: ComponentType // Component parameters componentProps?: - | ((opt: { - schema: FormSchema - tableAction: TableActionType - formActionType: FormActionType - formModel: Recordable - }) => Recordable) - | object + | ((opt: { + schema: FormSchema + tableAction: TableActionType + formActionType: FormActionType + formModel: Recordable + }) => Recordable) + | object // Required required?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean) @@ -203,10 +203,10 @@ export interface FormSchema { renderColContent?: (renderCallbackParams: RenderCallbackParams) => VNode | VNode[] | string renderComponentContent?: - | ((renderCallbackParams: RenderCallbackParams) => any) - | VNode - | VNode[] - | string + | ((renderCallbackParams: RenderCallbackParams) => any) + | VNode + | VNode[] + | string // Custom slot, in from-item slot?: string diff --git a/src/components/Table/src/components/RenderComponent.vue b/src/components/Table/src/components/RenderComponent.vue new file mode 100644 index 00000000..9da7f0c1 --- /dev/null +++ b/src/components/Table/src/components/RenderComponent.vue @@ -0,0 +1,15 @@ + + diff --git a/src/components/Table/src/components/TableAction.vue b/src/components/Table/src/components/TableAction.vue index 58f23e57..4ee5a4cc 100644 --- a/src/components/Table/src/components/TableAction.vue +++ b/src/components/Table/src/components/TableAction.vue @@ -3,13 +3,19 @@