Commit ee8b135c authored by 田翔's avatar 田翔

fix: 防止报错

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