mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 02:12:53 +00:00
perf: 优化会员搜索
This commit is contained in:
parent
5bebc8b5ee
commit
cf3f22776c
@ -330,6 +330,9 @@ class WebSocketDialog extends AbstractModel
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (empty($data['pinyin'])) {
|
||||
$data['pinyin'] = Base::cn2pinyin($data['name']);
|
||||
}
|
||||
|
||||
// 已存在的消息类型
|
||||
if ($hasData === true) {
|
||||
|
||||
@ -368,9 +368,7 @@ export default {
|
||||
switch (switchActive) {
|
||||
case 'recent':
|
||||
if (searchKey) {
|
||||
return recents.filter(item => {
|
||||
return `${item.name}`.indexOf(searchKey) > -1
|
||||
})
|
||||
return recents.filter(item => $A.strExists(`${item.name} ${item.email} ${item.pinyin}`, searchKey))
|
||||
}
|
||||
return recents
|
||||
|
||||
@ -517,9 +515,11 @@ export default {
|
||||
return b.todo_num - a.todo_num;
|
||||
}
|
||||
return $A.dayjs(b.last_at) - $A.dayjs(a.last_at);
|
||||
}).map(({id, name, type, group_type, avatar, dialog_user}) => {
|
||||
}).map(({id, name, pinyin, email, type, group_type, avatar, dialog_user}) => {
|
||||
return {
|
||||
name,
|
||||
pinyin,
|
||||
email,
|
||||
type,
|
||||
group_type,
|
||||
avatar,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user