From 6d87d8e9cdbef65bef1753ac8e5fe5e3a5d85849 Mon Sep 17 00:00:00 2001 From: nsnail Date: Fri, 22 Nov 2024 12:11:10 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=94=A8=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E8=A7=92=E8=89=B2=E6=8E=92=E5=BA=8F=20(#212?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip ci] Co-authored-by: tk --- .../Services/Sys/UserService.cs | 4 ++- .../admin/src/views/sys/user/index.vue | 30 +++++++++---------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs b/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs index 9206aa5b..f995f012 100644 --- a/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs +++ b/src/backend/NetAdmin/NetAdmin.SysComponent.Application/Services/Sys/UserService.cs @@ -240,7 +240,9 @@ public sealed class UserService( .Count(out var total) .ToListAsync(listUserExp) .ConfigureAwait(false); - return new PagedQueryRsp(req.Page, req.PageSize, total, list.Adapt>()); + return new PagedQueryRsp(req.Page, req.PageSize, total + , list.Select(x => x with { Roles = x.Roles.OrderBy(y => y.Sort).ThenBy(y => y.Id).ToList() }) + .Adapt>()); } /// diff --git a/src/frontend/admin/src/views/sys/user/index.vue b/src/frontend/admin/src/views/sys/user/index.vue index c3e3f181..3bfe006a 100644 --- a/src/frontend/admin/src/views/sys/user/index.vue +++ b/src/frontend/admin/src/views/sys/user/index.vue @@ -36,14 +36,6 @@ placeholder: $t('用户编号 / 用户名 / 手机号 / 邮箱 / 备注'), style: 'width:25rem', }, - { - type: 'remote-select', - field: ['filter', 'roleId'], - api: $API.sys_role.query, - config: { props: { label: 'name', value: 'id' } }, - placeholder: $t('所属角色'), - style: 'width:15rem', - }, { type: 'cascader', field: ['filter', 'deptId'], @@ -52,6 +44,14 @@ placeholder: $t('所属部门'), style: 'width:15rem', }, + { + type: 'remote-select', + field: ['filter', 'roleId'], + api: $API.sys_role.query, + config: { props: { label: 'name', value: 'id' } }, + placeholder: $t('所属角色'), + style: 'width:15rem', + }, ]" :vue="this" @reset="onReset" @@ -103,18 +103,18 @@ - - + + width="120" /> +