mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-28 04:40:37 +00:00
perf: 所有项目列表支持筛选个人项目
This commit is contained in:
parent
fb74ef4843
commit
824399bbf1
@ -44,6 +44,10 @@ class ProjectController extends AbstractController
|
||||
* @apiName lists
|
||||
*
|
||||
* @apiParam {String} [all] 是否查看所有项目(限制管理员)
|
||||
* @apiParam {String} [type] 项目类型
|
||||
* - all:全部(默认)
|
||||
* - team:团队项目
|
||||
* - personal:个人项目
|
||||
* @apiParam {String} [archived] 归档状态
|
||||
* - all:全部
|
||||
* - no:未归档(默认)
|
||||
@ -96,6 +100,7 @@ class ProjectController extends AbstractController
|
||||
$user = User::auth();
|
||||
//
|
||||
$all = Request::input('all');
|
||||
$type = Request::input('type', 'all');
|
||||
$archived = Request::input('archived', 'no');
|
||||
$getcolumn = Request::input('getcolumn', 'no');
|
||||
//
|
||||
@ -110,6 +115,12 @@ class ProjectController extends AbstractController
|
||||
$builder->with(['projectColumn']);
|
||||
}
|
||||
//
|
||||
if ($type === 'team') {
|
||||
$builder->where('projects.personal', 0);
|
||||
} elseif ($type === 'personal') {
|
||||
$builder->where('projects.personal', 1);
|
||||
}
|
||||
//
|
||||
if ($archived == 'yes') {
|
||||
$builder->whereNotNull('projects.archived_at');
|
||||
} elseif ($archived == 'no') {
|
||||
|
||||
@ -16,15 +16,27 @@
|
||||
<Input v-model="keys.name" clearable/>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="search-label">
|
||||
{{$L("项目类型")}}
|
||||
</div>
|
||||
<div class="search-content">
|
||||
<Select v-model="keys.type" :placeholder="$L('团队项目')">
|
||||
<Option value="">{{$L('团队项目')}}</Option>
|
||||
<Option value="personal">{{$L('个人项目')}}</Option>
|
||||
<Option value="all">{{$L('全部项目')}}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="search-label">
|
||||
{{$L("项目状态")}}
|
||||
</div>
|
||||
<div class="search-content">
|
||||
<Select v-model="keys.status" :placeholder="$L('全部')">
|
||||
<Option value="">{{$L('全部')}}</Option>
|
||||
<Option value="unarchived">{{$L('未归档')}}</Option>
|
||||
<Select v-model="keys.status" :placeholder="$L('未归档')">
|
||||
<Option value="">{{$L('未归档')}}</Option>
|
||||
<Option value="archived">{{$L('已归档')}}</Option>
|
||||
<Option value="all">{{$L('全部')}}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
</li>
|
||||
@ -192,11 +204,17 @@ export default {
|
||||
},
|
||||
|
||||
getLists() {
|
||||
let archived = 'all';
|
||||
if (this.keys.status == 'archived') {
|
||||
let type = 'team';
|
||||
if (this.keys.type == 'all') {
|
||||
type = 'all';
|
||||
} else if (this.keys.type == 'personal') {
|
||||
type = 'personal';
|
||||
}
|
||||
let archived = 'no';
|
||||
if (this.keys.status == 'all') {
|
||||
archived = 'all';
|
||||
} else if (this.keys.status == 'archived') {
|
||||
archived = 'yes';
|
||||
} else if (this.keys.status == 'unarchived') {
|
||||
archived = 'no';
|
||||
}
|
||||
this.loadIng++;
|
||||
this.keyIs = $A.objImplode(this.keys) != "";
|
||||
@ -206,6 +224,7 @@ export default {
|
||||
keys: this.keys,
|
||||
all: 1,
|
||||
archived,
|
||||
type,
|
||||
page: Math.max(this.page, 1),
|
||||
pagesize: Math.max($A.runNum(this.pageSize), 10),
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user