From 8b75272e5c14675ea396f8782062a6e3872e6a2f Mon Sep 17 00:00:00 2001 From: wangailin Date: Wed, 9 Mar 2022 17:57:38 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20[form]=E6=96=B0=E5=A2=9E=E9=85=8D?= =?UTF-8?q?=E7=BD=AE-=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8C=89=E9=92=AE=E6=8F=90=E4=BA=A4=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E9=AA=8C=E8=AF=81=E8=A1=A8=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/steps/form/index.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/steps/form/index.tsx b/src/steps/form/index.tsx index 5be24f0..27debc8 100644 --- a/src/steps/form/index.tsx +++ b/src/steps/form/index.tsx @@ -79,6 +79,7 @@ export interface ActionConfig { type: 'submit' | 'cancel' | 'ccms', label: string, mode: 'normal' | 'primary' | 'link', + submitValidate: boolean condition?: ConditionConfig handle?: OperationConfig callback?: { @@ -620,6 +621,7 @@ export default class FormStep extends Step { onClick: () => this.handleCancel() })) } else { + const submitValidate = actions[index].submitValidate const OperationHelperWrapper = { this.renderButtonComponent({ label: actions[index].label || '', mode: actions[index].mode, - onClick + onClick: submitValidate + ? async () => { + await this.handleValidations() + console.info('表单参数信息', this.submitData, this.state.formValue, this.formData) + if (this.canSubmit) { + onClick() + } + } + : onClick }) )} @@ -645,7 +655,7 @@ export default class FormStep extends Step { } } } - + if (ready) { return ( -- Gitee From 7bd56496854778a43eec7fb0c097a7f9227ede81 Mon Sep 17 00:00:00 2001 From: wangailin Date: Wed, 9 Mar 2022 19:29:40 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=88=87=E6=8D=A2=E6=97=B6=E6=9B=BF=E6=8D=A2=E8=B7=AF?= =?UTF-8?q?=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/steps/table/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/steps/table/index.tsx b/src/steps/table/index.tsx index a3a5dbd..ea388da 100644 --- a/src/steps/table/index.tsx +++ b/src/steps/table/index.tsx @@ -62,6 +62,7 @@ export interface TableCCMSOperationConfig { type: 'ccms' page: any target: 'current' | 'page' | 'open' | 'handle' + historyTpye?: 'replace' targetURL: string data: { [key: string]: ParamConfig } params?: { field: string, data: ParamConfig }[] @@ -337,7 +338,11 @@ export default class TableStep extends Step { if (this.props.handlePageRedirect) { this.props.handlePageRedirect(`${targetURL}${targetKey}`) } else { - window.location.href = `${targetURL}${targetKey}` + if (operation.handle.historyTpye === 'replace') { + window.location.replace(`${targetURL}${targetKey}`) + } else { + window.location.href = `${targetURL}${targetKey}` + } } } else if (operation.handle.target === 'open') { const sourceURL = await this.props.loadPageFrameURL(operation.handle.page) -- Gitee From 5110b2e64ba3361075f7882463c0001cfe229c47 Mon Sep 17 00:00:00 2001 From: wangailin Date: Wed, 9 Mar 2022 20:19:11 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=BC=B9=E7=AA=97=E5=AE=BD=E5=BA=A6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/steps/table/index.tsx | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/steps/table/index.tsx b/src/steps/table/index.tsx index ea388da..894ef65 100644 --- a/src/steps/table/index.tsx +++ b/src/steps/table/index.tsx @@ -492,7 +492,6 @@ export default class TableStep extends Step { config: { field, label, - width, primary, columns, operations, @@ -507,6 +506,7 @@ export default class TableStep extends Step { operation: { enable: operationEnable, target: operationTarget, + width: operationWidth, title: operationTitle, visible: operationVisible, config: operationConfig, @@ -707,11 +707,11 @@ export default class TableStep extends Step { {operationEnable && ( operationTarget === 'current' ? ( - this.renderOperationModal({ - title: operationTitle, - width, - visible: operationVisible, - children: ( + this.renderOperationModal({ + title: operationTitle, + width: operationWidth, + visible: operationVisible, + children: ( { } }} /> - ), - onClose: () => { - const { operation } = this.state - operation.enable = false - operation.visible = false - this.setState({ operation }) - } - }) - ) + ), + onClose: () => { + const { operation } = this.state + operation.enable = false + operation.visible = false + this.setState({ operation }) + } + }) + ) : ( { } }} /> - ) + ) )} ) -- Gitee From 856cedff77128e8bee4509a6e2d0413a02c9f357 Mon Sep 17 00:00:00 2001 From: wangailin Date: Wed, 9 Mar 2022 20:27:38 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20=E5=BC=B9=E5=B1=82=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=A1=A8=E6=A0=BC=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/steps/table/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/steps/table/index.tsx b/src/steps/table/index.tsx index 894ef65..d62034a 100644 --- a/src/steps/table/index.tsx +++ b/src/steps/table/index.tsx @@ -64,6 +64,7 @@ export interface TableCCMSOperationConfig { target: 'current' | 'page' | 'open' | 'handle' historyTpye?: 'replace' targetURL: string + width: string data: { [key: string]: ParamConfig } params?: { field: string, data: ParamConfig }[] callback?: boolean @@ -214,6 +215,7 @@ interface TableState { operation: { enable: boolean target: 'current' | 'handle' + width: string title: string visible: boolean config: CCMSConfig @@ -246,6 +248,7 @@ export default class TableStep extends Step { enable: false, target: 'current', title: '', + width: '400px', visible: false, config: {}, data: {}, @@ -323,6 +326,7 @@ export default class TableStep extends Step { operation: { enable: true, target: operation.handle.target, + width: operation.handle.width, title: operation.label, visible: true, config: operationConfig, -- Gitee From 36bae42d441f8829b5c9f296f0fca10ed193e528 Mon Sep 17 00:00:00 2001 From: wangailin Date: Wed, 9 Mar 2022 20:37:41 +0800 Subject: [PATCH 5/5] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=AE=BD=E5=BA=A6=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/steps/table/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/steps/table/index.tsx b/src/steps/table/index.tsx index d62034a..44071b1 100644 --- a/src/steps/table/index.tsx +++ b/src/steps/table/index.tsx @@ -100,6 +100,7 @@ interface TableOperationConfirmConfig { export interface ITable { title: string | null primary: string + width: string data: { [field: string]: any }[] columns: ITableColumn[] pagination?: { @@ -496,6 +497,7 @@ export default class TableStep extends Step { config: { field, label, + width, primary, columns, operations, @@ -527,6 +529,7 @@ export default class TableStep extends Step { const props: ITable = { title: label, + width, primary, data: getDate, columns: (columns || []).filter((column) => column.field !== undefined && column.field !== '').map((column, index) => { -- Gitee