feat: add 'is_active' search option in user management and update search form structure
This commit is contained in:
parent
7dba06ed82
commit
eac7a6bbb0
@ -69,6 +69,7 @@
|
|||||||
>
|
>
|
||||||
<el-option :label="$t('views.login.loginForm.username.label')" value="username"/>
|
<el-option :label="$t('views.login.loginForm.username.label')" value="username"/>
|
||||||
<el-option :label="$t('views.userManage.userForm.nick_name.label')" value="nick_name"/>
|
<el-option :label="$t('views.userManage.userForm.nick_name.label')" value="nick_name"/>
|
||||||
|
<el-option :label="$t('common.status.label')" value="is_active"/>
|
||||||
<el-option
|
<el-option
|
||||||
:label="$t('views.userManage.source.label')"
|
:label="$t('views.userManage.source.label')"
|
||||||
value="source"
|
value="source"
|
||||||
@ -88,6 +89,15 @@
|
|||||||
style="width: 220px"
|
style="width: 220px"
|
||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
|
<el-select
|
||||||
|
v-else-if="search_type === 'is_active'"
|
||||||
|
v-model="search_form.is_active"
|
||||||
|
@change="getList"
|
||||||
|
style="width: 220px"
|
||||||
|
>
|
||||||
|
<el-option :label="$t('common.status.enabled')" :value="true"/>
|
||||||
|
<el-option :label="$t('common.status.disabled')" :value="false"/>
|
||||||
|
</el-select>
|
||||||
<el-select
|
<el-select
|
||||||
v-else-if="search_type === 'source'"
|
v-else-if="search_type === 'source'"
|
||||||
v-model="search_form.source"
|
v-model="search_form.source"
|
||||||
@ -339,13 +349,15 @@ const search_form = ref<{
|
|||||||
username: string
|
username: string
|
||||||
nick_name?: string
|
nick_name?: string
|
||||||
source?: string
|
source?: string
|
||||||
|
is_active?: boolean | null
|
||||||
}>({
|
}>({
|
||||||
username: '',
|
username: '',
|
||||||
nick_name: '',
|
nick_name: '',
|
||||||
source: '',
|
source: '',
|
||||||
|
is_active: null,
|
||||||
})
|
})
|
||||||
const search_type_change = () => {
|
const search_type_change = () => {
|
||||||
search_form.value = {username: '', nick_name: '', source: ''}
|
search_form.value = {username: '', nick_name: '', source: '', is_active: null}
|
||||||
}
|
}
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
@ -366,9 +378,9 @@ const userTableData = ref<ChatUserItem[]>([])
|
|||||||
|
|
||||||
function getList() {
|
function getList() {
|
||||||
const params: any = {}
|
const params: any = {}
|
||||||
if (search_form.value[search_type.value as keyof typeof search_form.value]) {
|
const searchValue = search_form.value[search_type.value as keyof typeof search_form.value]
|
||||||
params[search_type.value] =
|
if (searchValue !== undefined && searchValue !== null && searchValue !== '') {
|
||||||
search_form.value[search_type.value as keyof typeof search_form.value]
|
params[search_type.value] = searchValue
|
||||||
}
|
}
|
||||||
return loadPermissionApi('chatUser')
|
return loadPermissionApi('chatUser')
|
||||||
.getUserManage(paginationConfig, params, loading)
|
.getUserManage(paginationConfig, params, loading)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user