refactor: child and parent field are not linked (#2030)
This commit is contained in:
parent
f1feb56743
commit
82ebd0eb44
@ -154,17 +154,16 @@ export const useCollectionState = (currentCollectionName: string) => {
|
|||||||
|
|
||||||
const onCheck = useCallback((checkedKeys, { node, checked }) => {
|
const onCheck = useCallback((checkedKeys, { node, checked }) => {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
let parentKey = node.key.split('.').slice(0, -1).join('.');
|
// let parentKey = node.key.split('.').slice(0, -1).join('.');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 当子节点被选中时,也选中所有祖先节点,提高用户辨识度
|
// 当子节点被选中时,也选中所有祖先节点,提高用户辨识度
|
||||||
while (parentKey) {
|
// while (parentKey) {
|
||||||
if (parentKey) {
|
// if (parentKey) {
|
||||||
checkedKeys.checked = _.uniq([...checkedKeys.checked, parentKey]);
|
// checkedKeys.checked = _.uniq([...checkedKeys.checked, parentKey]);
|
||||||
}
|
// }
|
||||||
|
// parentKey = parentKey.split('.').slice(0, -1).join('.');
|
||||||
parentKey = parentKey.split('.').slice(0, -1).join('.');
|
// }
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
error(err);
|
error(err);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user