From 6dd4c168dc6ae85bca61a1223729465a048de38f Mon Sep 17 00:00:00 2001 From: zhangwenshuai Date: Thu, 23 Jul 2020 21:29:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9form=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/apolloTable/editFormV3/index.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/components/apolloTable/editFormV3/index.tsx b/components/apolloTable/editFormV3/index.tsx index f9c795a..25621f6 100644 --- a/components/apolloTable/editFormV3/index.tsx +++ b/components/apolloTable/editFormV3/index.tsx @@ -32,7 +32,9 @@ class FormWrap extends Component { handleSubmit = (e) => { e.preventDefault(); e.stopPropagation(); - const { rowId, form, handleSubmit, data, rowData, detailType } = this.props; + const { + rowId, form, handleSubmit, data, rowData, detailType, + } = this.props; form.validateFieldsAndScroll((err, values) => { if (!err) { const newValues: any[] = []; @@ -106,7 +108,14 @@ class FormWrap extends Component { } } if (typeof value === 'object') { - if (!value.text && value.text !== 0 && !value.value && value.value !== 0) { + if ( + !value.label + && value.label !== 0 + && !value.text + && value.text !== 0 + && !value.value + && value.value !== 0 + ) { return callback('必填项不能为空'); } } @@ -209,7 +218,9 @@ class FormWrap extends Component { }; render() { - const { loading, isShowDelBtn, data, btnWrapStyle, name, colsNum, delLabel, hideOperateBtn } = this.props; + const { + loading, isShowDelBtn, data, btnWrapStyle, name, colsNum, delLabel, hideOperateBtn, + } = this.props; return ( -- 2.21.0