终端一体化运控平台
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

174 linhas
6.5 KiB

  1. using BPASmartClient.CustomResource.Pages.Enums;
  2. using BPASmartClient.CustomResource.Pages.Model;
  3. using BPASmartClient.CustomResource.Pages.View;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Collections.ObjectModel;
  7. using System.Configuration;
  8. using System.Data;
  9. using System.Linq;
  10. using System.Threading.Tasks;
  11. using System.Windows;
  12. namespace BPASmartClient.ZhuoDian
  13. {
  14. /// <summary>
  15. /// Interaction logic for App.xaml
  16. /// </summary>
  17. public partial class App : Application
  18. {
  19. protected override void OnStartup(StartupEventArgs e)
  20. {
  21. base.OnStartup(e);
  22. MenuInit();
  23. DataInit();
  24. MainView mv = new MainView();
  25. LoginView lv = new LoginView();
  26. var res = lv.ShowDialog();
  27. if (res != null && res == true)
  28. mv.Show();
  29. else
  30. mv.Close();
  31. }
  32. protected override void OnExit(ExitEventArgs e)
  33. {
  34. base.OnExit(e);
  35. MessageNotify.GetInstance.LogSave();
  36. }
  37. private void MenuInit()
  38. {
  39. #region 配方管理菜单
  40. ObservableCollection<SubMenumodel> RecipeManage = new ObservableCollection<SubMenumodel>();
  41. RecipeManage.Add(new SubMenumodel()
  42. {
  43. SubMenuName = "配方管理",
  44. SubMenuPermission = new Permission[] { Permission.管理员 },
  45. AssemblyName = "BPASmartClient.DosingSystem",
  46. ToggleWindowPath = "View.RecipeSettingsView"
  47. });
  48. RecipeManage.Add(new SubMenumodel()
  49. {
  50. SubMenuName = "配方下发",
  51. SubMenuPermission = new Permission[] { Permission.操作员 },
  52. AssemblyName = "BPASmartClient.DosingSystem",
  53. ToggleWindowPath = "View.RecipeControlView"
  54. });
  55. MenuManage.GetInstance.menuModels.Add(new MenuModel()
  56. {
  57. MainMenuIcon = "&#xe683;",
  58. MainMenuName = "配方管理",
  59. Alias = "Recipe Management",
  60. MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员 },
  61. subMenumodels = RecipeManage,
  62. });
  63. #endregion
  64. #region 消息日志
  65. ObservableCollection<SubMenumodel> InfoLog = new ObservableCollection<SubMenumodel>();
  66. InfoLog.Add(new SubMenumodel()
  67. {
  68. SubMenuName = "操作日志",
  69. SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
  70. AssemblyName = "BPASmartClient.CustomResource",
  71. ToggleWindowPath = "Pages.View.UserLogView"
  72. });
  73. InfoLog.Add(new SubMenumodel()
  74. {
  75. SubMenuName = "运行日志",
  76. SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
  77. AssemblyName = "BPASmartClient.CustomResource",
  78. ToggleWindowPath = "Pages.View.RunLogView"
  79. });
  80. InfoLog.Add(new SubMenumodel()
  81. {
  82. SubMenuName = "报警记录",
  83. SubMenuPermission = new Permission[] { Permission.操作员, Permission.管理员, Permission.技术员 },
  84. AssemblyName = "BPASmartClient.CustomResource",
  85. ToggleWindowPath = "Pages.View.AlarmView"
  86. });
  87. MenuManage.GetInstance.menuModels.Add(new MenuModel()
  88. {
  89. MainMenuIcon = "&#xe668;",
  90. MainMenuName = "消息日志",
  91. Alias = "Message Log",
  92. MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
  93. subMenumodels = InfoLog,
  94. });
  95. #endregion
  96. #region 硬件设备监控
  97. ObservableCollection<SubMenumodel> DeviceMonitor = new ObservableCollection<SubMenumodel>();
  98. DeviceMonitor.Add(new SubMenumodel()
  99. {
  100. SubMenuName = "原料设备列表",
  101. SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
  102. AssemblyName = "BPASmartClient.DosingSystem",
  103. ToggleWindowPath = "View.DeviceListView"
  104. });
  105. DeviceMonitor.Add(new SubMenumodel()
  106. {
  107. SubMenuName = "设备状态",
  108. SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
  109. AssemblyName = "BPASmartClient.DosingSystem",
  110. ToggleWindowPath = "View.HardwareStatusView"
  111. });
  112. MenuManage.GetInstance.menuModels.Add(new MenuModel()
  113. {
  114. MainMenuIcon = "&#xe603;",
  115. MainMenuName = "设备监控",
  116. Alias = "Device Monitor",
  117. MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
  118. subMenumodels = DeviceMonitor,
  119. });
  120. #endregion
  121. #region 用户管理
  122. ObservableCollection<SubMenumodel> UserManager = new ObservableCollection<SubMenumodel>();
  123. UserManager.Add(new SubMenumodel()
  124. {
  125. SubMenuName = "用户登录",
  126. SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
  127. AssemblyName = "BPASmartClient.CustomResource",
  128. ToggleWindowPath = "Pages.View.LoginView"
  129. });
  130. UserManager.Add(new SubMenumodel()
  131. {
  132. SubMenuName = "密码修改",
  133. SubMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
  134. AssemblyName = "BPASmartClient.CustomResource",
  135. ToggleWindowPath = "Pages.View.PasswordChangeView"
  136. });
  137. MenuManage.GetInstance.menuModels.Add(new MenuModel()
  138. {
  139. MainMenuIcon = "&#xe66d;",
  140. MainMenuName = "用户管理",
  141. Alias = "User Management",
  142. MainMenuPermission = new Permission[] { Permission.管理员, Permission.操作员, Permission.技术员 },
  143. subMenumodels = UserManager,
  144. });
  145. #endregion
  146. }
  147. private void DataInit()
  148. {
  149. //Config.GetInstance.Init();
  150. }
  151. }
  152. }