perf: 归档任务列表显示完成时间
This commit is contained in:
parent
7d8856e4bc
commit
c930e4dd92
@ -866,6 +866,10 @@ class ProjectController extends AbstractController
|
||||
* @apiParam {String} [archived] 归档状态
|
||||
* - yes:已归档
|
||||
* - no:未归档(默认)
|
||||
* @apiParam {Object} sorts 排序方式
|
||||
* - sorts.complete_at 完成时间:asc|desc
|
||||
* - sorts.archived_at 归档时间:asc|desc
|
||||
* - sorts.end_at 到期时间:asc|desc
|
||||
*
|
||||
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
|
||||
* @apiSuccess {String} msg 返回信息(错误描述)
|
||||
@ -884,6 +888,8 @@ class ProjectController extends AbstractController
|
||||
$time_before = Request::input('time_before');
|
||||
$complete = Request::input('complete', 'all');
|
||||
$archived = Request::input('archived', 'no');
|
||||
$sorts = Request::input('sorts');
|
||||
$sorts = is_array($sorts) ? $sorts : [];
|
||||
//
|
||||
if ($parent_id > 0) {
|
||||
ProjectTask::userTask($parent_id);
|
||||
@ -921,6 +927,12 @@ class ProjectController extends AbstractController
|
||||
$builder->whereNull('project_tasks.archived_at');
|
||||
}
|
||||
//
|
||||
foreach ($sorts as $column => $direction) {
|
||||
if (!in_array($column, ['complete_at', 'archived_at', 'end_at'])) continue;
|
||||
if (!in_array($direction, ['asc', 'desc'])) continue;
|
||||
$builder->orderBy('project_tasks.' . $column, $direction);
|
||||
}
|
||||
//
|
||||
$list = $builder->orderByDesc('project_tasks.id')->paginate(Base::getPaginate(200, 100));
|
||||
//
|
||||
return Base::retSuccess('success', $list);
|
||||
|
@ -444,7 +444,7 @@
|
||||
<DrawerOverlay
|
||||
v-model="archivedTaskShow"
|
||||
placement="right"
|
||||
:size="768">
|
||||
:size="900">
|
||||
<TaskArchived v-if="archivedTaskShow" :project-id="projectId"/>
|
||||
</DrawerOverlay>
|
||||
</div>
|
||||
|
@ -64,6 +64,11 @@ export default {
|
||||
return h('AutoTip', row.name);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$L('完成时间'),
|
||||
key: 'complete_at',
|
||||
width: 168,
|
||||
},
|
||||
{
|
||||
title: this.$L('归档时间'),
|
||||
key: 'archived_at',
|
||||
@ -130,6 +135,9 @@ export default {
|
||||
data: {
|
||||
project_id: this.projectId,
|
||||
archived: 'yes',
|
||||
sorts: {
|
||||
archived_at: 'desc'
|
||||
},
|
||||
page: Math.max(this.page, 1),
|
||||
pagesize: Math.max($A.runNum(this.pageSize), 20),
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user