Skip to content

Commit

Permalink
perf: 右键菜单加上显示文件夹大小
Browse files Browse the repository at this point in the history
  • Loading branch information
jamebal committed May 8, 2024
1 parent ad62976 commit d0df620
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion public/resource/font_2024484_ziwmm4cu4r.js

Large diffs are not rendered by default.

32 changes: 21 additions & 11 deletions src/components/ShowFile/ShowFile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -685,12 +685,7 @@
</el-form-item>
<el-form-item label="大小:">
<span>
{{ rowContextData.size }}字节
{{
rowContextData.size > 0
? "(" + formatSize(rowContextData.size) + ")"
: ""
}}</span
{{formatSize(rowContextData.size)}}</span
>
</el-form-item>
<el-form-item label="位置:" class="details-position">
Expand Down Expand Up @@ -1112,6 +1107,7 @@ export default {
dragLoop: null,
positionX: 0,
positionY: 0,
showFolderSize: false,
grid: this.defaultGrid,
vmode: this.defaultGrid ? "grid" : "list",
gridColumnNum: -1,
Expand Down Expand Up @@ -2585,6 +2581,11 @@ export default {
child[0].iconClass = "menu-point";
child[1].iconClass = "menu-empty";
}
if (this.showFolderSize) {
child[2].iconClass = "duigou";
} else {
child[2].iconClass = "menu-empty";
}
}
if (arrangementModeIndex > -1) {
const child = this.contextMenus[arrangementModeIndex].child;
Expand Down Expand Up @@ -2728,7 +2729,8 @@ export default {
isFavorite: this.queryCondition.isFavorite,
queryFileType: this.queryFileType,
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize
pageSize: this.pagination.pageSize,
showFolderSize: this.showFolderSize
})
.then(res => {
this.loadData(res, onLoad);
Expand All @@ -2751,7 +2753,8 @@ export default {
currentDirectory: this.getQueryPath(),
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize,
folder: this.$route.query.folder
folder: this.$route.query.folder,
showFolderSize: this.showFolderSize
})
.then(res => {
this.loadData(res, onLoad);
Expand All @@ -2771,7 +2774,8 @@ export default {
currentDirectory: this.getQueryPath(),
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize,
folder: this.$route.query.folder
folder: this.$route.query.folder,
showFolderSize: this.showFolderSize
})
.then(res => {
this.loadData(res, onLoad);
Expand Down Expand Up @@ -2803,7 +2807,8 @@ export default {
tagId: this.queryCondition.tagId,
queryCondition: this.queryCondition,
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize
pageSize: this.pagination.pageSize,
showFolderSize: this.showFolderSize
})
.then(res => {
this.loadData(res, onLoad);
Expand All @@ -2819,7 +2824,8 @@ export default {
currentDirectory: this.getQueryPath(),
folder: this.$route.query.folder,
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize
pageSize: this.pagination.pageSize,
showFolderSize: this.showFolderSize
})
.then(res => {
this.loadData(res, onLoad);
Expand Down Expand Up @@ -3417,6 +3423,10 @@ export default {
this.grid = false;
this.changeVmode();
break;
case "show-folder-size":
this.showFolderSize = !this.showFolderSize;
this.getFileList();
break;
case "orderName":
this.sortChangeOfMenu("name", 2);
break;
Expand Down
1 change: 1 addition & 0 deletions src/views/home/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default {
{ label: '查看', operation: 'viewMode' ,child: [
{ iconClass: this.grid?'':'menu-point', label: '列表', operation: 'vmode-list'},
{ iconClass: this.grid?'menu-point':'', label: '缩略图', operation: 'vmode-grid'},
{ label: '显示文件夹大小', operation: 'show-folder-size'},
]
},
{ label: '排列方式', operation: 'arrangement' ,child: [
Expand Down

0 comments on commit d0df620

Please sign in to comment.