支持查看归档任务

This commit is contained in:
kuaifan 2022-01-23 17:43:15 +08:00
parent 1777153411
commit d9f4adbe26
3 changed files with 11 additions and 5 deletions

View File

@ -1387,7 +1387,11 @@ class ProjectController extends AbstractController
} elseif ($type == 'add') {
$task->archivedTask(Carbon::now());
}
return Base::retSuccess('操作成功', ['id' => $task->id]);
return Base::retSuccess('操作成功', [
'id' => $task->id,
'archived_at' => $task->archived_at,
'archived_userid' => $task->archived_userid,
]);
}
/**

View File

@ -918,7 +918,6 @@ class ProjectTask extends AbstractModel
$this->archived_userid = User::userid();
$this->archived_follow = 0;
$this->addLog("任务取消归档");
$this->pushMsg('add', ProjectTask::oneTask($this->id));
} else {
// 归档任务
if ($isAuto === true) {
@ -932,8 +931,12 @@ class ProjectTask extends AbstractModel
$this->archived_userid = $userid;
$this->archived_follow = 0;
$this->addLog($logText, [], $userid);
$this->pushMsg('archived');
}
$this->pushMsg('update', [
'id' => $this->id,
'archived_at' => $this->archived_at,
'archived_userid' => $this->archived_userid,
]);
self::whereParentId($this->id)->update([
'archived_at' => $this->archived_at,
'archived_userid' => $this->archived_userid,

View File

@ -1191,7 +1191,7 @@ export default {
task_id: task_id,
},
}).then(result => {
dispatch("forgetTask", task_id)
dispatch("saveTask", result.data)
dispatch("taskLoadEnd", task_id)
resolve(result)
}).catch(e => {
@ -2094,7 +2094,6 @@ export default {
case 'filedelete':
dispatch("forgetTaskFile", data.id)
break;
case 'archived':
case 'delete':
dispatch("forgetTask", data.id)
break;