diff --git a/public/login.png b/public/login.png new file mode 100644 index 0000000..c21677f Binary files /dev/null and b/public/login.png differ diff --git a/src/components/DocumentTreePanel.vue b/src/components/DocumentTreePanel.vue index 6c60659..4f951bf 100644 --- a/src/components/DocumentTreePanel.vue +++ b/src/components/DocumentTreePanel.vue @@ -98,11 +98,20 @@ interface DocumentTreeTableNode { children: DocumentTreeTableNode[] } -function toTreeTableNode(node: DocumentNode): DocumentTreeTableNode { - return { key: node.id, data: node, children: node.children.map(toTreeTableNode) } +function sortNodes(nodes: DocumentNode[]): DocumentNode[] { + return [...nodes] + .sort((a, b) => { + if (a.type !== b.type) return a.type === 'Folder' ? -1 : 1 + return a.title.localeCompare(b.title) + }) + .map((n) => ({ ...n, children: sortNodes(n.children) })) } -const nodes = computed(() => props.tree.map(toTreeTableNode)) +function toTreeTableNode(node: DocumentNode): DocumentTreeTableNode { + return { key: node.id, data: node, children: sortNodes(node.children).map(toTreeTableNode) } +} + +const nodes = computed(() => sortNodes(props.tree).map(toTreeTableNode)) const selectionKeys = ref>({}) function resolveUserName(userId: string) { diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index b1f617d..afda3f0 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -35,8 +35,48 @@
@@ -57,7 +115,7 @@ class="flex items-center justify-between gap-3 border-b px-4 py-2.5 lg:px-6" style="background: var(--panel); border-color: var(--hairline)" > -
+