功能更新:新增Bug管理模块,完善用户角色分配,优化项目设置
This commit is contained in:
@@ -125,7 +125,7 @@
|
||||
|
||||
<script>
|
||||
import PageSection from '@/components/TestPlatform/common/PageSection'
|
||||
import { assignUserRoles, createUser, deleteUser, getRoleList, getUserList, getUserRoleList, updateUser } from '@/api/rbacApi'
|
||||
import { assignUserRoles, createUser, deleteUser, getRolePageList, getUserList, getUserRoleList, updateUser } from '@/api/rbacApi'
|
||||
|
||||
const getDefaultForm = () => ({
|
||||
userId: undefined,
|
||||
@@ -191,11 +191,11 @@ export default {
|
||||
})
|
||||
},
|
||||
fetchRoleOptions() {
|
||||
return getRoleList({ pageNo: 1, pageSize: 9999 }).then(res => {
|
||||
return getRolePageList({ pageNo: 1, pageSize: 9999 }).then(res => {
|
||||
const data = res && res.data ? res.data : res || {}
|
||||
const list = data.items || data.list || data.data || []
|
||||
const list = data.list || data.items || data.data || []
|
||||
this.roleOptions = list.map(item => ({
|
||||
id: item.id || item.roleId,
|
||||
id: item.id,
|
||||
name: item.name
|
||||
}))
|
||||
}).catch(() => {
|
||||
@@ -255,9 +255,11 @@ export default {
|
||||
this.assignUserId = row.userId || row.id
|
||||
this.assignUserName = row.username
|
||||
this.assignDialogVisible = true
|
||||
Promise.all([this.fetchRoleOptions(), getUserRoleList(this.assignUserId)]).then(([, res]) => {
|
||||
this.fetchRoleOptions()
|
||||
getUserRoleList(this.assignUserId).then(res => {
|
||||
const data = res && res.data ? res.data : res || {}
|
||||
this.selectedRoleIds = data.roleIds || data.role_ids || []
|
||||
const roleIds = data.roleIds || data.role_ids || []
|
||||
this.selectedRoleIds = roleIds.map(id => Number(id))
|
||||
}).catch(() => {
|
||||
this.selectedRoleIds = []
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user