mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-26 23:33:01 +00:00
perf: 搜索排序
This commit is contained in:
parent
ef85282777
commit
7d772542ee
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "DooTask",
|
"name": "DooTask",
|
||||||
"version": "0.20.20",
|
"version": "0.20.23",
|
||||||
"description": "DooTask is task management system.",
|
"description": "DooTask is task management system.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "./cmd dev",
|
"start": "./cmd dev",
|
||||||
|
|||||||
2
public/js/app.js
vendored
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
@ -1 +1 @@
|
|||||||
8b8b6345426f7692
|
38a09a69a7591dbd
|
||||||
|
|||||||
@ -286,12 +286,21 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
return list.sort((a, b) => {
|
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) {
|
if (a.top_at || b.top_at) {
|
||||||
return $A.Date(b.top_at) - $A.Date(a.top_at);
|
return $A.Date(b.top_at) - $A.Date(a.top_at);
|
||||||
}
|
}
|
||||||
|
// 根据未读数排序
|
||||||
if (a.todo_num > 0 || b.todo_num > 0) {
|
if (a.todo_num > 0 || b.todo_num > 0) {
|
||||||
return b.todo_num - a.todo_num;
|
return b.todo_num - a.todo_num;
|
||||||
}
|
}
|
||||||
|
// 根据最后会话时间排序
|
||||||
return $A.Date(b.last_at) - $A.Date(a.last_at);
|
return $A.Date(b.last_at) - $A.Date(a.last_at);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user