Commit 45b36f8d authored by 田翔's avatar 田翔

fix: 只读情况去掉必填校验

parent 27323fad
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "2.6.2", "version": "2.6.3",
"description": "2.6.2: 站点选择器回显问题", "description": "2.6.3: 只读情况去掉必填校验",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -49,14 +49,19 @@ const XRender = (props, ref) => { ...@@ -49,14 +49,19 @@ const XRender = (props, ref) => {
} }
}) })
} }
//只读情况下,去掉必填校验
let disabledField = child[s].disabled let disabledField = child[s].disabled
let required = child[s].required
if (disabledFields && !disabledFields.includes(s) && !disabledField) { if (disabledFields && !disabledFields.includes(s) && !disabledField) {
disabledField = true disabledField = true
} }
if (disabled) { if (disabled) {
disabledField = true disabledField = true
} }
childObj[s] = { ...child[s], presetValue: value || child[s].presetValue, disabled: disabledField } if (disabledField) {
required = false
}
childObj[s] = { ...child[s], presetValue: value || child[s].presetValue, disabled: disabledField, required }
} }
} }
if (JSON.stringify(childObj) !== '{}') { if (JSON.stringify(childObj) !== '{}') {
......
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