终端一体化运控平台
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

181 строка
6.7 KiB

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