Commit ee8b135c authored by 田翔's avatar 田翔

fix: 防止报错

parent 0ddc3c46
{
"name": "panda-xform",
"version": "2.2.3",
"description": "2.2.3: 暴露form实例",
"version": "2.2.5",
"description": "2.2.5: 防止报错",
"keywords": [
"panda-xform"
],
......
......@@ -49,7 +49,7 @@ const XRender = (props, ref) => {
})
}
let disabledField = child[s].disabled
if (!disabledFields.includes(s) && !disabledField) {
if (disabledFields && !disabledFields.includes(s) && !disabledField) {
disabledField = true
}
if (disabled) {
......@@ -74,7 +74,7 @@ const XRender = (props, ref) => {
let { data, errors } = await form.submit()
let formValue = []
Object.keys(data).map((k) => {
if (isObject(data[k])) {
if (isObject(data[k]) && ['relationForm'].includes(k)) {
Object.keys(data[k]).map((key) => {
formValue.push({ fieldName: key, fieldValue: data[k][key] + '' })
})
......
......@@ -56,8 +56,6 @@ const BaseForm = (props, ref) => {
}
})
childObj[s] = { ...child[s], presetValue: value || child[s].presetValue }
} else {
}
}
}
......@@ -73,9 +71,11 @@ const BaseForm = (props, ref) => {
let { data, errors } = await form.submit()
let formValue = []
Object.keys(data).map((k) => {
Object.keys(data[k]).map((key) => {
formValue.push({ fieldName: key, fieldValue: data[k][key] + '' })
})
if (isObject(data[k]) && ['relationForm'].includes(k)) {
Object.keys(data[k]).map((key) => {
formValue.push({ fieldName: key, fieldValue: data[k][key] + '' })
})
}
})
return {
formValue,
......
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