Commit 63cf95ab by zhaochengxiang

目录默认根节点展开

parent b9be2e40
...@@ -201,6 +201,10 @@ const ModelTree = (props) => { ...@@ -201,6 +201,10 @@ const ModelTree = (props) => {
const currentItem = (data.subCatalogs||[]).length>0?data.subCatalogs[0]: null; const currentItem = (data.subCatalogs||[]).length>0?data.subCatalogs[0]: null;
setItem(currentItem); setItem(currentItem);
if (currentItem && currentItem.key) {
setExpandedKeys([currentItem?.key]);
}
onSelect && onSelect(currentItem?(currentItem.key||''):''); onSelect && onSelect(currentItem?(currentItem.key||''):'');
} }
...@@ -429,13 +433,6 @@ const ModelTree = (props) => { ...@@ -429,13 +433,6 @@ const ModelTree = (props) => {
setItem(defaultItem); setItem(defaultItem);
onSelect && onSelect(defaultItem.key||''); onSelect && onSelect(defaultItem.key||'');
} else if (refrence === '') {
const currentItem = (treeData||[]).length>0?treeData[0]: null;
setItem(currentItem);
onSelect && onSelect(currentItem?(currentItem.key||''):'');
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment