diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs index b9cf8ffb..52e69fb6 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Program.cs @@ -135,7 +135,7 @@ ServiceLocator.Instance = app.Services; #region //错误抓取反馈注入 #endregion -app.UseErrorHandlingService(); +//app.UseErrorHandlingService(); #region //静态文件注入 #endregion diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db index 3004486f..5c8c1e1d 100644 Binary files a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db and b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/yi-sqlsugar-dev.db differ diff --git a/Yi.Framework.Net6/Yi.Framework.Model/UserEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/UserEntity.cs index ebdb3f40..470fdd20 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/UserEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/UserEntity.cs @@ -14,6 +14,11 @@ namespace Yi.Framework.Model.Models [Navigate(typeof(UserRoleEntity), nameof(UserRoleEntity.UserId), nameof(UserRoleEntity.RoleId))] public List Roles { get; set; } + [Navigate(typeof(UserPostEntity), nameof(UserPostEntity.UserId), nameof(UserPostEntity.PostId))] + public List Posts { get; set; } + + [Navigate( NavigateType.OneToOne,nameof(DeptId))] + public DeptEntity Dept { get; set; } /// /// 鏋勫缓瀵嗙爜锛孧D5鐩愬煎姞瀵 diff --git a/Yi.Framework.Net6/Yi.Framework.Service/UserService.cs b/Yi.Framework.Net6/Yi.Framework.Service/UserService.cs index c5ad788c..c8aaf644 100644 --- a/Yi.Framework.Net6/Yi.Framework.Service/UserService.cs +++ b/Yi.Framework.Net6/Yi.Framework.Service/UserService.cs @@ -131,7 +131,7 @@ namespace Yi.Framework.Service public async Task GetInfoById(long userId) { - return await _repository._DbQueryable.Includes(u => u.Roles).InSingleAsync(userId); + return await _repository._DbQueryable.Includes(u => u.Roles).Includes(u=>u.Posts).Includes(u=>u.Dept).InSingleAsync(userId); } public async Task GetUserAllInfo(long userId) @@ -194,6 +194,8 @@ namespace Yi.Framework.Service .WhereIF(page.StartTime.IsNotNull() && page.EndTime.IsNotNull(), u => u.CreateTime >= page.StartTime && u.CreateTime <= page.EndTime) .WhereIF(user.IsDeleted.IsNotNull(),u => u.IsDeleted == user.IsDeleted) .Includes(u => u.Roles) + .Includes(u=>u.Posts) + .Includes(u=>u.Dept) .OrderBy(u => u.OrderNum, OrderByType.Desc) .ToPageListAsync(page.PageNum, page.PageSize, total); diff --git a/Yi.Vue3.X.RuoYi/src/views/system/user/index.vue b/Yi.Vue3.X.RuoYi/src/views/system/user/index.vue index 9a08f1d6..2c61a5d6 100644 --- a/Yi.Vue3.X.RuoYi/src/views/system/user/index.vue +++ b/Yi.Vue3.X.RuoYi/src/views/system/user/index.vue @@ -71,7 +71,7 @@ :show-overflow-tooltip="true" /> - @@ -504,14 +504,25 @@ function handleUpdate(row) { reset(); const userId = row.id || ids.value; getUser(userId).then(response => { + + form.value.user = response.data; - form.value.postIds = []; - response.data.roles.forEach(role => { - form.value.roleIds.push(role.id) - }); - open.value = true; - title.value = "淇敼鐢ㄦ埛"; - form.value.user.password = null; + +response.data.posts.forEach(post => { + form.value.postIds.push(post.id) +}); + +form.value.deptId= response.data.deptId; + +response.data.roles.forEach(role => { + form.value.roleIds.push(role.id) +}); +open.value = true; +title.value = "淇敼鐢ㄦ埛"; +form.value.user.password = null; + + + }); }; /** 鎻愪氦鎸夐挳 */