mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-08 06:59:26 +08:00
chore: comment
This commit is contained in:
parent
87455e86c1
commit
8c7cebcc65
@ -277,16 +277,22 @@ export class CollectionManagerPlugin extends Plugin {
|
||||
for (const field of castArray(fields)) {
|
||||
if (field.get('source')) {
|
||||
const [collectionSource, fieldSource] = field.get('source').split('.');
|
||||
// find original field
|
||||
const collectionField = this.app.db.getCollection(collectionSource).getField(fieldSource);
|
||||
|
||||
const newOptions = {};
|
||||
|
||||
// write original field options
|
||||
lodash.merge(newOptions, collectionField.options);
|
||||
|
||||
// merge with current field options
|
||||
lodash.mergeWith(newOptions, field.get(), (objValue, srcValue) => {
|
||||
if (srcValue === null) {
|
||||
return objValue;
|
||||
}
|
||||
});
|
||||
|
||||
// set final options
|
||||
field.set('options', newOptions);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user