修复getFieldValue()方法没有返回的问题。

This commit is contained in:
vdpAdmin 2022-07-06 17:41:34 +08:00
parent ea82b92682
commit a4c5e20703

View File

@ -484,7 +484,19 @@
getFieldValue(fieldName) { //
let fieldRef = this.getWidgetRef(fieldName)
if (!!fieldRef && !!fieldRef.getValue) {
fieldRef.getValue()
return fieldRef.getValue()
}
if (!fieldRef) { //
let result = []
this.findWidgetNameInSubForm(fieldName).forEach(wn => {
let sw = this.getWidgetRef(wn)
if (!!sw && !!sw.getValue) {
result.push( sw.getValue() )
}
})
return result
}
},
@ -493,6 +505,15 @@
if (!!fieldRef && !!fieldRef.setValue) {
fieldRef.setValue(fieldValue)
}
if (!fieldRef) { //
this.findWidgetNameInSubForm(fieldName).forEach(wn => {
let sw = this.getWidgetRef(wn)
if (!!sw && !!sw.setValue) {
sw.setValue(fieldValue)
}
})
}
},
getSubFormValues(subFormName, needValidation = true) {