fix: 角色分配给用户列表属性错误

This commit is contained in:
TsMask
2025-03-13 16:54:21 +08:00
parent 0e238be98a
commit 3fcf79fe13
2 changed files with 13 additions and 11 deletions

View File

@@ -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({
@@ -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(() => {
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item
:label="t('views.system.role.phone')"
name="phone"
>
<a-form-item :label="t('views.system.role.phone')" name="phone">
<a-input
v-model:value="queryParams.phone"
allow-clear

View File

@@ -46,7 +46,7 @@ let queryParams = reactive({
/**角色ID */
roleId: props.roleId,
/**是否已分配 */
allocated: false,
auth: false,
/**当前页数 */
pageNum: 1,
/**每页条数 */