diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs index c7fcf91d..5159bca4 100644 --- a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs +++ b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs @@ -34,9 +34,9 @@ namespace Yi.Framework.ApiMicroservice.Controllers /// [HttpGet] //暂未制作逻辑删除与多租户的过滤 - public async Task> GetMenuTree() + public async Task GetMenuTree() { - return await _iMenuService.GetMenuTreeAsync(); + return Result.Success().SetData(await _iMenuService. GetMenuTreeAsync()); } } } 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 9314907f..9c6a6b2d 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/ModelsTemplate/MenuEntity.cs b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/MenuEntity.cs index d65c6f90..062ff186 100644 --- a/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/MenuEntity.cs +++ b/Yi.Framework.Net6/Yi.Framework.Model/ModelsTemplate/MenuEntity.cs @@ -32,7 +32,7 @@ namespace Yi.Framework.Model.Models /// /// /// - [SugarColumn(ColumnName="MenuCode" )] + [SugarColumn(ColumnName= "PermissionCode")] public string PermissionCode { get; set; } /// /// diff --git a/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs b/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs index 6b281189..390cdc8e 100644 --- a/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs +++ b/Yi.Framework.Net6/Yi.Framework.Repository/IRepository.cs @@ -23,6 +23,6 @@ namespace Yi.Framework.Repository public Task UpdateIgnoreNullAsync(T entity); public Task> UseSqlAsync(string sql); public Task UseSqlAsync(string sql); - + ISugarQueryable QueryConditionHandler(QueryCondition pars); } } diff --git a/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs b/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs index 3017074f..a78f4704 100644 --- a/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs +++ b/Yi.Framework.Net6/Yi.Framework.Repository/Repository.cs @@ -134,7 +134,7 @@ namespace Yi.Framework.Repository - private ISugarQueryable QueryConditionHandler(QueryCondition pars) + public ISugarQueryable QueryConditionHandler(QueryCondition pars) { var sugarParamters = pars.Parameters.Select(it => (IConditionalModel)new ConditionalModel() { diff --git a/Yi.Framework.Net6/Yi.Framework.Service/MenuService.cs b/Yi.Framework.Net6/Yi.Framework.Service/MenuService.cs index dce836fd..e85ef7f2 100644 --- a/Yi.Framework.Net6/Yi.Framework.Service/MenuService.cs +++ b/Yi.Framework.Net6/Yi.Framework.Service/MenuService.cs @@ -13,7 +13,7 @@ namespace Yi.Framework.Service { //ParentId 0,代表为根目录,只能存在一个 //复杂查询直接使用db代理 - return await _repository._Db.Queryable().ToTreeAsync(it=>it.Children,it=>it.ParentId,0); + return await _repository._Db.Queryable().Where(u=>u.IsDeleted==false).ToTreeAsync(it=>it.Children,it=>it.ParentId,0); } } } diff --git a/Yi.Vue2.x/src/api/menuApi.js b/Yi.Vue2.x/src/api/menuApi.js index 26abc23a..3a770bf8 100644 --- a/Yi.Vue2.x/src/api/menuApi.js +++ b/Yi.Vue2.x/src/api/menuApi.js @@ -1,46 +1,33 @@ import myaxios from '@/util/myaxios' export default { - GetMenuInMould() { + getMenuTree() { return myaxios({ - url: '/Menu/GetMenuInMould', + url: '/Menu/getMenuTree', method: 'get' }) }, - addChildrenMenu(id, data) { + Update(data) { return myaxios({ - url: '/Menu/addChildrenMenu', - method: 'post', - data: { parentId: id, data } - }) - }, - UpdateMenu(data) { - return myaxios({ - url: '/Menu/UpdateMenu', + url: '/Menu/Update', method: 'put', data: data }) }, - DelListMenu(ids) { + DeleteList(ids) { return myaxios({ - url: '/Menu/DelListMenu', + url: '/Menu/DeleteList', method: 'delete', data: ids }) }, - AddTopMenu(data) { + Add(data) { return myaxios({ - url: '/Menu/AddTopMenu', + url: '/Menu/Add', method: 'post', data: data }) }, - SetMouldByMenu(menuId, mouldId) { - return myaxios({ - url: '/Menu/SetMouldByMenu', - method: 'post', - data: { id1: menuId, id2: mouldId } - }) - }, + GetTopMenusByHttpUser() { return myaxios({ url: '/Menu/GetTopMenusByHttpUser', diff --git a/Yi.Vue2.x/src/components/ccTreeview.vue b/Yi.Vue2.x/src/components/ccTreeview.vue index e90c02c2..a63bfa1d 100644 --- a/Yi.Vue2.x/src/components/ccTreeview.vue +++ b/Yi.Vue2.x/src/components/ccTreeview.vue @@ -1,14 +1,11 @@