From 3fcf79fe133296debf3c4a2b6bae51dc5ab505ed Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 13 Mar 2025 16:54:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=92=E8=89=B2=E5=88=86=E9=85=8D?= =?UTF-8?q?=E7=BB=99=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/role/auth-user.vue | 22 ++++++++++--------- .../role/components/auth-user-select.vue | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) 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(() => { - +