{{expiresFormat(item.end_at)}}
@@ -121,6 +121,8 @@ export default {
return this.$L('今日任务');
case 'overdue':
return this.$L('超期任务');
+ case 'all':
+ return this.$L('待完成任务');
default:
return '';
}
@@ -136,9 +138,12 @@ export default {
case 'overdue':
data = this.transforTasks(this.dashboardTask.overdue);
break
+ case 'all':
+ data = this.transforTasks(this.dashboardTask.all);
+ break
}
return data.sort((a, b) => {
- return $A.Date(a.end_at) - $A.Date(b.end_at);
+ return $A.Date(a.end_at || "2099-12-31 23:59:59") - $A.Date(b.end_at || "2099-12-31 23:59:59");
});
},
},
diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js
index a9a885f0..800b14b2 100644
--- a/resources/assets/js/store/actions.js
+++ b/resources/assets/js/store/actions.js
@@ -1116,23 +1116,25 @@ export default {
state.cacheLoading["loadDashboardTasks"] = true;
//
const time = $A.Time()
- const {today, overdue} = getters.dashboardTask;
+ const {today, overdue,all} = getters.dashboardTask;
const currentIds = today.map(({id}) => id)
currentIds.push(...overdue.map(({id}) => id))
+ currentIds.push(...all.map(({id}) => id))
//
- let loadIng = 2;
+ let loadIng = 3;
let call = () => {
if (loadIng <= 0) {
state.cacheLoading["loadDashboardTasks"] = false;
//
- const {today, overdue} = getters.dashboardTask;
+ const {today, overdue,all} = getters.dashboardTask;
const newIds = today.filter(task => task._time >= time).map(({id}) => id)
newIds.push(...overdue.filter(task => task._time >= time).map(({id}) => id))
+ newIds.push(...all.filter(task => task._time >= time).map(({id}) => id))
dispatch("forgetTask", currentIds.filter(v => newIds.indexOf(v) == -1))
return;
}
loadIng--;
- if (loadIng == 1) {
+ if (loadIng == 2) {
// 获取今日任务
dispatch("getTasks", {
complete: "no",
@@ -1141,12 +1143,17 @@ export default {
$A.formatDate("Y-m-d 23:59:59")
],
}).then(call).catch(call)
- } else if (loadIng == 0) {
+ } else if (loadIng == 1) {
// 获取过期任务
dispatch("getTasks", {
complete: "no",
time_before: $A.formatDate("Y-m-d H:i:s"),
}).then(call).catch(call)
+ } else if((loadIng == 0)) {
+ // 获取待处理任务
+ dispatch("getTasks", {
+ complete: "no",
+ }).then(call).catch(call)
}
}
call();
diff --git a/resources/assets/js/store/getters.js b/resources/assets/js/store/getters.js
index 3bf54941..54fb8a05 100644
--- a/resources/assets/js/store/getters.js
+++ b/resources/assets/js/store/getters.js
@@ -112,7 +112,7 @@ export default {
/**
* 仪表盘任务数据
* @param state
- * @returns {{overdue: *, today: *}}
+ * @returns {{overdue: *, today: *,all:*}}
*/
dashboardTask(state) {
const todayStart = $A.Date($A.formatDate("Y-m-d 00:00:00")),
@@ -125,9 +125,6 @@ export default {
if (task.complete_at && chackCompleted === true) {
return false;
}
- if (!task.end_at) {
- return false;
- }
return task.owner;
}
let array = state.cacheTasks.filter(task => filterTask(task));
@@ -142,11 +139,13 @@ export default {
return (start <= todayStart && todayStart <= end) || (start <= todayEnd && todayEnd <= end) || (start > todayStart && todayEnd > end);
})
const overdueTasks = array.filter(task => {
- return $A.Date(task.end_at) <= todayNow;
+ return task.end_at && $A.Date(task.end_at) <= todayNow;
})
+
return {
today: todayTasks,
overdue: overdueTasks,
+ all: array
}
},
}