mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-04 21:19:27 +08:00
fix: association field not submitting data when displaying field from related collection (#6798)
This commit is contained in:
parent
c1f8b4d2f7
commit
a28e1d2c39
@ -105,18 +105,23 @@ function getFilteredFormValues(form) {
|
||||
allFields.push(field);
|
||||
}
|
||||
});
|
||||
const readonlyPaths = allFields
|
||||
.filter((field) => field?.componentProps?.readOnlySubmit)
|
||||
.map((field) => {
|
||||
const segments = field.path?.segments || [];
|
||||
if (segments.length <= 1) {
|
||||
return segments.join('.');
|
||||
}
|
||||
return segments.slice(0, -1).join('.');
|
||||
});
|
||||
for (const path of readonlyPaths) {
|
||||
_.unset(values, path);
|
||||
}
|
||||
const readonlyPaths = _.uniq(
|
||||
allFields
|
||||
.filter((field) => field?.componentProps?.readOnlySubmit)
|
||||
.map((field) => {
|
||||
const segments = field.path?.segments || [];
|
||||
if (segments.length <= 1) {
|
||||
return segments.join('.');
|
||||
}
|
||||
return segments.slice(0, -1).join('.');
|
||||
}),
|
||||
);
|
||||
readonlyPaths.forEach((path, index) => {
|
||||
if (index !== 0 || path.includes('.')) {
|
||||
// 清空值,但跳过第一层
|
||||
_.unset(values, path);
|
||||
}
|
||||
});
|
||||
|
||||
return values;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user