支持查看归档任务

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') { } elseif ($type == 'add') {
$task->archivedTask(Carbon::now()); $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_userid = User::userid();
$this->archived_follow = 0; $this->archived_follow = 0;
$this->addLog("任务取消归档"); $this->addLog("任务取消归档");
$this->pushMsg('add', ProjectTask::oneTask($this->id));
} else { } else {
// 归档任务 // 归档任务
if ($isAuto === true) { if ($isAuto === true) {
@ -932,8 +931,12 @@ class ProjectTask extends AbstractModel
$this->archived_userid = $userid; $this->archived_userid = $userid;
$this->archived_follow = 0; $this->archived_follow = 0;
$this->addLog($logText, [], $userid); $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([ self::whereParentId($this->id)->update([
'archived_at' => $this->archived_at, 'archived_at' => $this->archived_at,
'archived_userid' => $this->archived_userid, 'archived_userid' => $this->archived_userid,

View File

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