Commit 6dd4c168 authored by zhangwenshuai's avatar zhangwenshuai

修改form校验规则

parent 49179a1a
......@@ -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 (
<Provider value={{ locale: this.getContext() }}>
......
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