|
@@ -59,21 +59,21 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
switch (menu)
|
|
switch (menu)
|
|
{
|
|
{
|
|
case { Name: "用户信息", Children: not null }:
|
|
case { Name: "用户信息", Children: not null }:
|
|
- if (UserMenuItems.Count == 0 || UserMenuItems.Any(x => x.Name != menu.Name))
|
|
|
|
|
|
+ if (UserMenuItems.Count == 0 || !(UserMenuItems.Any(x => x.Name == menu.Name)))
|
|
{
|
|
{
|
|
UserMenuItems.Add(new MenuItemModel(menu));
|
|
UserMenuItems.Add(new MenuItemModel(menu));
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case { Name: "基础数据", Children: not null }:
|
|
case { Name: "基础数据", Children: not null }:
|
|
- if (BaseMenuItems.Count == 0 || BaseMenuItems.Any(x => x.Name != menu.Name))
|
|
|
|
|
|
+ if (BaseMenuItems.Count == 0 || !(BaseMenuItems.Any(x => x.Name == menu.Name)))
|
|
{
|
|
{
|
|
BaseMenuItems.Add(new MenuItemModel(menu));
|
|
BaseMenuItems.Add(new MenuItemModel(menu));
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case { Name: "生产数据", Children: not null }:
|
|
case { Name: "生产数据", Children: not null }:
|
|
- foreach (var menuItem in menu.Children.OrderBy(x=>x.OrderIndex))
|
|
|
|
|
|
+ foreach (var menuItem in menu.Children.OrderBy(x => x.OrderIndex))
|
|
{
|
|
{
|
|
- if (ProduceMenuItems.Count == 0 || ProduceMenuItems.Any(x => x.Name != menuItem.Name))
|
|
|
|
|
|
+ if (ProduceMenuItems.Count == 0 || !(ProduceMenuItems.Any(x => x.Guid == menuItem.Guid)))
|
|
{
|
|
{
|
|
ProduceMenuItems.Add(new MenuItemModel(menuItem));
|
|
ProduceMenuItems.Add(new MenuItemModel(menuItem));
|
|
}
|
|
}
|