|
|
@@ -27,7 +27,11 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.System
|
|
27
|
27
|
[HttpGet("getlist")]
|
|
28
|
28
|
public async Task<IActionResult> GetListAsync(int menuid = 0)
|
|
29
|
29
|
{
|
|
30
|
|
- var list_ModuleInfoButton = await _sys_modulebuttoninfoRepository.GetListALL(b => b.F_State == (int)EnumDelState.Enabled && b.F_MenuId == menuid, o => o.F_Sort, SqlSugar.OrderByType.Asc);
|
|
|
30
|
+ var list_ModuleInfoButton= new List<T_Sys_ModuleButtonInfo>();
|
|
|
31
|
+ if (menuid>0)
|
|
|
32
|
+ list_ModuleInfoButton = await _sys_modulebuttoninfoRepository.GetListALL(b => b.F_State == (int)EnumDelState.Enabled && b.F_MenuId == menuid, o => o.F_Sort, SqlSugar.OrderByType.Asc);
|
|
|
33
|
+ else
|
|
|
34
|
+ list_ModuleInfoButton = await _sys_modulebuttoninfoRepository.GetListALL(b => b.F_State == (int)EnumDelState.Enabled, o => o.F_Sort, SqlSugar.OrderByType.Asc);
|
|
31
|
35
|
|
|
32
|
36
|
List<ModuleInfoButtonDto> list_ModuleInfoButtonDto = new List<ModuleInfoButtonDto>();
|
|
33
|
37
|
|
|
|
@@ -48,7 +52,36 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.System
|
|
48
|
52
|
list_ModuleInfoButtonDto.Add(_dto);
|
|
49
|
53
|
}
|
|
50
|
54
|
|
|
51
|
|
- return Success("获取按钮", list_ModuleInfoButton);
|
|
|
55
|
+ return Success("获取按钮", list_ModuleInfoButtonDto);
|
|
|
56
|
+ }
|
|
|
57
|
+
|
|
|
58
|
+ /// <summary>
|
|
|
59
|
+ /// 通过菜单的moduleId获取对应菜单下的所有按钮信息 V6.0全盘优化
|
|
|
60
|
+ /// </summary>
|
|
|
61
|
+ /// <param name="moduleId"></param>
|
|
|
62
|
+ /// <returns></returns>
|
|
|
63
|
+ [HttpGet("gettreegridjson")]
|
|
|
64
|
+ public async Task<ActionResult> GetTreeGridJsonAsync(int moduleId = 0)
|
|
|
65
|
+ {
|
|
|
66
|
+ var list_ModuleInfoButton = new List<T_Sys_ModuleButtonInfo>();
|
|
|
67
|
+ if (moduleId > 0)
|
|
|
68
|
+ list_ModuleInfoButton = await _sys_modulebuttoninfoRepository.GetListALL(b => b.F_State == (int)EnumDelState.Enabled && b.F_MenuId == moduleId, o => o.F_Sort, SqlSugar.OrderByType.Asc);
|
|
|
69
|
+ else
|
|
|
70
|
+ list_ModuleInfoButton = await _sys_modulebuttoninfoRepository.GetListALL(b => b.F_State == (int)EnumDelState.Enabled, o => o.F_Sort, SqlSugar.OrderByType.Asc);
|
|
|
71
|
+
|
|
|
72
|
+ var treeList = new List<TreeGridModel>();
|
|
|
73
|
+
|
|
|
74
|
+ foreach (var item in list_ModuleInfoButton)
|
|
|
75
|
+ {
|
|
|
76
|
+ TreeGridModel treeModel = new TreeGridModel();
|
|
|
77
|
+ treeModel.id = item.F_Id.ToString();
|
|
|
78
|
+ treeModel.isLeaf = false;
|
|
|
79
|
+ treeModel.parentId = "0";
|
|
|
80
|
+ treeModel.expanded = false;
|
|
|
81
|
+ treeModel.entityJson = item.ToJson();
|
|
|
82
|
+ treeList.Add(treeModel);
|
|
|
83
|
+ }
|
|
|
84
|
+ return Content(treeList.TreeGridJson());
|
|
52
|
85
|
}
|
|
53
|
86
|
|
|
54
|
87
|
/// <summary>
|
|
|
@@ -93,7 +126,7 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.System
|
|
93
|
126
|
[HttpPost("addmodule")]
|
|
94
|
127
|
public async Task<IActionResult> AddModule(ModuleInfoButtonDto input)
|
|
95
|
128
|
{
|
|
96
|
|
- if (input.moduleid>0)
|
|
|
129
|
+ if (input.moduleid<=0)
|
|
97
|
130
|
return Error("参数错误");
|
|
98
|
131
|
if (string.IsNullOrEmpty(input.name))
|
|
99
|
132
|
return Error("请输入按钮名称");
|