Revert "fix: association field not submitting data when displaying field fro…" (#6796)

This reverts commit d4bf52a047243f5274e23dbf3e57e49d396dba00.
This commit is contained in:
Katherine 2025-04-28 19:21:06 +08:00 committed by GitHub
parent d4bf52a047
commit c1f8b4d2f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 18 deletions

@ -1 +0,0 @@
Subproject commit 7070b7ea1c0a10197c17e93ab079476813c36616

View File

@ -105,23 +105,19 @@ function getFilteredFormValues(form) {
allFields.push(field); allFields.push(field);
} }
}); });
const readonlyPaths = _.uniq( const readonlyPaths = allFields
allFields .filter((field) => field?.componentProps?.readOnlySubmit)
.filter((field) => field?.componentProps?.readOnlySubmit) .map((field) => {
.map((field) => { const segments = field.path?.segments || [];
const segments = field.path?.segments || []; if (segments.length <= 1) {
if (segments.length <= 1) { return segments.join('.');
return segments.join('.'); }
} return segments.slice(0, -1).join('.');
return segments.slice(0, -1).join('.'); });
}), for (const path of readonlyPaths) {
); _.unset(values, path);
readonlyPaths.forEach((path, index) => { }
if (index !== 0 || path.includes('.')) {
// 清空值,但跳过第一层
_.unset(values, path);
}
});
return values; return values;
} }