test: 右键菜单加上显示文件夹大小

This commit is contained in:
jmal 2024-05-11 09:30:50 +08:00
parent 70587fdffa
commit df87f3c116

View File

@ -1107,7 +1107,6 @@ export default {
dragLoop: null, dragLoop: null,
positionX: 0, positionX: 0,
positionY: 0, positionY: 0,
showFolderSize: false,
grid: this.defaultGrid, grid: this.defaultGrid,
vmode: this.defaultGrid ? "grid" : "list", vmode: this.defaultGrid ? "grid" : "list",
gridColumnNum: -1, gridColumnNum: -1,
@ -2581,7 +2580,7 @@ export default {
child[0].iconClass = "menu-point"; child[0].iconClass = "menu-point";
child[1].iconClass = "menu-empty"; child[1].iconClass = "menu-empty";
} }
if (this.showFolderSize) { if (localStorage.getItem('showFolderSize') === 'true') {
child[2].iconClass = "duigou"; child[2].iconClass = "duigou";
} else { } else {
child[2].iconClass = "menu-empty"; child[2].iconClass = "menu-empty";
@ -2730,7 +2729,7 @@ export default {
queryFileType: this.queryFileType, queryFileType: this.queryFileType,
pageIndex: this.pagination.pageIndex, pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize, pageSize: this.pagination.pageSize,
showFolderSize: this.showFolderSize showFolderSize: localStorage.getItem('showFolderSize')
}) })
.then(res => { .then(res => {
this.loadData(res, onLoad); this.loadData(res, onLoad);
@ -2754,7 +2753,7 @@ export default {
pageIndex: this.pagination.pageIndex, pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize, pageSize: this.pagination.pageSize,
folder: this.$route.query.folder, folder: this.$route.query.folder,
showFolderSize: this.showFolderSize showFolderSize: localStorage.getItem('showFolderSize')
}) })
.then(res => { .then(res => {
this.loadData(res, onLoad); this.loadData(res, onLoad);
@ -2775,7 +2774,7 @@ export default {
pageIndex: this.pagination.pageIndex, pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize, pageSize: this.pagination.pageSize,
folder: this.$route.query.folder, folder: this.$route.query.folder,
showFolderSize: this.showFolderSize showFolderSize: localStorage.getItem('showFolderSize')
}) })
.then(res => { .then(res => {
this.loadData(res, onLoad); this.loadData(res, onLoad);
@ -2808,7 +2807,7 @@ export default {
queryCondition: this.queryCondition, queryCondition: this.queryCondition,
pageIndex: this.pagination.pageIndex, pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize, pageSize: this.pagination.pageSize,
showFolderSize: this.showFolderSize showFolderSize: localStorage.getItem('showFolderSize')
}) })
.then(res => { .then(res => {
this.loadData(res, onLoad); this.loadData(res, onLoad);
@ -2825,7 +2824,7 @@ export default {
folder: this.$route.query.folder, folder: this.$route.query.folder,
pageIndex: this.pagination.pageIndex, pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize, pageSize: this.pagination.pageSize,
showFolderSize: this.showFolderSize showFolderSize: localStorage.getItem('showFolderSize')
}) })
.then(res => { .then(res => {
this.loadData(res, onLoad); this.loadData(res, onLoad);
@ -3424,7 +3423,8 @@ export default {
this.changeVmode(); this.changeVmode();
break; break;
case "show-folder-size": case "show-folder-size":
this.showFolderSize = !this.showFolderSize; const showFolderSize = localStorage.getItem('showFolderSize')
localStorage.setItem('showFolderSize', showFolderSize === 'false')
this.getFileList(); this.getFileList();
break; break;
case "orderName": case "orderName":