From b37a74f078fdb05aff732c1b335aa9b29d6f6340 Mon Sep 17 00:00:00 2001 From: zhangwenshuai Date: Tue, 21 Jul 2020 15:59:12 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=A1=A8=E5=8D=95=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/apolloTable/editFormV3/index.tsx | 39 +++++++++++---------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/components/apolloTable/editFormV3/index.tsx b/components/apolloTable/editFormV3/index.tsx index 1855df4..c8bf830 100644 --- a/components/apolloTable/editFormV3/index.tsx +++ b/components/apolloTable/editFormV3/index.tsx @@ -28,6 +28,7 @@ const FormItem = Form.Item; class FormWrap extends Component { wrapDom: any; + handleSubmit = (e) => { e.preventDefault(); e.stopPropagation(); @@ -120,27 +121,27 @@ class FormWrap extends Component { const transferColumn = transferAttr(columnType, newProps); const disabled = readOnlyFlag || (dynamicCellConfigDTO && dynamicCellConfigDTO.readonlyFlag); const onBlurFn1 = (changedValue: any, newVal: any) => { - validateFieldsAndScroll((err:any) => { - // 即时编辑时需要对表单必填等规则校验 - if (!err) { - let temp: any[] = []; - value.map((item: any) => { - temp.push({ text: item.text, value: item.value }); - }); - if (temp.length === 0) { - temp = emptyModel; - } - if (!!item.requiredFlag && Array.isArray(newVal) && !newVal[0].value) { - return; - } - if (_.isEqual(temp, newVal)) { - return; - } - if (typeof onBlurFn === 'function') { + if (typeof onBlurFn === 'function') { + let temp: any[] = []; + value.map((item: any) => { + temp.push({ text: item.text, value: item.value }); + }); + if (temp.length === 0) { + temp = emptyModel; + } + if (!!item.requiredFlag && Array.isArray(newVal) && !newVal[0].value) { + return; + } + if (_.isEqual(temp, newVal)) { + return; + } + validateFieldsAndScroll((err:any) => { + // 即时编辑时需要对表单必填等规则校验 + if (!err) { onBlurFn(changedValue); } - } - }); + }); + } }; return ( -- 2.21.0