mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
🎨 支持按子文档数排序 Fix https://github.com/siyuan-note/siyuan/issues/6030
This commit is contained in:
parent
18ad07d2f4
commit
890d01a368
9 changed files with 56 additions and 17 deletions
|
|
@ -428,6 +428,8 @@
|
||||||
"createdDESC": "Created Time DESC",
|
"createdDESC": "Created Time DESC",
|
||||||
"docSizeASC": "Document Size ASC",
|
"docSizeASC": "Document Size ASC",
|
||||||
"docSizeDESC": "Document Size DESC",
|
"docSizeDESC": "Document Size DESC",
|
||||||
|
"subDocCountASC": "Sub-docs Count ASC ",
|
||||||
|
"subDocCountDESC": "Sub-docs Count DESC",
|
||||||
"sort": "Sort",
|
"sort": "Sort",
|
||||||
"enterFullscreen": "Enter Full Screen",
|
"enterFullscreen": "Enter Full Screen",
|
||||||
"exitFullscreen": "Exit Full Screen",
|
"exitFullscreen": "Exit Full Screen",
|
||||||
|
|
|
||||||
|
|
@ -428,6 +428,8 @@
|
||||||
"createdDESC": "Tiempo de creación DESC",
|
"createdDESC": "Tiempo de creación DESC",
|
||||||
"docSizeASC": "Tamaño del Documento Ascendente",
|
"docSizeASC": "Tamaño del Documento Ascendente",
|
||||||
"docSizeDESC": "Tamaño del Documento Descendente",
|
"docSizeDESC": "Tamaño del Documento Descendente",
|
||||||
|
"subDocCountASC": "Recuento de subdocumentos ASC",
|
||||||
|
"subDocCountDESC": "Recuento de subdocs DESC",
|
||||||
"sort": "Ordenar",
|
"sort": "Ordenar",
|
||||||
"enterFullscreen": "Entrar en pantalla completa",
|
"enterFullscreen": "Entrar en pantalla completa",
|
||||||
"exitFullscreen": "Salir de pantalla completa",
|
"exitFullscreen": "Salir de pantalla completa",
|
||||||
|
|
|
||||||
|
|
@ -428,6 +428,8 @@
|
||||||
"createdDESC": "Temps créé décroissant",
|
"createdDESC": "Temps créé décroissant",
|
||||||
"docSizeASC": "Taille du document croissante",
|
"docSizeASC": "Taille du document croissante",
|
||||||
"docSizeDESC": "Taille du document décroissante",
|
"docSizeDESC": "Taille du document décroissante",
|
||||||
|
"subDocCountASC": "Nombre de sous-documents ASC ",
|
||||||
|
"subDocCountDESC": "Nombre de sous-documents DESC",
|
||||||
"sort": "Tri",
|
"sort": "Tri",
|
||||||
"enterFullscreen": "plein écran",
|
"enterFullscreen": "plein écran",
|
||||||
"exitFullscreen": "Quitter le plein écran",
|
"exitFullscreen": "Quitter le plein écran",
|
||||||
|
|
|
||||||
|
|
@ -428,6 +428,8 @@
|
||||||
"createdDESC": "創建時間降冪",
|
"createdDESC": "創建時間降冪",
|
||||||
"docSizeASC": "文檔大小升序",
|
"docSizeASC": "文檔大小升序",
|
||||||
"docSizeDESC": "文檔大小降序",
|
"docSizeDESC": "文檔大小降序",
|
||||||
|
"subDocCountASC": "子文檔數升序",
|
||||||
|
"subDocCountDESC": "子文檔數降序",
|
||||||
"sort": "排序",
|
"sort": "排序",
|
||||||
"enterFullscreen": "進入全螢幕",
|
"enterFullscreen": "進入全螢幕",
|
||||||
"exitFullscreen": "退出全螢幕",
|
"exitFullscreen": "退出全螢幕",
|
||||||
|
|
|
||||||
|
|
@ -428,6 +428,8 @@
|
||||||
"createdDESC": "创建时间降序",
|
"createdDESC": "创建时间降序",
|
||||||
"docSizeASC": "文档大小升序",
|
"docSizeASC": "文档大小升序",
|
||||||
"docSizeDESC": "文档大小降序",
|
"docSizeDESC": "文档大小降序",
|
||||||
|
"subDocCountASC": "子文档数升序",
|
||||||
|
"subDocCountDESC": "子文档数降序",
|
||||||
"sort": "排序",
|
"sort": "排序",
|
||||||
"enterFullscreen": "进入全屏幕",
|
"enterFullscreen": "进入全屏幕",
|
||||||
"exitFullscreen": "退出全屏幕",
|
"exitFullscreen": "退出全屏幕",
|
||||||
|
|
|
||||||
|
|
@ -918,7 +918,7 @@ class="b3-list-item b3-list-item--hide-action" data-path="${item.path}">
|
||||||
click: () => {
|
click: () => {
|
||||||
clickEvent(1);
|
clickEvent(1);
|
||||||
}
|
}
|
||||||
}, {type: "separator"}, {
|
}, {
|
||||||
icon: window.siyuan.config.fileTree.sort === 4 ? "iconSelect" : undefined,
|
icon: window.siyuan.config.fileTree.sort === 4 ? "iconSelect" : undefined,
|
||||||
label: window.siyuan.languages.fileNameNatASC,
|
label: window.siyuan.languages.fileNameNatASC,
|
||||||
click: () => {
|
click: () => {
|
||||||
|
|
@ -978,6 +978,18 @@ class="b3-list-item b3-list-item--hide-action" data-path="${item.path}">
|
||||||
click: () => {
|
click: () => {
|
||||||
clickEvent(12);
|
clickEvent(12);
|
||||||
}
|
}
|
||||||
|
}, {type: "separator"}, {
|
||||||
|
icon: window.siyuan.config.fileTree.sort === 13 ? "iconSelect" : undefined,
|
||||||
|
label: window.siyuan.languages.subDocCountASC,
|
||||||
|
click: () => {
|
||||||
|
clickEvent(13);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
icon: window.siyuan.config.fileTree.sort === 14 ? "iconSelect" : undefined,
|
||||||
|
label: window.siyuan.languages.subDocCountDESC,
|
||||||
|
click: () => {
|
||||||
|
clickEvent(14);
|
||||||
|
}
|
||||||
}, {type: "separator"}, {
|
}, {type: "separator"}, {
|
||||||
icon: window.siyuan.config.fileTree.sort === 6 ? "iconSelect" : undefined,
|
icon: window.siyuan.config.fileTree.sort === 6 ? "iconSelect" : undefined,
|
||||||
label: window.siyuan.languages.customSort,
|
label: window.siyuan.languages.customSort,
|
||||||
|
|
|
||||||
|
|
@ -243,9 +243,6 @@ export class MobileFiles extends Model {
|
||||||
clickEvent(1);
|
clickEvent(1);
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
|
||||||
type: "separator"
|
|
||||||
}).element);
|
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
icon: window.siyuan.config.fileTree.sort === 4 ? "iconSelect" : undefined,
|
icon: window.siyuan.config.fileTree.sort === 4 ? "iconSelect" : undefined,
|
||||||
label: window.siyuan.languages.fileNameNatASC,
|
label: window.siyuan.languages.fileNameNatASC,
|
||||||
|
|
@ -319,6 +316,20 @@ export class MobileFiles extends Model {
|
||||||
clickEvent(12);
|
clickEvent(12);
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
icon: window.siyuan.config.fileTree.sort === 13 ? "iconSelect" : undefined,
|
||||||
|
label: window.siyuan.languages.subDocCountASC,
|
||||||
|
click: () => {
|
||||||
|
clickEvent(13);
|
||||||
|
}
|
||||||
|
}).element);
|
||||||
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
icon: window.siyuan.config.fileTree.sort === 14 ? "iconSelect" : undefined,
|
||||||
|
label: window.siyuan.languages.subDocCountDESC,
|
||||||
|
click: () => {
|
||||||
|
clickEvent(14);
|
||||||
|
}
|
||||||
|
}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
icon: window.siyuan.config.fileTree.sort === 6 ? "iconSelect" : undefined,
|
icon: window.siyuan.config.fileTree.sort === 6 ? "iconSelect" : undefined,
|
||||||
label: window.siyuan.languages.customSort,
|
label: window.siyuan.languages.customSort,
|
||||||
|
|
|
||||||
|
|
@ -365,6 +365,10 @@ func ListDocTree(boxID, path string, sortMode int) (ret []*File, totals int, err
|
||||||
sort.Slice(docs, func(i, j int) bool { return docs[i].Size < docs[j].Size })
|
sort.Slice(docs, func(i, j int) bool { return docs[i].Size < docs[j].Size })
|
||||||
case util.SortModeSizeDESC:
|
case util.SortModeSizeDESC:
|
||||||
sort.Slice(docs, func(i, j int) bool { return docs[i].Size > docs[j].Size })
|
sort.Slice(docs, func(i, j int) bool { return docs[i].Size > docs[j].Size })
|
||||||
|
case util.SortModeSubDocCountASC:
|
||||||
|
sort.Slice(docs, func(i, j int) bool { return docs[i].SubFileCount < docs[j].SubFileCount })
|
||||||
|
case util.SortModeSubDocCountDESC:
|
||||||
|
sort.Slice(docs, func(i, j int) bool { return docs[i].SubFileCount > docs[j].SubFileCount })
|
||||||
}
|
}
|
||||||
|
|
||||||
if util.SortModeCustom != sortMode {
|
if util.SortModeCustom != sortMode {
|
||||||
|
|
|
||||||
|
|
@ -66,4 +66,6 @@ const (
|
||||||
SortModeCreatedDESC // 10:文件创建时间降序
|
SortModeCreatedDESC // 10:文件创建时间降序
|
||||||
SortModeSizeASC // 11:文件大小升序
|
SortModeSizeASC // 11:文件大小升序
|
||||||
SortModeSizeDESC // 12:文件大小降序
|
SortModeSizeDESC // 12:文件大小降序
|
||||||
|
SortModeSubDocCountASC // 13:子文档数升序
|
||||||
|
SortModeSubDocCountDESC // 14:子文档数降序
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue