From d887e67d6a5e78b5beec3b420935371f4c2aa6c4 Mon Sep 17 00:00:00 2001 From: zhangwenshuai Date: Tue, 28 Jul 2020 18:07:38 +0800 Subject: [PATCH] update formView3 --- components/apolloTable/editFormV3/index.tsx | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/components/apolloTable/editFormV3/index.tsx b/components/apolloTable/editFormV3/index.tsx index e90ab9e..be26336 100644 --- a/components/apolloTable/editFormV3/index.tsx +++ b/components/apolloTable/editFormV3/index.tsx @@ -92,22 +92,8 @@ class FormWrap extends Component { }; validateRequired = (item, rule, value, callback) => { - if (!item.requiredFlag) { - return callback(); - } - if (!value) { - return callback('必填项不能为空'); - } - if (Array.isArray(value)) { - if (value.length === 0) { - return callback('必填项不能为空'); - } - const [first] = value; - if (!first.text && first.text !== 0 && !first.value && first.value !== 0) { - return callback('必填项不能为空'); - } - } - if (typeof value === 'object') { + // 可输可选组件清空时数据格式有问题,单独处理一下 + if (item.requiredFlag && Number(item.columnType) === 15 && typeof value === 'object') { if ( !value.label && value.label !== 0 -- 2.21.0