Skip to content

Commit eac7a6b

Browse files
committed
feat: add 'is_active' search option in user management and update search form structure
1 parent 7dba06e commit eac7a6b

File tree

1 file changed

+16
-4
lines changed
  • ui/src/views/system-chat-user/chat-user

1 file changed

+16
-4
lines changed

ui/src/views/system-chat-user/chat-user/index.vue

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
>
7070
<el-option :label="$t('views.login.loginForm.username.label')" value="username"/>
7171
<el-option :label="$t('views.userManage.userForm.nick_name.label')" value="nick_name"/>
72+
<el-option :label="$t('common.status.label')" value="is_active"/>
7273
<el-option
7374
:label="$t('views.userManage.source.label')"
7475
value="source"
@@ -88,6 +89,15 @@
8889
style="width: 220px"
8990
clearable
9091
/>
92+
<el-select
93+
v-else-if="search_type === 'is_active'"
94+
v-model="search_form.is_active"
95+
@change="getList"
96+
style="width: 220px"
97+
>
98+
<el-option :label="$t('common.status.enabled')" :value="true"/>
99+
<el-option :label="$t('common.status.disabled')" :value="false"/>
100+
</el-select>
91101
<el-select
92102
v-else-if="search_type === 'source'"
93103
v-model="search_form.source"
@@ -339,13 +349,15 @@ const search_form = ref<{
339349
username: string
340350
nick_name?: string
341351
source?: string
352+
is_active?: boolean | null
342353
}>({
343354
username: '',
344355
nick_name: '',
345356
source: '',
357+
is_active: null,
346358
})
347359
const search_type_change = () => {
348-
search_form.value = {username: '', nick_name: '', source: ''}
360+
search_form.value = {username: '', nick_name: '', source: '', is_active: null}
349361
}
350362
351363
const loading = ref(false)
@@ -366,9 +378,9 @@ const userTableData = ref<ChatUserItem[]>([])
366378
367379
function getList() {
368380
const params: any = {}
369-
if (search_form.value[search_type.value as keyof typeof search_form.value]) {
370-
params[search_type.value] =
371-
search_form.value[search_type.value as keyof typeof search_form.value]
381+
const searchValue = search_form.value[search_type.value as keyof typeof search_form.value]
382+
if (searchValue !== undefined && searchValue !== null && searchValue !== '') {
383+
params[search_type.value] = searchValue
372384
}
373385
return loadPermissionApi('chatUser')
374386
.getUserManage(paginationConfig, params, loading)

0 commit comments

Comments
 (0)