Compare commits

...

1 Commits

Author SHA1 Message Date
kuaifan
7d772542ee perf: 搜索排序 2022-09-20 17:10:50 +08:00
6 changed files with 14 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.20.20",
"version": "0.20.23",
"description": "DooTask is task management system.",
"scripts": {
"start": "./cmd dev",

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
8b8b6345426f7692
38a09a69a7591dbd

View File

@@ -286,12 +286,21 @@ export default {
})
}
return list.sort((a, b) => {
// 搜索结果排在后面
a._by_search = a.is_search === true ? 1 : 0
b._by_search = b.is_search === true ? 1 : 0
if (a._by_search || b._by_search) {
return a._by_search - b._by_search
}
// 根据置顶时间排序
if (a.top_at || b.top_at) {
return $A.Date(b.top_at) - $A.Date(a.top_at);
}
// 根据未读数排序
if (a.todo_num > 0 || b.todo_num > 0) {
return b.todo_num - a.todo_num;
}
// 根据最后会话时间排序
return $A.Date(b.last_at) - $A.Date(a.last_at);
})
},