feat: add source selection option in user search and improve code formatting
This commit is contained in:
parent
6e1fb1d4ce
commit
b5fe64d619
@ -69,6 +69,10 @@
|
||||
>
|
||||
<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.source.label')"
|
||||
value="source"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-if="search_type === 'username'"
|
||||
@ -84,6 +88,23 @@
|
||||
style="width: 220px"
|
||||
clearable
|
||||
/>
|
||||
<el-select
|
||||
v-else-if="search_type === 'source'"
|
||||
v-model="search_form.source"
|
||||
@change="getList"
|
||||
style="width: 220px"
|
||||
clearable
|
||||
:placeholder="$t('common.inputPlaceholder')"
|
||||
>
|
||||
<el-option :label="$t('views.userManage.source.local')" value="LOCAL"/>
|
||||
<el-option label="CAS" value="CAS"/>
|
||||
<el-option label="LDAP" value="LDAP"/>
|
||||
<el-option label="OIDC" value="OIDC"/>
|
||||
<el-option label="OAuth2" value="OAuth2"/>
|
||||
<el-option :label="$t('views.userManage.source.wecom')" value="wecom"/>
|
||||
<el-option :label="$t('views.userManage.source.lark')" value="lark"/>
|
||||
<el-option :label="$t('views.userManage.source.dingtalk')" value="dingtalk"/>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<app-table
|
||||
@ -317,12 +338,14 @@ const search_type = ref('username')
|
||||
const search_form = ref<{
|
||||
username: string
|
||||
nick_name?: string
|
||||
source?: string
|
||||
}>({
|
||||
username: '',
|
||||
nick_name: '',
|
||||
source: '',
|
||||
})
|
||||
const search_type_change = () => {
|
||||
search_form.value = { username: '', nick_name: '' }
|
||||
search_form.value = {username: '', nick_name: '', source: ''}
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
@ -412,7 +435,8 @@ function deleteUserManage(row: ChatUserItem) {
|
||||
getList()
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {
|
||||
})
|
||||
}
|
||||
|
||||
const UserPwdDialogRef = ref()
|
||||
@ -458,7 +482,8 @@ function handleBatchDelete() {
|
||||
await getList()
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {
|
||||
})
|
||||
}
|
||||
|
||||
const setUserGroupsRef = ref<InstanceType<typeof SetUserGroupsDialog>>()
|
||||
|
||||
@ -163,6 +163,10 @@
|
||||
:label="$t('views.userManage.userForm.nick_name.label')"
|
||||
value="nick_name"
|
||||
/>
|
||||
<el-option
|
||||
:label="$t('views.userManage.source.label')"
|
||||
value="source"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-if="searchType === 'username'"
|
||||
@ -180,6 +184,23 @@
|
||||
style="width: 220px"
|
||||
clearable
|
||||
/>
|
||||
<el-select
|
||||
v-else-if="searchType === 'source'"
|
||||
v-model="searchForm.source"
|
||||
@change="getList"
|
||||
style="width: 220px"
|
||||
clearable
|
||||
:placeholder="$t('common.inputPlaceholder')"
|
||||
>
|
||||
<el-option :label="$t('views.userManage.source.local')" value="LOCAL"/>
|
||||
<el-option label="CAS" value="CAS"/>
|
||||
<el-option label="LDAP" value="LDAP"/>
|
||||
<el-option label="OIDC" value="OIDC"/>
|
||||
<el-option label="OAuth2" value="OAuth2"/>
|
||||
<el-option :label="$t('views.userManage.source.wecom')" value="wecom"/>
|
||||
<el-option :label="$t('views.userManage.source.lark')" value="lark"/>
|
||||
<el-option :label="$t('views.userManage.source.dingtalk')" value="dingtalk"/>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -347,7 +368,8 @@ function deleteGroup(item: ListItem) {
|
||||
current.value = item.id === current.value?.id ? list.value[0] : current.value
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {
|
||||
})
|
||||
}
|
||||
|
||||
async function refresh(group?: ListItem) {
|
||||
@ -366,6 +388,7 @@ const searchType = ref('username')
|
||||
const searchForm = ref<Record<string, any>>({
|
||||
username: '',
|
||||
nick_name: '',
|
||||
source: '',
|
||||
})
|
||||
const paginationConfig = reactive({
|
||||
current_page: 1,
|
||||
@ -445,7 +468,8 @@ function handleDeleteUser(item?: ChatUserGroupUserItem) {
|
||||
await getList()
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {
|
||||
})
|
||||
}
|
||||
|
||||
const mouseId = ref('')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user