diff --git a/src/views/system/role/auth-user.vue b/src/views/system/role/auth-user.vue index 317a8bfd..86a13166 100644 --- a/src/views/system/role/auth-user.vue +++ b/src/views/system/role/auth-user.vue @@ -42,7 +42,7 @@ let queryParams = reactive({ /**角色ID */ roleId: roleId, /**是否已分配 */ - allocated: true, + auth: true, /**当前页数 */ pageNum: 1, /**每页条数 */ @@ -207,8 +207,8 @@ function fnModalOk(userIds: string[] | number[]) { message.loading({ content: t('common.loading'), key }); authUserChecked({ checked: true, - userIds: userIds.join(','), - roleId: roleId, + userIds: userIds.map(v => Number(v)), + roleId: Number(roleId), }).then(res => { if (res.code === RESULT_CODE_SUCCESS) { modalState.openBySelectUser = false; @@ -244,7 +244,8 @@ function fnRecordDelete(userId: string | number) { onOk() { const key = 'authUserChecked'; message.loading({ content: t('common.loading'), key }); - authUserChecked({ checked: false, userIds: userId, roleId: roleId }).then( + const userIds = `${userId}`.split(',').map(v => Number(v)); + authUserChecked({ checked: false, userIds, roleId: Number(roleId) }).then( res => { if (res.code === RESULT_CODE_SUCCESS) { message.success({ @@ -286,7 +287,7 @@ function fnGetList(pageNum?: number) { queryParams.pageNum = pageNum; } authUserList(toRaw(queryParams)).then(res => { - if (res.code === RESULT_CODE_SUCCESS) { + if (res.code === RESULT_CODE_SUCCESS) { // 取消勾选 if (tableState.selectedRowKeys.length > 0) { tableState.selectedRowKeys = []; @@ -294,7 +295,11 @@ function fnGetList(pageNum?: number) { const { total, rows } = res.data; tablePagination.total = total; tableState.data = rows; - if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) { + if ( + tablePagination.total <= + (queryParams.pageNum - 1) * tablePagination.pageSize && + queryParams.pageNum !== 1 + ) { tableState.loading = false; fnGetList(queryParams.pageNum - 1); } @@ -346,10 +351,7 @@ onMounted(() => { - +