Commit d330e0a4 authored by 田翔's avatar 田翔

fix: 关联表单数据修复

parent 4bad32ab
{
"name": "panda-xform",
"version": "6.8.11",
"description": "6.8.11 完善区域任务控件以及配置",
"version": "6.8.13",
"description": "6.8.13 关联表单数量问题",
"keywords": [
"panda-xform"
],
......
......@@ -101,6 +101,7 @@ const XRender = (props, ref) => {
displayType: schemaForm.displayType === 'column' ? 'column' : 'row',//未知原因出现存储'左右'/'上下'
properties: parentObj
}
console.log('json', json)
setInitField(array)
return json
}, [formJson, values, disabledFields, disabled])
......
......@@ -190,8 +190,11 @@ const formFieldHide = async (params) => {
//关联表单隐藏之后将数据清空
if (schema.widget === 'RelationForm' && v.isHide) {
const { configs, data } = params?.form?.formData?.relationForm || { configs: [], data: [] }
let newData = data.filter(v => v.path === !path)
let newData = data.filter(v => v.path !== path)
params?.form?.setValueByPath('relationForm', { configs: configs, data: newData })
setTimeout(() => {
params?.form?.setValueByPath(path, '')
}, 0)
}
params?.form?.setSchemaByPath(path, { ...schema, hidden: v.isHide, presetValue: v.fieldValue || schema.presetValue || '' })
let gorupPath = path.split('.')[0]
......
......@@ -290,7 +290,7 @@ const RelationForm = (props) => {
let listArray = relationForm.data.filter(v => v.ID !== itemData.ID)
listArray.push(itemData)
addons?.setValue('relationForm', { ...relationForm, data: listArray })
onChange(`${new Date().getTime()}`)
onChange(value && value.includes(' ') ? `${array.length}` : `${array.length} `)
addons?.setValue(addons?.dataPath, `${array.length}`)
} else {
rowClick(type, row)
......@@ -331,7 +331,7 @@ const RelationForm = (props) => {
relationForm.data.push(item)
addons.setValue('relationForm', { ...relationForm })
setTimeout(() => {
onChange(value && value.includes(' ') ? `${array.length}` : `${array.length} `)
onChange(value ? `${Number(value) + 1}` : `1`)
}, 0)
}
}
......
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