fix: 人员选择组件无法加载子部门人员 (#3219)

This commit is contained in:
RUNZE LU 2021-12-17 11:34:11 +08:00 committed by GitHub
parent ecc544e692
commit 5bbf83ac4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -712,6 +712,21 @@ export const FormItemStore = StoreNode.named('FormItemStore')
data
);
// 插入新的子节点用于之后BaseSelection.resolveSelected查找
if (Array.isArray(self.options[0].children)) {
const children = self.options[0].children.concat();
flattenTree(self.options[0].leftOptions).forEach(item => {
if (
!findTree(self.options[0].children, node => node.ref === item.value)
) {
children.push({ref: item.value, defer: true});
}
});
setOptions([{...self.options[0], children}], undefined, data);
}
return json;
});