Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
3cc48927
Commit
3cc48927
authored
Nov 20, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
c6b872e9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
79 deletions
+18
-79
RB_Role.cs
Edu.Model/Entity/System/RB_Role.cs
+0
-5
MenuTree_ViewModel.cs
Edu.Model/ViewModel/System/MenuTree_ViewModel.cs
+5
-0
RB_Role_ViewModel.cs
Edu.Model/ViewModel/System/RB_Role_ViewModel.cs
+0
-11
MenuModule.cs
Edu.Module.System/MenuModule.cs
+6
-2
RoleModule.cs
Edu.Module.System/RoleModule.cs
+3
-53
RB_Menu_FunctionRepository.cs
Edu.Repository/System/RB_Menu_FunctionRepository.cs
+1
-1
PublicController.cs
Edu.WebApi/Controllers/Public/PublicController.cs
+3
-7
No files found.
Edu.Model/Entity/System/RB_Role.cs
View file @
3cc48927
...
@@ -26,11 +26,6 @@ namespace Edu.Model.Entity.System
...
@@ -26,11 +26,6 @@ namespace Edu.Model.Entity.System
/// </summary>
/// </summary>
public
string
RoleIntro
{
get
;
set
;
}
public
string
RoleIntro
{
get
;
set
;
}
/// <summary>
/// 角色权限
/// </summary>
public
string
RoleAuth
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 状态(0-正常,1-删除)
/// 状态(0-正常,1-删除)
/// </summary>
/// </summary>
...
...
Edu.Model/ViewModel/System/MenuTree_ViewModel.cs
View file @
3cc48927
...
@@ -41,5 +41,10 @@ namespace Edu.Model.ViewModel.System
...
@@ -41,5 +41,10 @@ namespace Edu.Model.ViewModel.System
/// 子菜单列表
/// 子菜单列表
/// </summary>
/// </summary>
public
List
<
MenuTree_ViewModel
>
SubList
{
get
;
set
;
}
public
List
<
MenuTree_ViewModel
>
SubList
{
get
;
set
;
}
/// <summary>
/// 功能权限列表
/// </summary>
public
List
<
RB_Role_FunctionPermission_ViewModel
>
FunctionSubList
{
get
;
set
;
}
}
}
}
}
Edu.Model/ViewModel/System/RB_Role_ViewModel.cs
View file @
3cc48927
...
@@ -22,16 +22,5 @@ namespace Edu.Model.ViewModel.System
...
@@ -22,16 +22,5 @@ namespace Edu.Model.ViewModel.System
return
Common
.
ConvertHelper
.
FormatTime
(
this
.
CreateDate
);
return
Common
.
ConvertHelper
.
FormatTime
(
this
.
CreateDate
);
}
}
}
}
/// <summary>
/// 选中的菜单列表
/// </summary>
public
List
<
int
>
CheckMenuList
{
get
{
return
Common
.
ConvertHelper
.
StringToList
(
this
.
RoleAuth
);
}
}
}
}
}
}
Edu.Module.System/MenuModule.cs
View file @
3cc48927
...
@@ -107,11 +107,15 @@ namespace Edu.Module.System
...
@@ -107,11 +107,15 @@ namespace Edu.Module.System
/// </summary>
/// </summary>
/// <param name="query"></param>
/// <param name="query"></param>
/// <returns></returns>
/// <returns></returns>
public
List
<
MenuTree_ViewModel
>
GetTreeMenuModule
(
RB_Menu_ViewModel
query
)
public
List
<
MenuTree_ViewModel
>
GetTreeMenuModule
(
RB_Menu_ViewModel
query
,
bool
isGetMenuFuncton
=
false
)
{
{
List
<
MenuTree_ViewModel
>
treeList
=
new
List
<
MenuTree_ViewModel
>();
List
<
MenuTree_ViewModel
>
treeList
=
new
List
<
MenuTree_ViewModel
>();
var
list
=
GetMenuListModule
(
query
);
var
list
=
GetMenuListModule
(
query
);
var
functionList
=
GetMenuFunctionListModule
(
new
RB_Menu_Function_ViewModel
());
List
<
RB_Menu_Function_ViewModel
>
functionList
=
new
List
<
RB_Menu_Function_ViewModel
>();
if
(
isGetMenuFuncton
)
{
functionList
=
GetMenuFunctionListModule
(
new
RB_Menu_Function_ViewModel
());
}
if
(
list
!=
null
&&
list
.
Count
>
0
)
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
{
//一级菜单
//一级菜单
...
...
Edu.Module.System/RoleModule.cs
View file @
3cc48927
...
@@ -115,7 +115,7 @@ namespace Edu.Module.System
...
@@ -115,7 +115,7 @@ namespace Edu.Module.System
/// </summary>
/// </summary>
/// <param name="roleId"></param>
/// <param name="roleId"></param>
/// <returns></returns>
/// <returns></returns>
public
object
GetRolePermissionModule
(
int
roleId
)
public
List
<
MenuTree_ViewModel
>
GetRolePermissionModule
(
int
roleId
)
{
{
//角色菜单权限列表
//角色菜单权限列表
List
<
RB_Role_Permission_ViewModel
>
rolePermissionList
=
new
List
<
RB_Role_Permission_ViewModel
>();
List
<
RB_Role_Permission_ViewModel
>
rolePermissionList
=
new
List
<
RB_Role_Permission_ViewModel
>();
...
@@ -127,7 +127,7 @@ namespace Edu.Module.System
...
@@ -127,7 +127,7 @@ namespace Edu.Module.System
roleFunctionList
=
GetRoleFunctionPermissionListModule
(
new
RB_Role_FunctionPermission_ViewModel
()
{
Role_Id
=
roleId
});
roleFunctionList
=
GetRoleFunctionPermissionListModule
(
new
RB_Role_FunctionPermission_ViewModel
()
{
Role_Id
=
roleId
});
}
}
//菜单列表
//菜单列表
var
menuList
=
menuModule
.
GetTreeMenuModule
(
new
RB_Menu_ViewModel
());
var
menuList
=
menuModule
.
GetTreeMenuModule
(
new
RB_Menu_ViewModel
()
,
isGetMenuFuncton
:
true
);
if
(
menuList
!=
null
&&
menuList
.
Count
>
0
)
if
(
menuList
!=
null
&&
menuList
.
Count
>
0
)
{
{
foreach
(
var
item
in
menuList
)
foreach
(
var
item
in
menuList
)
...
@@ -149,57 +149,7 @@ namespace Edu.Module.System
...
@@ -149,57 +149,7 @@ namespace Edu.Module.System
}
}
}
}
}
}
return
menuList
;
var
functionList
=
new
List
<
RoleFunctionPermissionTree_ViewModel
>();
List
<
RoleFunctionPermissionTree_ViewModel
>
resultRoleFunctionTreeList
=
new
List
<
RoleFunctionPermissionTree_ViewModel
>();
//获取枚举中权限列表
foreach
(
var
item
in
Common
.
Plugin
.
EnumHelper
.
EnumToList
(
typeof
(
FunctionPermissionEnum
)))
{
resultRoleFunctionTreeList
.
Add
(
new
RoleFunctionPermissionTree_ViewModel
()
{
Action_Id
=
item
.
Id
,
ActionName
=
item
.
Name
,
CategoryId
=
item
.
Id
.
ToString
().
Substring
(
0
,
2
),
CategoryName
=
GetCategoryName
(
item
.
Id
.
ToString
().
Substring
(
0
,
2
)),
IsChecked
=
false
,
Role_Id
=
roleId
,
});
}
if
(
resultRoleFunctionTreeList
!=
null
&&
resultRoleFunctionTreeList
.
Count
>
0
)
{
//根据枚举前两位分类
var
categoryList
=
resultRoleFunctionTreeList
.
GroupBy
(
qitem
=>
new
{
qitem
.
CategoryId
,
qitem
.
CategoryName
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
CategoryId
,
qitem
.
Key
.
CategoryName
});
foreach
(
var
item
in
categoryList
)
{
var
cateModel
=
resultRoleFunctionTreeList
.
Where
(
qitem
=>
qitem
.
CategoryId
==
item
.
CategoryId
).
Min
();
var
rootModel
=
new
RoleFunctionPermissionTree_ViewModel
()
{
Action_Id
=
Convert
.
ToInt32
(
cateModel
.
CategoryId
),
ActionName
=
item
.
CategoryName
,
CategoryId
=
item
.
CategoryId
,
CategoryName
=
item
.
CategoryName
,
IsChecked
=
false
,
Role_Id
=
roleId
,
ParentId
=
0
,
SubList
=
resultRoleFunctionTreeList
?.
Where
(
qitem
=>
qitem
.
CategoryId
==
item
.
CategoryId
)?.
ToList
()
??
new
List
<
RoleFunctionPermissionTree_ViewModel
>()
};
if
(
rootModel
!=
null
&&
rootModel
.
SubList
.
Count
>
0
)
{
foreach
(
var
subItem
in
rootModel
.
SubList
)
{
subItem
.
ParentId
=
Convert
.
ToInt32
(
cateModel
.
CategoryId
);
subItem
.
IsChecked
=
roleFunctionList
?.
Where
(
qitem
=>
(
int
)
qitem
.
Action_Id
==
subItem
.
Action_Id
)?.
Count
()
>
0
;
}
}
functionList
.
Add
(
rootModel
);
}
}
var
obj
=
new
{
menuList
,
functionList
};
return
obj
;
}
}
/// <summary>
/// <summary>
...
...
Edu.Repository/System/RB_Menu_FunctionRepository.cs
View file @
3cc48927
...
@@ -51,7 +51,7 @@ WHERE 1=1
...
@@ -51,7 +51,7 @@ WHERE 1=1
{
{
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
builder
.
AppendFormat
(
@"
SELECT A.*
,
SELECT A.*
FROM RB_Menu_Function AS A
FROM RB_Menu_Function AS A
WHERE 1=1
WHERE 1=1
"
);
"
);
...
...
Edu.WebApi/Controllers/Public/PublicController.cs
View file @
3cc48927
...
@@ -276,13 +276,9 @@ namespace Edu.WebApi.Controllers.Public
...
@@ -276,13 +276,9 @@ namespace Edu.WebApi.Controllers.Public
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetRolePermission
()
public
ApiResult
GetRolePermission
()
{
{
var
roleId
=
base
.
ParmJObj
.
GetInt
(
"Role_Id"
);
var
roleId
=
base
.
ParmJObj
.
GetInt
(
"Role_Id"
);
if
(
roleId
<=
0
)
var
list
=
roleModule
.
GetRolePermissionModule
(
roleId
);
{
return
ApiResult
.
Success
(
data
:
list
);
return
ApiResult
.
ParamIsNull
(
message
:
"请传递角色编号"
);
}
var
obj
=
roleModule
.
GetRolePermissionModule
(
roleId
);
return
ApiResult
.
Success
(
data
:
obj
);
}
}
/// <summary>
/// <summary>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment