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 9314907f..dc8a76bd 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.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 @@
-
展开全部
-
添加新项
-
+ 展开全部
+ 添加新项
+
删除所选
-
-
-
@@ -53,15 +50,16 @@
return-object
open-all
hoverable
- item-text="menu_name"
+ item-text="menuName"
>
编号:{{ item.id }}
- 图标:{{ item.icon }}
- 路由:{{ item.router }}
- 接口名:{{ item.mould.mould_name }}
- 接口地址:{{ item.mould.url }}
- 权限:{{ item.permissionCode }}
+
+
+
+
+ 添加子菜单
编辑
-
- 删除
-
+
+ 删除
@@ -108,7 +107,7 @@ export default {
icon: "mdi-start",
router: "test",
menu_name: "测试",
- is_show:1
+ is_show: 1,
},
}),
computed: {
@@ -120,20 +119,20 @@ export default {
this.init();
},
methods: {
-showAll(){
- this.$refs.tree.updateAll(true);
-},
-
- setMould(item) {
- menuApi.SetMouldByMenu(item.id, this.mouldSelect[0].id).then((resp) => {
- this.$dialog.notify.info(resp.msg, {
- position: "top-right",
- timeout: 5000,
- });
- this.init();
- });
+ showAll() {
+ this.$refs.tree.updateAll(true);
},
+ // setMould(item) {
+ // menuApi.SetMouldByMenu(item.id, this.mouldSelect[0].id).then((resp) => {
+ // this.$dialog.notify.info(resp.msg, {
+ // position: "top-right",
+ // timeout: 5000,
+ // });
+ // this.init();
+ // });
+ // },
+
getSelect(data) {
this.mouldSelect = data;
},
@@ -173,20 +172,17 @@ showAll(){
},
init() {
this.parentId = 0;
- mouldApi.getMould().then((resp) => {
- this.mouldList = resp.data;
- });
+ // mouldApi.getMould().then((resp) => {
+ // this.mouldList = resp.data;
+ // });
- menuApi.GetMenuInMould().then((resp) => {
- this.desserts =[ resp.data];
+ menuApi.getMenuTree().then((resp) => {
+ this.desserts = resp.data;
});
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
-
-
-
},
editItem(item) {
this.editedIndex = item.id;