支持查看已归档任务

This commit is contained in:
kuaifan 2022-01-23 23:55:56 +08:00
parent 563cd4b843
commit f06b4040bc
5 changed files with 44 additions and 9 deletions

View File

@ -95,6 +95,9 @@ export default {
list() {
const {cacheTasks, taskCompleteTemps} = this;
const filterTask = (task, chackCompleted = true) => {
if (task.archived_at) {
return false;
}
if (task.complete_at && chackCompleted === true) {
return false;
}

View File

@ -595,7 +595,10 @@ export default {
return a.id - b.id;
});
list.forEach((column) => {
column.tasks = this.transforTasks(cacheTasks.filter((task) => {
column.tasks = this.transforTasks(cacheTasks.filter(task => {
if (task.archived_at) {
return false;
}
return task.column_id == column.id;
})).sort((a, b) => {
if (a.sort != b.sort) {
@ -655,7 +658,10 @@ export default {
unList() {
const {projectId, cacheTasks, searchText, sortField, sortType} = this;
const array = cacheTasks.filter((task) => {
const array = cacheTasks.filter(task => {
if (task.archived_at) {
return false;
}
if (task.project_id != projectId || task.parent_id > 0) {
return false;
}
@ -683,7 +689,10 @@ export default {
completedList() {
const {projectId, cacheTasks, searchText} = this;
const array = cacheTasks.filter((task) => {
const array = cacheTasks.filter(task => {
if (task.archived_at) {
return false;
}
if (task.project_id != projectId || task.parent_id > 0) {
return false;
}
@ -703,7 +712,10 @@ export default {
completedCount() {
const {projectId, cacheTasks} = this;
return cacheTasks.filter((task) => {
return cacheTasks.filter(task => {
if (task.archived_at) {
return false;
}
if (task.project_id != projectId || task.parent_id > 0) {
return false;
}
@ -766,7 +778,12 @@ export default {
sort = -1;
upTask.push(...item.task.map(id => {
sort++;
upTask.push(...this.cacheTasks.filter(({parent_id}) => parent_id == id).map(({id}) => {
upTask.push(...this.cacheTasks.filter(task => {
if (task.archived_at) {
return false;
}
return task.parent_id == id
}).map(({id}) => {
return {
id,
sort,
@ -1161,6 +1178,9 @@ export default {
},
myFilter(task, chackCompleted = true) {
if (task.archived_at) {
return false;
}
if (task.project_id != this.projectId) {
return false;
}
@ -1178,6 +1198,9 @@ export default {
},
helpFilter(task, chackCompleted = true) {
if (task.archived_at) {
return false;
}
if (task.project_id != this.projectId || task.parent_id > 0) {
return false;
}

View File

@ -568,8 +568,11 @@ export default {
if (!this.taskId) {
return [];
}
return this.cacheTasks.filter(({parent_id}) => {
return parent_id == this.taskId
return this.cacheTasks.filter(task => {
if (task.archived_at) {
return false;
}
return task.parent_id == this.taskId
}).sort((a, b) => {
return a.id - b.id;
});

View File

@ -163,8 +163,11 @@ export default {
subTask() {
return function(task_id) {
return this.cacheTasks.filter(({parent_id}) => {
return parent_id == task_id
return this.cacheTasks.filter(task => {
if (task.archived_at) {
return false;
}
return task.parent_id == task_id
}).sort((a, b) => {
return a.id - b.id;
});

View File

@ -119,6 +119,9 @@ export default {
todayEnd = $A.Date($A.formatDate("Y-m-d 23:59:59")),
todayNow = $A.Date($A.formatDate("Y-m-d H:i:s"));
const filterTask = (task, chackCompleted = true) => {
if (task.archived_at) {
return false;
}
if (task.complete_at && chackCompleted === true) {
return false;
}