mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
🎨 Database grouping by field https://github.com/siyuan-note/siyuan/issues/10964
This commit is contained in:
parent
4694a8c6c1
commit
e758739116
1 changed files with 7 additions and 1 deletions
|
|
@ -633,8 +633,14 @@ func filterByQuery(query string, collection av.Collection) {
|
||||||
|
|
||||||
// manualSort 处理用户手动排序。
|
// manualSort 处理用户手动排序。
|
||||||
func manualSort(view *av.View, collection av.Collection) {
|
func manualSort(view *av.View, collection av.Collection) {
|
||||||
|
itemIDs := view.ItemIDs
|
||||||
|
// 如果是分组视图,则需要根据分组项的顺序进行排序
|
||||||
|
if 0 < len(view.GroupItemIDs) {
|
||||||
|
itemIDs = view.GroupItemIDs
|
||||||
|
}
|
||||||
|
|
||||||
sortItemIDs := map[string]int{}
|
sortItemIDs := map[string]int{}
|
||||||
for i, itemID := range view.ItemIDs {
|
for i, itemID := range itemIDs {
|
||||||
sortItemIDs[itemID] = i
|
sortItemIDs[itemID] = i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue