Skip to content

Commit

Permalink
fix: fix the launch page of file_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
qxsclass committed Jan 25, 2025
1 parent 54274e3 commit 28492f7
Showing 1 changed file with 11 additions and 27 deletions.
38 changes: 11 additions & 27 deletions innopacks/panel/resources/views/file_manager/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -1962,34 +1962,18 @@ class="file-card-context-menu"
}))
}];
// 如果有子文件夹,自动选中第一个
if (folders.length > 0) {
const firstFolder = folders[0];
this.currentFolder = {
id: firstFolder.path,
name: firstFolder.name,
path: firstFolder.path
};
// 设置默认展开的节点,包括所有父节点
this.defaultExpandedKeys = ['/', firstFolder.path];
// 如果当前文件夹有子文件夹,也展开它们
if (firstFolder.children) {
firstFolder.children.forEach(child => {
this.defaultExpandedKeys.push(child.path);
});
}
// 默认选中根目录
this.currentFolder = {
id: '/',
name: '图片空间',
path: '/'
};
this.loadFiles(firstFolder.path);
} else {
this.currentFolder = {
id: '/',
name: '图片空间',
path: '/'
};
this.defaultExpandedKeys = ['/'];
this.loadFiles('/');
}
// 设置默认展开的节点
this.defaultExpandedKeys = ['/'];
// 加载根目录的文件
this.loadFiles('/');
}).catch(err => {
this.$message.error('获取文件夹失败:' + err.message);
});
Expand Down

0 comments on commit 28492f7

Please sign in to comment.