mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-06 07:31:48 +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
|
|
@ -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 })
|
||||
case util.SortModeSizeDESC:
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -53,17 +53,19 @@ func GBK2UTF8(src []byte) (string, error) {
|
|||
}
|
||||
|
||||
const (
|
||||
SortModeNameASC = iota // 0:文件名字母升序
|
||||
SortModeNameDESC // 1:文件名字母降序
|
||||
SortModeUpdatedASC // 2:文件更新时间升序
|
||||
SortModeUpdatedDESC // 3:文件更新时间降序
|
||||
SortModeAlphanumASC // 4:文件名自然数升序
|
||||
SortModeAlphanumDESC // 5:文件名自然数降序
|
||||
SortModeCustom // 6:自定义排序
|
||||
SortModeRefCountASC // 7:引用数升序
|
||||
SortModeRefCountDESC // 8:引用数降序
|
||||
SortModeCreatedASC // 9:文件创建时间升序
|
||||
SortModeCreatedDESC // 10:文件创建时间降序
|
||||
SortModeSizeASC // 11:文件大小升序
|
||||
SortModeSizeDESC // 12:文件大小降序
|
||||
SortModeNameASC = iota // 0:文件名字母升序
|
||||
SortModeNameDESC // 1:文件名字母降序
|
||||
SortModeUpdatedASC // 2:文件更新时间升序
|
||||
SortModeUpdatedDESC // 3:文件更新时间降序
|
||||
SortModeAlphanumASC // 4:文件名自然数升序
|
||||
SortModeAlphanumDESC // 5:文件名自然数降序
|
||||
SortModeCustom // 6:自定义排序
|
||||
SortModeRefCountASC // 7:引用数升序
|
||||
SortModeRefCountDESC // 8:引用数降序
|
||||
SortModeCreatedASC // 9:文件创建时间升序
|
||||
SortModeCreatedDESC // 10:文件创建时间降序
|
||||
SortModeSizeASC // 11:文件大小升序
|
||||
SortModeSizeDESC // 12:文件大小降序
|
||||
SortModeSubDocCountASC // 13:子文档数升序
|
||||
SortModeSubDocCountDESC // 14:子文档数降序
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue