mirror of
https://github.com/vform666/variant-form3-vite.git
synced 2024-11-10 09:39:20 +08:00
修复getFieldValue()方法没有返回的问题。
This commit is contained in:
parent
ea82b92682
commit
a4c5e20703
@ -484,7 +484,19 @@
|
|||||||
getFieldValue(fieldName) { //单个字段获取值
|
getFieldValue(fieldName) { //单个字段获取值
|
||||||
let fieldRef = this.getWidgetRef(fieldName)
|
let fieldRef = this.getWidgetRef(fieldName)
|
||||||
if (!!fieldRef && !!fieldRef.getValue) {
|
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) {
|
if (!!fieldRef && !!fieldRef.setValue) {
|
||||||
fieldRef.setValue(fieldValue)
|
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) {
|
getSubFormValues(subFormName, needValidation = true) {
|
||||||
|
Loading…
Reference in New Issue
Block a user