Commit d887e67d authored by zhangwenshuai's avatar zhangwenshuai

update formView3

parent 5d836e5a
...@@ -92,22 +92,8 @@ class FormWrap extends Component { ...@@ -92,22 +92,8 @@ class FormWrap extends Component {
}; };
validateRequired = (item, rule, value, callback) => { validateRequired = (item, rule, value, callback) => {
if (!item.requiredFlag) { // 可输可选组件清空时数据格式有问题,单独处理一下
return callback(); if (item.requiredFlag && Number(item.columnType) === 15 && typeof value === 'object') {
}
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 ( if (
!value.label !value.label
&& value.label !== 0 && value.label !== 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment