Merge "fix: Fix for updateDefaultValue & add display params"
This commit is contained in:
commit
b5bb49b077
@ -404,12 +404,20 @@ export default class BaseForm extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
updateDefaultValue = () => {
|
updateDefaultValue = () => {
|
||||||
if (this.formRef.current && this.formRef.current.resetFields) {
|
this.resetFormValue();
|
||||||
this.formRef.current.resetFields();
|
|
||||||
}
|
|
||||||
this.updateContext(this.defaultValue);
|
this.updateContext(this.defaultValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
resetFormValue = (fields) => {
|
||||||
|
if (this.formRef.current && this.formRef.current.resetFields) {
|
||||||
|
if (!fields) {
|
||||||
|
this.formRef.current.resetFields();
|
||||||
|
} else {
|
||||||
|
this.formRef.current.resetFields(fields);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
updateFormValue = (key, value) => {
|
updateFormValue = (key, value) => {
|
||||||
this.formRef.current &&
|
this.formRef.current &&
|
||||||
this.formRef.current.setFieldsValue({
|
this.formRef.current.setFieldsValue({
|
||||||
@ -516,7 +524,10 @@ export default class BaseForm extends React.Component {
|
|||||||
renderFormItems() {
|
renderFormItems() {
|
||||||
try {
|
try {
|
||||||
return this.formItems.map((it, index) => {
|
return this.formItems.map((it, index) => {
|
||||||
const { name } = it;
|
const { name, display = true } = it;
|
||||||
|
if (!display) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
this.codeError = false;
|
this.codeError = false;
|
||||||
return (
|
return (
|
||||||
<Col
|
<Col
|
||||||
|
Loading…
Reference in New Issue
Block a user