-
{{$L('仪表板')}}
+
{{$L('仪表盘')}}
{{$L('欢迎您,' + userInfo.nickname)}}
{{$L('以下是你当前的任务统计数据')}}
@@ -162,10 +162,7 @@ export default {
}
})
return datas.sort((a, b) => {
- if (a._end_time != b._end_time) {
- return a._end_time - b._end_time;
- }
- return a.id - b.id;
+ return a._end_time - b._end_time;
});
},
diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js
index 3a3e5e16..d2182e97 100644
--- a/resources/assets/js/store/actions.js
+++ b/resources/assets/js/store/actions.js
@@ -591,7 +591,7 @@ export default {
}
//
setTimeout(() => {
- if (data.parent_id > 0) {
+ if (key == 'taskSubs') {
state.method.setStorage("cacheTaskSubs", state.cacheTaskSubs = state[key]);
} else {
state.method.setStorage("cacheTasks", state.cacheTasks = state[key]);
@@ -608,16 +608,27 @@ export default {
*/
forgetTask({state, dispatch}, task_id) {
let index = state.tasks.findIndex(({id}) => id == task_id);
+ let key = 'tasks';
+ if (index === -1) {
+ index = state.taskSubs.findIndex(({id}) => id == task_id);
+ key = 'taskSubs';
+ }
if (index > -1) {
- dispatch("getTaskOne", state.tasks[index].parent_id)
- dispatch('getProjectOne', state.tasks[index].project_id)
- state.tasks.splice(index, 1);
+ dispatch("getTaskOne", state[key][index].parent_id)
+ if (key == 'tasks') {
+ dispatch('getProjectOne', state[key][index].project_id)
+ }
+ state[key].splice(index, 1);
}
if (state.taskId == task_id) {
state.taskId = 0;
}
setTimeout(() => {
- state.method.setStorage("cacheTasks", state.cacheTasks = state.tasks);
+ if (key == 'taskSubs') {
+ state.method.setStorage("cacheTaskSubs", state.cacheTaskSubs = state[key]);
+ } else {
+ state.method.setStorage("cacheTasks", state.cacheTasks = state[key]);
+ }
})
},