This commit is contained in:
夏菊 2025-10-02 13:41:11 +08:00
parent 47581c2dcb
commit 39a8b67c25
2 changed files with 18 additions and 17 deletions

View File

@ -104,16 +104,16 @@ namespace BLL
{ {
/// 启用且末级菜单 /// 启用且末级菜单
var getMenus = from x in db.Sys_Menu var getMenus = from x in db.Sys_Menu
where x.IsUsed == true where x.IsUsed == true
&& (x.MenuType == Const.Menu_Server || x.MenuType == Const.Menu_Person || && (x.MenuType == Const.Menu_Server || x.MenuType == Const.Menu_Person ||
x.MenuType == Const.Menu_HSSE || x.MenuType==Const.Menu_CQMS || x.MenuType == Const.Menu_HJGL x.MenuType == Const.Menu_HSSE || x.MenuType == Const.Menu_CQMS || x.MenuType == Const.Menu_HJGL
|| x.MenuType == Const.Menu_PZHGL) || x.MenuType == Const.Menu_PZHGL)
select x; select x;
List<Model.Sys_Menu> menus = new List<Model.Sys_Menu>(); List<Model.Sys_Menu> menus = new List<Model.Sys_Menu>();
if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId) if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId)
{ {
menus = getMenus.ToList(); menus = getMenus.ToList();
} }
else else
{ {
var getUser = UserService.GetUserByUserId(userId); ////用户 var getUser = UserService.GetUserByUserId(userId); ////用户
@ -131,7 +131,7 @@ namespace BLL
} }
} }
#endregion #endregion
#region id菜单id判断是否有权限 #region id菜单id判断是否有权限
/// <summary> /// <summary>
/// 根据登陆id菜单id判断是否有权限 /// 根据登陆id菜单id判断是否有权限
@ -163,7 +163,8 @@ namespace BLL
{ {
if (!string.IsNullOrEmpty(getUser.RoleId)) if (!string.IsNullOrEmpty(getUser.RoleId))
{ {
var power = Funs.DB.Sys_RolePower.FirstOrDefault(x => x.MenuId == menuId && x.RoleId == getUser.RoleId); List<string> roleIdList = getUser.RoleId.Split(',').ToList();
var power = Funs.DB.Sys_RolePower.FirstOrDefault(x => x.MenuId == menuId && roleIdList.Contains(x.RoleId));
if (power != null) if (power != null)
{ {
returnValue = true; returnValue = true;
@ -321,7 +322,7 @@ namespace BLL
isPower = false; isPower = false;
} }
} }
return isPower; return isPower;
} }
#endregion #endregion
@ -363,12 +364,12 @@ namespace BLL
result = true; result = true;
} }
else else
{ {
var user = BLL.UserService.GetUserByUserId(userId); var user = BLL.UserService.GetUserByUserId(userId);
if (user != null && user.IsOffice == true) if (user != null && user.IsOffice == true)
{ {
result = true; result = true;
} }
} }
return result; return result;
@ -382,7 +383,7 @@ namespace BLL
/// <param name="userId"></param> /// <param name="userId"></param>
/// <param name="menuType"></param> /// <param name="menuType"></param>
/// <returns></returns> /// <returns></returns>
public static bool IsHaveSystemPower(string userId,string menuType, string projectId) public static bool IsHaveSystemPower(string userId, string menuType, string projectId)
{ {
using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString)) using (Model.CNPCDB db = new Model.CNPCDB(Funs.ConnString))
{ {
@ -390,7 +391,7 @@ namespace BLL
var getUser = db.Sys_User.FirstOrDefault(x => x.UserId == userId); var getUser = db.Sys_User.FirstOrDefault(x => x.UserId == userId);
if (getUser != null) if (getUser != null)
{ {
if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId) if (userId == Const.sysglyId || userId == Const.hfnbdId || userId == Const.sedinId)
{ {
isHave = true; isHave = true;
} }
@ -480,7 +481,7 @@ namespace BLL
} }
} }
#endregion #endregion
#region #region
/// <summary> /// <summary>
/// 保存数据 /// 保存数据
@ -669,7 +670,7 @@ namespace BLL
public static string GetThisUnitId() public static string GetThisUnitId()
{ {
string unitId = Const.UnitId_XJYJ; string unitId = Const.UnitId_XJYJ;
return unitId; return unitId;
} }

View File

@ -27,10 +27,10 @@
<Toolbars> <Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server"> <f:Toolbar ID="Toolbar2" Position="Top" runat="server">
<Items> <Items>
<f:TextBox runat="server" Label="名称" ID="txtRoleName" EmptyText="输入查询条件" <f:TextBox runat="server" Label="名称" ID="txtRoleName" EmptyText="输入查询条件" LabelAlign="Right"
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"> AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px">
</f:TextBox> </f:TextBox>
<f:RadioButtonList runat="server" ID="rbIsOfficce" Label="类型" LabelWidth="90px" <f:RadioButtonList runat="server" ID="rbIsOfficce" Label="类型" LabelWidth="80px" Width="280px" LabelAlign="Right"
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"> AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
<f:RadioItem Text="本部角色" Value="1" /> <f:RadioItem Text="本部角色" Value="1" />
<f:RadioItem Text="项目角色" Value="0" Selected ="true"/> <f:RadioItem Text="项目角色" Value="0" Selected ="true"/>
@ -55,7 +55,7 @@
</f:Grid> </f:Grid>
</PopPanel> </PopPanel>
</f:DropDownBox> </f:DropDownBox>
<f:RadioButtonList ID="rbMenuType" Label="菜单类型" runat="server" LabelWidth="80px" <f:RadioButtonList ID="rbMenuType" Label="菜单类型" runat="server" LabelWidth="80px" Width="280px"
AutoPostBack="true" OnSelectedIndexChanged="rbMenuType_SelectedIndexChanged"> AutoPostBack="true" OnSelectedIndexChanged="rbMenuType_SelectedIndexChanged">
<f:RadioItem Selected="true" Text="本部菜单" Value="MenuType_S"/> <f:RadioItem Selected="true" Text="本部菜单" Value="MenuType_S"/>
<f:RadioItem Text="项目菜单" Value="MenuType_P"/> <f:RadioItem Text="项目菜单" Value="MenuType_P"/>