perf: 消息新增#我协助的任务

This commit is contained in:
kuaifan 2022-07-06 23:27:12 +08:00
parent 2366e4df17
commit 6a58f07a91

View File

@ -536,7 +536,7 @@ export default {
} }
if (list.length > 0) { if (list.length > 0) {
item.label && values.push(...item.label) item.label && values.push(...item.label)
list.length > 0 && values.push(...list) values.push(...list)
} }
}) })
renderList(values, searchTerm); renderList(values, searchTerm);
@ -1043,14 +1043,30 @@ export default {
}) })
} }
// //
let data = this.$store.getters.transforTasks(this.$store.getters.dashboardTask['all']); let dataA = this.$store.getters.transforTasks(this.$store.getters.dashboardTask['all']);
if (data.length > 0) { if (dataA.length > 0) {
data = data.sort((a, b) => { dataA = dataA.sort((a, b) => {
return $A.Date(a.end_at || "2099-12-31 23:59:59") - $A.Date(b.end_at || "2099-12-31 23:59:59"); return $A.Date(a.end_at || "2099-12-31 23:59:59") - $A.Date(b.end_at || "2099-12-31 23:59:59");
}) })
this.taskList.push({ this.taskList.push({
label: [{id: 0, value: this.$L('我的待完成任务'), disabled: true}], label: [{id: 0, value: this.$L('我的待完成任务'), disabled: true}],
list: data.map(item => { list: dataA.map(item => {
return {
id: item.id,
value: item.name
}
}),
})
}
//
let dataB = this.$store.getters.assistTask;
if (dataB.length > 0) {
dataB = dataB.sort((a, b) => {
return $A.Date(a.end_at || "2099-12-31 23:59:59") - $A.Date(b.end_at || "2099-12-31 23:59:59");
})
this.taskList.push({
label: [{id: 0, value: this.$L('我协助的任务'), disabled: true}],
list: dataB.map(item => {
return { return {
id: item.id, id: item.id,
value: item.name value: item.name