feat(sidebar): 添加展开全部功能并支持多语言
- 新增 loadAllObjectGroupChildren 函数以加载所有对象组子项 - 在侧边栏菜单中添加“展开全部”选项 - 更新多语言文件以支持“展开全部”文本
This commit is contained in:
9 files changed
+51
No files matched your search
@@ -2028,6 +2028,31 @@ export const useConnectionStore = defineStore("connection", () => {
|
||||
}
|
||||
}
|
||||
|
||||
async function loadAllObjectGroupChildren(parent: TreeNode) {
|
||||
if (!parent.connectionId || !hasTreeNodeDatabaseContext(parent)) return;
|
||||
if (!objectTypesForGroupNode(parent.type)) return;
|
||||
parent.isLoading = true;
|
||||
try {
|
||||
await ensureConnected(parent.connectionId);
|
||||
if (!isTreeNodeChildrenLoaded(parent.id)) {
|
||||
await loadObjectGroupChildren(parent);
|
||||
}
|
||||
|
||||
let loadMoreNode = parent.children?.find((child) => child.type === "load-more");
|
||||
while (loadMoreNode?.loadMore) {
|
||||
loadMoreNode.isLoading = true;
|
||||
await loadMoreObjectGroupChildren(loadMoreNode);
|
||||
loadMoreNode = parent.children?.find((child) => child.type === "load-more");
|
||||
}
|
||||
parent.isExpanded = true;
|
||||
} catch (e) {
|
||||
recordMetadataLoadError(parent.connectionId, e);
|
||||
throw e;
|
||||
} finally {
|
||||
parent.isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
function normalizedObjectTreeKind(type: string): DatabaseObjectTreeKind {
|
||||
return normalizeSidebarObjectKind(type);
|
||||
}
|
||||
@@ -3635,6 +3660,7 @@ export const useConnectionStore = defineStore("connection", () => {
|
||||
loadTables,
|
||||
loadObjectGroupChildren,
|
||||
loadMoreObjectGroupChildren,
|
||||
loadAllObjectGroupChildren,
|
||||
loadTableGroups,
|
||||
loadColumns,
|
||||
loadIndexes,
|
||||
|
||||
Reference in new issue
Block a user