This commit is contained in:
@@ -594,12 +594,12 @@
|
||||
})
|
||||
|
||||
// 加载所有角色列表
|
||||
const loadAllRoles = async (keyword: string = '') => {
|
||||
const loadAllRoles = async (keyword: string = '', roleType?: number) => {
|
||||
try {
|
||||
const params: any = {
|
||||
page: 1,
|
||||
page_size: keyword ? 100 : 20, // 搜索时加载更多,默认20条
|
||||
role_type: 1
|
||||
page_size: keyword ? 50 : 20, // 搜索时加载更多,默认20条
|
||||
role_type: roleType !== undefined ? roleType : 1 // 默认为平台角色
|
||||
}
|
||||
if (keyword) {
|
||||
params.role_name = keyword
|
||||
@@ -634,7 +634,9 @@
|
||||
}
|
||||
// 设置新的定时器,500ms 后执行搜索
|
||||
roleSearchTimer = setTimeout(async () => {
|
||||
await loadAllRoles(keyword)
|
||||
// 根据当前账号类型决定加载哪种角色
|
||||
const roleType = currentAccountType.value === 2 ? 1 : 2 // 平台用户(2)加载平台角色(1),其他加载客户角色(2)
|
||||
await loadAllRoles(keyword, roleType)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
@@ -662,8 +664,11 @@
|
||||
rightRoleFilter.value = ''
|
||||
|
||||
try {
|
||||
// 每次打开对话框时重新加载最新的角色列表
|
||||
await loadAllRoles()
|
||||
// 根据账号类型加载对应的角色列表
|
||||
// 平台用户(user_type=2) -> 平台角色(role_type=1)
|
||||
// 企业账号/代理账号(user_type=3,4) -> 客户角色(role_type=2)
|
||||
const roleType = row.user_type === 2 ? 1 : 2
|
||||
await loadAllRoles('', roleType)
|
||||
|
||||
// 先加载当前账号的角色,再打开对话框
|
||||
const res = await AccountService.getAccountRoles(row.id)
|
||||
|
||||
@@ -614,12 +614,12 @@
|
||||
}
|
||||
|
||||
// 加载所有角色列表
|
||||
const loadAllRoles = async (keyword: string = '') => {
|
||||
const loadAllRoles = async (keyword: string = '', roleType?: number) => {
|
||||
try {
|
||||
const params: any = {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
role_type: 2
|
||||
page_size: keyword ? 50 : 20, // 搜索时加载更多,默认20条
|
||||
role_type: roleType !== undefined ? roleType : 2 // 默认为客户角色
|
||||
}
|
||||
if (keyword) {
|
||||
params.role_name = keyword
|
||||
@@ -640,7 +640,9 @@
|
||||
clearTimeout(leftSearchTimer)
|
||||
}
|
||||
leftSearchTimer = setTimeout(() => {
|
||||
loadAllRoles(val)
|
||||
// 根据当前账号类型决定加载哪种角色
|
||||
const roleType = currentAccountType.value === 2 ? 1 : 2 // 平台用户(2)加载平台角色(1),其他加载客户角色(2)
|
||||
loadAllRoles(val, roleType)
|
||||
}, 300)
|
||||
}
|
||||
|
||||
@@ -669,8 +671,11 @@
|
||||
rightRoleFilter.value = ''
|
||||
|
||||
try {
|
||||
// 每次打开对话框时重新加载最新的角色列表
|
||||
await loadAllRoles()
|
||||
// 根据账号类型加载对应的角色列表
|
||||
// 平台用户(user_type=2) -> 平台角色(role_type=1)
|
||||
// 企业账号/代理账号(user_type=3,4) -> 客户角色(role_type=2)
|
||||
const roleType = row.user_type === 2 ? 1 : 2
|
||||
await loadAllRoles('', roleType)
|
||||
|
||||
// 先加载当前账号的角色,再打开对话框
|
||||
const res = await AccountService.getAccountRoles((row as any).id)
|
||||
|
||||
Reference in New Issue
Block a user