perf: 导出数据支持搜索离职会员

This commit is contained in:
kuaifan 2023-04-10 10:48:45 +08:00
parent 06795ca32c
commit 1cf5a24c26
5 changed files with 22 additions and 5 deletions

View File

@ -450,7 +450,7 @@ class UsersController extends AbstractController
*
* @apiParam {Object} keys 搜索条件
* - keys.key 昵称、拼音、邮箱关键字
* - keys.disable 0-排除禁止默认1-仅禁止2-含禁止
* - keys.disable 0-排除离职默认1-仅离职2-含离职
* - keys.bot 0-排除机器人默认1-仅机器人2-含机器人
* - keys.project_id 在指定项目ID
* - keys.no_project_id 不在指定项目ID
@ -527,7 +527,12 @@ class UsersController extends AbstractController
if (in_array($sorts['az'], ['asc', 'desc'])) {
$builder->orderBy('az', $sorts['az']);
} else {
$builder->orderBy('bot');
if (intval($keys['disable']) == 2) {
$builder->orderBy('disable_at');
}
if (intval($keys['bot']) == 2) {
$builder->orderBy('bot');
}
}
//
if (Request::exists('page')) {

View File

@ -37,6 +37,7 @@
<div class="user-input-option">
<div class="user-input-avatar"><EAvatar class="avatar" :src="item.userimg"/></div>
<div v-if="item.bot" class="taskfont user-input-bot">&#xe68c;</div>
<div v-if="item.disable_at" class="user-input-disable">[{{$L('离职')}}]</div>
<div class="user-input-nickname">{{ item.nickname }}</div>
<div class="user-input-userid">ID: {{ item.userid }}</div>
</div>
@ -105,6 +106,10 @@
type: Boolean,
default: false
},
showDisable: {
type: Boolean,
default: false
},
},
data() {
return {
@ -190,7 +195,8 @@
project_id: this.projectId,
no_project_id: this.noProjectId,
dialog_id: this.dialogId,
bot: this.showBot ? 2 : 0,
bot: this.showBot && key ? 2 : 0,
disable: this.showDisable && key ? 2 : 0,
},
take: 50
},

View File

@ -5,7 +5,7 @@
:mask-closable="false">
<Form ref="export" :model="formData" label-width="auto" @submit.native.prevent>
<FormItem :label="$L('导出成员')">
<UserInput v-model="formData.userid" :multiple-max="100" :placeholder="$L('请选择成员')"/>
<UserInput v-model="formData.userid" :multiple-max="100" show-disable :placeholder="$L('请选择成员')"/>
<div class="form-tip">{{$L('每次最多选择导出100个成员')}}</div>
</FormItem>
<FormItem :label="$L('签到日期')">

View File

@ -5,7 +5,7 @@
:mask-closable="false">
<Form ref="exportTask" :model="formData" label-width="auto" @submit.native.prevent>
<FormItem :label="$L('导出成员')">
<UserInput v-model="formData.userid" :multiple-max="100" :placeholder="$L('请选择成员')"/>
<UserInput v-model="formData.userid" :multiple-max="100" show-disable :placeholder="$L('请选择成员')"/>
<div class="form-tip">{{$L('每次最多选择导出100个成员')}}</div>
</FormItem>
<FormItem :label="$L('时间范围')">

View File

@ -41,6 +41,12 @@
margin-right: -6px;
color: $primary-color;
}
.user-input-disable {
font-size: 12px;
margin-left: 10px;
margin-right: -6px;
color: #ff0000;
}
.user-input-nickname {
margin-left: 10px;
flex: 1;