diff --git a/DMS.Application/DTOs/CreateDeviceWithDetailsDto.cs b/DMS.Application/DTOs/CreateDeviceWithDetailsDto.cs index e7fd4e6..02dcd5e 100644 --- a/DMS.Application/DTOs/CreateDeviceWithDetailsDto.cs +++ b/DMS.Application/DTOs/CreateDeviceWithDetailsDto.cs @@ -9,6 +9,6 @@ public class CreateDeviceWithDetailsDto { public Device Device { get; set; } public VariableTable VariableTable { get; set; } - public MenuBeanDto DeviceMenu { get; set; } // 如果需要包含菜单信息 - public MenuBeanDto VariableTableMenu { get; set; } // 如果需要包含菜单信息 + public MenuBean DeviceMenu { get; set; } // 如果需要包含菜单信息 + public MenuBean VariableTableMenu { get; set; } // 如果需要包含菜单信息 } \ No newline at end of file diff --git a/DMS.Application/DTOs/CreateMqttWithMenuDto.cs b/DMS.Application/DTOs/CreateMqttWithMenuDto.cs index 77dc132..cae7dd4 100644 --- a/DMS.Application/DTOs/CreateMqttWithMenuDto.cs +++ b/DMS.Application/DTOs/CreateMqttWithMenuDto.cs @@ -15,6 +15,6 @@ namespace DMS.Application.DTOs /// /// 菜单项信息 /// - public MenuBeanDto MqttServerMenu { get; set; } + public MenuBean MqttServerMenu { get; set; } } } \ No newline at end of file diff --git a/DMS.Application/DTOs/CreateVariableTableWithMenuDto.cs b/DMS.Application/DTOs/CreateVariableTableWithMenuDto.cs index b682606..99cfe2e 100644 --- a/DMS.Application/DTOs/CreateVariableTableWithMenuDto.cs +++ b/DMS.Application/DTOs/CreateVariableTableWithMenuDto.cs @@ -7,6 +7,6 @@ namespace DMS.Application.DTOs { public VariableTable VariableTable { get; set; } public int DeviceId { get; set; } - public MenuBeanDto Menu { get; set; } + public MenuBean Menu { get; set; } } } diff --git a/DMS.Application/DTOs/MenuBeanDto.cs b/DMS.Application/DTOs/MenuBeanDto.cs deleted file mode 100644 index 25c4d10..0000000 --- a/DMS.Application/DTOs/MenuBeanDto.cs +++ /dev/null @@ -1,64 +0,0 @@ -using DMS.Core.Enums; - -namespace DMS.Application.DTOs; - -/// -/// 菜单数据传输对象(DTO) -/// 用于在应用程序层和表示层之间传输菜单数据,特别是在UI上显示菜单项时使用。 -/// -public class MenuBeanDto -{ - /// - /// 菜单项的唯一标识符 - /// - public int Id { get; set; } - - /// - /// 父级菜单项的ID,用于构建层级菜单结构 - /// 如果为0表示为顶级菜单项 - /// - public int ParentId { get; set; } - - /// - /// 菜单项显示的标题文本 - /// - public string Header { get; set; } - - /// - /// 菜单项显示的图标资源路径或标识符 - /// - public string Icon { get; set; } - - /// - /// 菜单的类型,例如菜单关联的是设备,还是变量表,或者是MQTT - /// 用于区分不同类型的菜单项,决定点击菜单项时的行为 - /// - public MenuType MenuType { get; set; } - - /// - /// 菜单关联的数据ID,例如设备Id,变量表Id - /// 根据MenuType的不同,此ID可以指向不同的数据实体 - /// - public int TargetId { get; set; } - - /// - /// 目标视图的键值,用于导航到特定的视图页面 - /// - public string TargetViewKey { get; set; } - - /// - /// 导航参数,传递给目标视图的额外参数信息 - /// - public string NavigationParameter { get; set; } - - /// - /// 菜单项在同级菜单中的显示顺序 - /// 数值越小显示越靠前 - /// - public int DisplayOrder { get; set; } - - /// - /// 子菜单项集合,用于构建层级菜单结构 - /// - public List Children { get; set; } = new List(); -} \ No newline at end of file diff --git a/DMS.Application/Events/MenuChangedEventArgs.cs b/DMS.Application/Events/MenuChangedEventArgs.cs index d83ba64..f8e59e9 100644 --- a/DMS.Application/Events/MenuChangedEventArgs.cs +++ b/DMS.Application/Events/MenuChangedEventArgs.cs @@ -1,5 +1,5 @@ -using DMS.Application.DTOs; using DMS.Core.Enums; +using DMS.Core.Models; namespace DMS.Application.Events { @@ -14,17 +14,17 @@ namespace DMS.Application.Events public DataChangeType ChangeType { get; } /// - /// 菜单DTO + /// 菜单 /// - public MenuBeanDto Menu { get; } + public MenuBean Menu { get; } /// /// 构造函数 /// /// 变更类型 - /// 菜单DTO - /// 父级菜单DTO - public MenuChangedEventArgs(DataChangeType changeType, MenuBeanDto menu) + /// 菜单 + /// 父级菜单 + public MenuChangedEventArgs(DataChangeType changeType, MenuBean menu) { ChangeType = changeType; Menu = menu; diff --git a/DMS.Application/Interfaces/Database/IMenuAppService.cs b/DMS.Application/Interfaces/Database/IMenuAppService.cs index 0406a5b..42e8ffb 100644 --- a/DMS.Application/Interfaces/Database/IMenuAppService.cs +++ b/DMS.Application/Interfaces/Database/IMenuAppService.cs @@ -1,4 +1,4 @@ -using DMS.Application.DTOs; +using DMS.Core.Models; namespace DMS.Application.Interfaces; @@ -8,24 +8,24 @@ namespace DMS.Application.Interfaces; public interface IMenuAppService { /// - /// 异步根据ID获取菜单DTO。 + /// 异步根据ID获取菜单。 /// - Task GetMenuByIdAsync(int id); + Task GetMenuByIdAsync(int id); /// - /// 异步获取所有菜单DTO列表。 + /// 异步获取所有菜单列表。 /// - Task> GetAllMenusAsync(); + Task> GetAllMenusAsync(); /// /// 异步创建一个新菜单。 /// - Task CreateMenuAsync(MenuBeanDto menuDto); + Task CreateMenuAsync(MenuBean menu); /// /// 异步更新一个已存在的菜单。 /// - Task UpdateMenuAsync(MenuBeanDto menuDto); + Task UpdateMenuAsync(MenuBean menu); /// /// 异步删除一个菜单。 diff --git a/DMS.Application/Interfaces/IAppDataStorageService.cs b/DMS.Application/Interfaces/IAppDataStorageService.cs index 81a2271..b255a96 100644 --- a/DMS.Application/Interfaces/IAppDataStorageService.cs +++ b/DMS.Application/Interfaces/IAppDataStorageService.cs @@ -23,12 +23,12 @@ public interface IAppDataStorageService /// /// 安全字典,用于存储所有菜单数据 /// - ConcurrentDictionary Menus { get; } + ConcurrentDictionary Menus { get; } /// /// 安全字典,用于存储所有菜单数据 /// - ConcurrentDictionary MenuTrees { get; } + ConcurrentDictionary MenuTrees { get; } /// /// 安全字典,用于存储所有MQTT服务器数据 diff --git a/DMS.Application/Interfaces/Management/IMenuManagementService.cs b/DMS.Application/Interfaces/Management/IMenuManagementService.cs index fff4e3e..1c446ca 100644 --- a/DMS.Application/Interfaces/Management/IMenuManagementService.cs +++ b/DMS.Application/Interfaces/Management/IMenuManagementService.cs @@ -1,28 +1,28 @@ -using DMS.Application.DTOs; +using DMS.Core.Models; namespace DMS.Application.Interfaces.Management; public interface IMenuManagementService { /// - /// 异步获取所有菜单DTO列表。 + /// 异步获取所有菜单列表。 /// - Task> GetAllMenusAsync(); + Task> GetAllMenusAsync(); /// - /// 异步根据ID获取菜单DTO。 + /// 异步根据ID获取菜单。 /// - Task GetMenuByIdAsync(int id); + Task GetMenuByIdAsync(int id); /// /// 异步创建一个新菜单。 /// - Task CreateMenuAsync(MenuBeanDto menuDto); + Task CreateMenuAsync(MenuBean menu); /// /// 异步更新一个已存在的菜单。 /// - Task UpdateMenuAsync(MenuBeanDto menuDto); + Task UpdateMenuAsync(MenuBean menu); /// /// 异步删除一个菜单。 @@ -32,14 +32,14 @@ public interface IMenuManagementService /// /// 获取根菜单列表 /// - List GetRootMenus(); + List GetRootMenus(); /// /// 根据父级ID获取子菜单列表 /// /// 父级菜单ID /// 子菜单列表 - List GetChildMenus(int parentId); + List GetChildMenus(int parentId); /// /// 构建菜单树结构 diff --git a/DMS.Application/Profiles/MappingProfile.cs b/DMS.Application/Profiles/MappingProfile.cs index ba17189..243a437 100644 --- a/DMS.Application/Profiles/MappingProfile.cs +++ b/DMS.Application/Profiles/MappingProfile.cs @@ -1,13 +1,12 @@ using AutoMapper; -using DMS.Core.Models; using DMS.Application.DTOs; +using DMS.Core.Models; using DMS.Core.Models.Triggers; namespace DMS.Application.Profiles; /// -/// 配置AutoMapper的映射规则。 -/// +/// 配置AutoMapper的映射规则?/// public class MappingProfile : Profile { public MappingProfile() @@ -22,8 +21,7 @@ public class MappingProfile : Profile .ForMember(dest => dest.VariableName, opt => opt.MapFrom(src => src.Variable.Name)) .ReverseMap(); - // MenuBean 映射 - CreateMap().ReverseMap(); + // User 映射 CreateMap().ReverseMap(); diff --git a/DMS.Application/Services/AppDataStorageService.cs b/DMS.Application/Services/AppDataStorageService.cs index 7816ccc..589dda4 100644 --- a/DMS.Application/Services/AppDataStorageService.cs +++ b/DMS.Application/Services/AppDataStorageService.cs @@ -24,12 +24,12 @@ public class AppDataStorageService : IAppDataStorageService /// /// 安全字典,用于存储所有菜单数据 /// - public ConcurrentDictionary Menus { get; } = new(); + public ConcurrentDictionary Menus { get; } = new(); /// /// 安全字典,用于存储所有菜单数据 /// - public ConcurrentDictionary MenuTrees { get; } = new(); + public ConcurrentDictionary MenuTrees { get; } = new(); /// /// 安全字典,用于存储所有MQTT服务器数据 diff --git a/DMS.Application/Services/DataLoaderService.cs b/DMS.Application/Services/DataLoaderService.cs index 511172e..8b3eb2d 100644 --- a/DMS.Application/Services/DataLoaderService.cs +++ b/DMS.Application/Services/DataLoaderService.cs @@ -1,5 +1,4 @@ using AutoMapper; -using DMS.Application.DTOs; using DMS.Application.Interfaces; using DMS.Core.Interfaces; using System.Collections.Concurrent; @@ -178,11 +177,10 @@ public class DataLoaderService : IDataLoaderService _appDataStorageService.Menus.Clear(); _appDataStorageService.MenuTrees.Clear(); var menus = await _repositoryManager.Menus.GetAllAsync(); - var menuDtos = _mapper.Map>(menus); // 将菜单添加到安全字典 - foreach (var menuDto in menuDtos) + foreach (var menuBean in menus) { - _appDataStorageService.Menus.TryAdd(menuDto.Id, menuDto); + _appDataStorageService.Menus.TryAdd(menuBean.Id, menuBean); } } diff --git a/DMS.Application/Services/Database/MenuAppService.cs b/DMS.Application/Services/Database/MenuAppService.cs index 598b0dd..0f1e225 100644 --- a/DMS.Application/Services/Database/MenuAppService.cs +++ b/DMS.Application/Services/Database/MenuAppService.cs @@ -1,7 +1,6 @@ using AutoMapper; using DMS.Core.Interfaces; using DMS.Core.Models; -using DMS.Application.DTOs; using DMS.Application.Interfaces.Database; using DMS.Application.Interfaces; @@ -28,38 +27,37 @@ public class MenuAppService : IMenuAppService } /// - /// 异步根据ID获取菜单数据传输对象。 + /// 异步根据ID获取菜单。 /// /// 菜单ID。 - /// 菜单数据传输对象。 - public async Task GetMenuByIdAsync(int id) + /// 菜单对象。 + public async Task GetMenuByIdAsync(int id) { var menu = await _repoManager.Menus.GetByIdAsync(id); - return _mapper.Map(menu); + return _mapper.Map(menu); } /// - /// 异步获取所有菜单数据传输对象列表。 + /// 异步获取所有菜单列表。 /// - /// 菜单数据传输对象列表。 - public async Task> GetAllMenusAsync() + /// 菜单列表。 + public async Task> GetAllMenusAsync() { var menus = await _repoManager.Menus.GetAllAsync(); - return _mapper.Map>(menus); + return _mapper.Map>(menus); } /// /// 异步创建一个新菜单(事务性操作)。 /// - /// 要创建的菜单数据传输对象。 + /// 要创建的菜单。 /// 新创建菜单的ID。 /// 如果创建菜单时发生错误。 - public async Task CreateMenuAsync(MenuBeanDto menuDto) + public async Task CreateMenuAsync(MenuBean menu) { try { await _repoManager.BeginTranAsync(); - var menu = _mapper.Map(menuDto); await _repoManager.Menus.AddAsync(menu); await _repoManager.CommitAsync(); return menu.Id; @@ -74,21 +72,21 @@ public class MenuAppService : IMenuAppService /// /// 异步更新一个已存在的菜单(事务性操作)。 /// - /// 要更新的菜单数据传输对象。 + /// 要更新的菜单。 /// 受影响的行数。 /// 如果找不到菜单或更新菜单时发生错误。 - public async Task UpdateMenuAsync(MenuBeanDto menuDto) + public async Task UpdateMenuAsync(MenuBean menu) { try { await _repoManager.BeginTranAsync(); - var menu = await _repoManager.Menus.GetByIdAsync(menuDto.Id); - if (menu == null) + var dbmenu = await _repoManager.Menus.GetByIdAsync(menu.Id); + if (dbmenu == null) { - throw new ApplicationException($"Menu with ID {menuDto.Id} not found."); + throw new ApplicationException($"Menu with ID {menu.Id} not found."); } - _mapper.Map(menuDto, menu); - int res = await _repoManager.Menus.UpdateAsync(menu); + _mapper.Map(menu, dbmenu); + int res = await _repoManager.Menus.UpdateAsync(dbmenu); await _repoManager.CommitAsync(); return res; } diff --git a/DMS.Application/Services/Management/MenuManagementService.cs b/DMS.Application/Services/Management/MenuManagementService.cs index 41b7d5b..c14a691 100644 --- a/DMS.Application/Services/Management/MenuManagementService.cs +++ b/DMS.Application/Services/Management/MenuManagementService.cs @@ -1,8 +1,8 @@ -using DMS.Application.DTOs; using DMS.Application.Events; using DMS.Application.Interfaces; using DMS.Application.Interfaces.Management; using DMS.Core.Enums; +using DMS.Core.Models; namespace DMS.Application.Services.Management; @@ -28,17 +28,17 @@ public class MenuManagementService : IMenuManagementService } /// - /// 异步获取所有菜单DTO列表。 + /// 异步获取所有菜单列表。 /// - public async Task> GetAllMenusAsync() + public async Task> GetAllMenusAsync() { return await _menuService.GetAllMenusAsync(); } /// - /// 异步根据ID获取菜单DTO。 + /// 异步根据ID获取菜单。 /// - public async Task GetMenuByIdAsync(int id) + public async Task GetMenuByIdAsync(int id) { return await _menuService.GetMenuByIdAsync(id); } @@ -46,24 +46,24 @@ public class MenuManagementService : IMenuManagementService /// /// 异步创建一个新菜单。 /// - public async Task CreateMenuAsync(MenuBeanDto menuDto) + public async Task CreateMenuAsync(MenuBean menu) { - var result = await _menuService.CreateMenuAsync(menuDto); + var result = await _menuService.CreateMenuAsync(menu); // 创建成功后,将菜单添加到内存中 if (result > 0) { - menuDto.Id = result; // 假设返回的ID是新创建的 - if (_appDataStorageService.Menus.TryAdd(menuDto.Id, menuDto)) + menu.Id = result; // 假设返回的ID是新创建的 + if (_appDataStorageService.Menus.TryAdd(menu.Id, menu)) { - MenuBeanDto parentMenu = null; - if (menuDto.ParentId > 0 && _appDataStorageService.Menus.TryGetValue(menuDto.ParentId, out var parent)) + MenuBean parentMenu = null; + if (menu.ParentId > 0 && _appDataStorageService.Menus.TryGetValue(menu.ParentId.Value, out var parent)) { parentMenu = parent; - parent.Children.Add(menuDto); + parent.Children.Add(menu); } - _eventService.RaiseMenuChanged(this, new MenuChangedEventArgs(DataChangeType.Added, menuDto)); + _eventService.RaiseMenuChanged(this, new MenuChangedEventArgs(DataChangeType.Added, menu)); } } @@ -73,17 +73,17 @@ public class MenuManagementService : IMenuManagementService /// /// 异步更新一个已存在的菜单。 /// - public async Task UpdateMenuAsync(MenuBeanDto menuDto) + public async Task UpdateMenuAsync(MenuBean menu) { - var result = await _menuService.UpdateMenuAsync(menuDto); + var result = await _menuService.UpdateMenuAsync(menu); // 更新成功后,更新内存中的菜单 - if (result > 0 && menuDto != null) + if (result > 0 && menu != null) { - _appDataStorageService.Menus.AddOrUpdate(menuDto.Id, menuDto, (key, oldValue) => menuDto); + _appDataStorageService.Menus.AddOrUpdate(menu.Id, menu, (key, oldValue) => menu); - _eventService.RaiseMenuChanged(this, new MenuChangedEventArgs(DataChangeType.Updated, menuDto)); + _eventService.RaiseMenuChanged(this, new MenuChangedEventArgs(DataChangeType.Updated, menu)); } return result; @@ -100,15 +100,15 @@ public class MenuManagementService : IMenuManagementService // 删除成功后,从内存中移除菜单 if (result && menu != null) { - if (_appDataStorageService.Menus.TryRemove(id, out var menuDto)) + if (_appDataStorageService.Menus.TryRemove(id, out var menuData)) { // 从父菜单中移除子菜单 - if (menuDto.ParentId > 0 && _appDataStorageService.Menus.TryGetValue(menuDto.ParentId, out var parentMenu)) + if (menuData.ParentId > 0 && _appDataStorageService.Menus.TryGetValue(menuData.ParentId.Value, out var parentMenu)) { - parentMenu.Children.Remove(menuDto); + parentMenu.Children.Remove(menuData); } - _eventService.RaiseMenuChanged(this, new MenuChangedEventArgs(DataChangeType.Deleted, menuDto)); + _eventService.RaiseMenuChanged(this, new MenuChangedEventArgs(DataChangeType.Deleted, menuData)); } } @@ -118,7 +118,7 @@ public class MenuManagementService : IMenuManagementService /// /// 获取根菜单列表 /// - public List GetRootMenus() + public List GetRootMenus() { return _appDataStorageService.Menus.Values.Where(m => m.ParentId == 0) .ToList(); @@ -129,7 +129,7 @@ public class MenuManagementService : IMenuManagementService /// /// 父级菜单ID /// 子菜单列表 - public List GetChildMenus(int parentId) + public List GetChildMenus(int parentId) { return _appDataStorageService.Menus.Values.Where(m => m.ParentId == parentId) .ToList(); diff --git a/DMS.Core/Models/MenuBean.cs b/DMS.Core/Models/MenuBean.cs index 25bd3b3..4d720a8 100644 --- a/DMS.Core/Models/MenuBean.cs +++ b/DMS.Core/Models/MenuBean.cs @@ -57,4 +57,9 @@ public class MenuBean /// 数值越小显示越靠前 /// public int DisplayOrder { get; set; } + + /// + /// 子菜单项集合,用于构建层级菜单结构 + /// + public List Children { get; set; } = new List(); } \ No newline at end of file diff --git a/DMS.WPF/Interfaces/IVariableTableDataService.cs b/DMS.WPF/Interfaces/IVariableTableDataService.cs index a4f7a87..4d1ebb3 100644 --- a/DMS.WPF/Interfaces/IVariableTableDataService.cs +++ b/DMS.WPF/Interfaces/IVariableTableDataService.cs @@ -11,7 +11,7 @@ public interface IVariableTableDataService void LoadAllVariableTables(); Task AddVariableTable(VariableTable variableTable, - MenuBeanDto menuDto = null, bool isAddDb = false); + MenuBean menu = null, bool isAddDb = false); Task UpdateVariableTable(VariableTableItem variableTable); Task DeleteVariableTable(VariableTableItem variableTable, bool isDeleteDb = false); diff --git a/DMS.WPF/Profiles/MappingProfile.cs b/DMS.WPF/Profiles/MappingProfile.cs index cbf3cde..39145bc 100644 --- a/DMS.WPF/Profiles/MappingProfile.cs +++ b/DMS.WPF/Profiles/MappingProfile.cs @@ -25,7 +25,7 @@ namespace DMS.WPF.Profiles .ReverseMap(); - CreateMap() + CreateMap() .ReverseMap(); @@ -40,4 +40,4 @@ namespace DMS.WPF.Profiles CreateMap().ReverseMap(); } } -} \ No newline at end of file +} diff --git a/DMS.WPF/Services/MenuDataService.cs b/DMS.WPF/Services/MenuDataService.cs index 2bba572..a58066b 100644 --- a/DMS.WPF/Services/MenuDataService.cs +++ b/DMS.WPF/Services/MenuDataService.cs @@ -1,8 +1,8 @@ using AutoMapper; -using DMS.Application.DTOs; using DMS.Application.Interfaces; using DMS.Application.Interfaces.Management; using DMS.Application.Services.Management; +using DMS.Core.Models; using DMS.WPF.Interfaces; using DMS.WPF.ItemViewModel; using System.Collections.ObjectModel; @@ -79,7 +79,7 @@ public class MenuDataService : IMenuDataService if (deviceMenu is not null) { - var menuId= await _menuManagementService.CreateMenuAsync(_mapper.Map(MenuItem)); + var menuId= await _menuManagementService.CreateMenuAsync(_mapper.Map(MenuItem)); if (menuId>0) { MenuItem.Id = menuId; diff --git a/DMS.WPF/Services/MqttDataService.cs b/DMS.WPF/Services/MqttDataService.cs index 7502f56..9066f14 100644 --- a/DMS.WPF/Services/MqttDataService.cs +++ b/DMS.WPF/Services/MqttDataService.cs @@ -78,7 +78,7 @@ public class MqttDataService : IMqttDataService if (mqttRootMenu is not null) { - var mqttServerMenu = new MenuBeanDto() + var mqttServerMenu = new MenuBean() { Header = mqttServerItem.ServerName, TargetId = mqttServerItem.Id, @@ -111,7 +111,7 @@ public class MqttDataService : IMqttDataService menu.Header = mqttServer.ServerName; // 使用菜单管理服务更新菜单 - var menuDto = _mapper.Map(menu); + var menuDto = _mapper.Map(menu); await _menuManagementServiceImpl.UpdateMenuAsync(menuDto); } } diff --git a/DMS.WPF/Services/VariableTableDataService.cs b/DMS.WPF/Services/VariableTableDataService.cs index aa97a04..3988525 100644 --- a/DMS.WPF/Services/VariableTableDataService.cs +++ b/DMS.WPF/Services/VariableTableDataService.cs @@ -40,7 +40,7 @@ public class VariableTableDataService : IVariableTableDataService } public async Task AddVariableTable(VariableTable variableTable, - MenuBeanDto menuDto = null, bool isAddDb = false) + MenuBean menuDto = null, bool isAddDb = false) { if (variableTable == null) return 0; @@ -53,7 +53,7 @@ public class VariableTableDataService : IVariableTableDataService createDto.Menu = menuDto; var resDto = await _appDataCenterService.VariableTableManagementService.CreateVariableTableAsync(createDto); - _menuDataService.AddMenuItem(_mapper.Map(resDto.Menu)); + await _menuDataService.AddMenuItem(_mapper.Map(resDto.Menu)); return resDto.VariableTable.Id; } @@ -114,7 +114,7 @@ public class VariableTableDataService : IVariableTableDataService var variableTableMenu =_dataStorageService.Menus.FirstOrDefault(m => m.MenuType == MenuType.VariableTableMenu && m.TargetId == variableTable.Id); - _menuDataService.DeleteMenuItem(variableTableMenu); + await _menuDataService.DeleteMenuItem(variableTableMenu); // 删除变量表 _dataStorageService.VariableTables.Remove(variableTable.Id); variableTable.Device.VariableTables.Remove(variableTable); diff --git a/DMS.WPF/ViewModels/DeviceDetailViewModel.cs b/DMS.WPF/ViewModels/DeviceDetailViewModel.cs index 3286887..606228e 100644 --- a/DMS.WPF/ViewModels/DeviceDetailViewModel.cs +++ b/DMS.WPF/ViewModels/DeviceDetailViewModel.cs @@ -68,7 +68,7 @@ public partial class DeviceDetailViewModel : ViewModelBase } VariableTableItem.DeviceId = CurrentDevice.Id; - var tableMenu = new MenuBeanDto() + var tableMenu = new MenuBean() { Header = VariableTableItem.Name, Icon = SegoeFluentIcons.DataSense.Glyph, diff --git a/DMS.WPF/ViewModels/DevicesViewModel.cs b/DMS.WPF/ViewModels/DevicesViewModel.cs index 4be9869..76e59de 100644 --- a/DMS.WPF/ViewModels/DevicesViewModel.cs +++ b/DMS.WPF/ViewModels/DevicesViewModel.cs @@ -104,7 +104,7 @@ public partial class DevicesViewModel : ViewModelBase, INavigatable } - dto.DeviceMenu = new MenuBeanDto() + dto.DeviceMenu = new MenuBean() { Header = device.Name, Icon = SegoeFluentIcons.Devices2.Glyph, @@ -119,7 +119,7 @@ public partial class DevicesViewModel : ViewModelBase, INavigatable Description = "默认变量表", IsActive = true }; - dto.VariableTableMenu = new MenuBeanDto() + dto.VariableTableMenu = new MenuBean() { Header = dto.VariableTable.Name, Icon = SegoeFluentIcons.DataSense.Glyph, @@ -266,7 +266,7 @@ public partial class DevicesViewModel : ViewModelBase, INavigatable } VariableTableItem.DeviceId = device.Id; - var tableMenu = new MenuBeanDto() + var tableMenu = new MenuBean() { Header = VariableTableItem.Name, Icon = SegoeFluentIcons.DataSense.Glyph,