From 90b39d075df63332a2a8be3c650fcf3193ef826a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 26 Apr 2022 19:21:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8F=9C=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/MenuController.cs | 4 +- .../yi-sqlsugar-dev.db | Bin 90112 -> 102400 bytes .../ModelsTemplate/MenuEntity.cs | 2 +- .../Yi.Framework.Service/MenuService.cs | 2 +- Yi.Vue2.x/src/api/menuApi.js | 12 +-- Yi.Vue2.x/src/components/ccTreeview.vue | 72 +++++++++--------- 6 files changed, 41 insertions(+), 51 deletions(-) diff --git a/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs b/Yi.Framework.Net6/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs index c7fcf91d..136eccd7 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 9314907f96aab067eecc2b714eb89f669a8927dc..dc8a76bd2837ca776b57e02d6ac984d19ab27e43 100644 GIT binary patch delta 790 zcmZoTz}m2YZGyC*4+8^(BoM=Z*hC#;VIKxP>yNBJAx8e+API5)-_r#G7!@{7%H#(L zi}5rGY!hH)bl_#)$H2w7n}KmR|8>3%6AQ$6*fLnXS>>4bvAkt@JJC^+iLqp}qCf%T z_Rs)EW+oN}1~z>lUz?4|k!P|ahsI`cu2-z`T(22;*t!|`rt$^xJm*=$EyDhX^Bm_w zjv@|6wr=*zKn>Y!^-Zqg?Bb%Lj4in(iAg!BzNvYoAS~e=Hu}f-BYDp^43rU$!r-Y>DC8Ajr5aj9W7!;}C?HZ||0rIdW zFPEme1e>_E=;Vdm5|b5Jx!5J0h1kTy4MBX(c#!Ag^K(+-jSP&83`~s7;tesyIQ7LQ zH}c6$Udk-IIf6-_kxg5KP264*WWwfa%sPy~Xk^fwtSF!w(#$K!E^cVZ*y;+76ilNq zML19+3{%1M`T$1t%{8orECRehi&*#r82E4TZ{hFb57?}z;K0vh!!lX6-iAqqdGdsM zRYs=C+khnF+W;RZcO!y%I1^~@>%0vJF delta 115 zcmZozz}9epb%L~@Hvz*v7U}e%8?9)FS34 zfo%eej1HVYNfCxn28Ph-Tmg(yT&&uxOw3Q2cQ8dvoTR>ecOWA()8+`K#k>$r0HMwn A{r~^~ 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.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..12c00e16 100644 --- a/Yi.Vue2.x/src/api/menuApi.js +++ b/Yi.Vue2.x/src/api/menuApi.js @@ -1,8 +1,8 @@ import myaxios from '@/util/myaxios' export default { - GetMenuInMould() { + getMenuTree() { return myaxios({ - url: '/Menu/GetMenuInMould', + url: '/Menu/getMenuTree', method: 'get' }) }, @@ -34,13 +34,7 @@ export default { 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..744eaa01 100644 --- a/Yi.Vue2.x/src/components/ccTreeview.vue +++ b/Yi.Vue2.x/src/components/ccTreeview.vue @@ -1,14 +1,11 @@