@riil-frontend/component-topology 10.0.57 → 10.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +4 -2
  4. package/build/index.js +52 -45
  5. package/es/components/IndexSettingDrawer/index.js +6 -5
  6. package/es/components/MultiResourceDrawer/index.js +22 -26
  7. package/es/components/ResourceList/ResourceSelect.js +55 -58
  8. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
  9. package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  10. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
  11. package/es/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +78 -100
  12. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  13. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -4
  14. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
  15. package/es/core/editor/components/BackgroundView/index.js +149 -178
  16. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
  17. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
  18. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
  19. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
  20. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  21. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  22. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  23. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
  24. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
  25. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  26. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
  27. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
  28. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  29. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  30. package/es/core/editor/store/background.js +8 -10
  31. package/es/core/editor/store/topoEdit.js +4 -6
  32. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  33. package/es/core/hooks/useCanvasTheme.js +1 -1
  34. package/es/core/hooks/usePolling.js +110 -122
  35. package/es/core/hooks/useResourceConfig.js +76 -100
  36. package/es/core/hooks/useTopoEdit.js +539 -638
  37. package/es/core/models/Alarm.js +311 -394
  38. package/es/core/models/AttributeMetricDisplay.js +115 -143
  39. package/es/core/models/PluginManager.js +4 -3
  40. package/es/core/models/SelectionModel.js +4 -5
  41. package/es/core/models/TopoApp.js +287 -454
  42. package/es/core/models/TopoGraphView.js +28 -41
  43. package/es/core/models/cache/CiCache.js +34 -39
  44. package/es/core/models/cache/CiTypeCache.js +70 -84
  45. package/es/core/models/cache/DictCache.js +36 -42
  46. package/es/core/models/graph/Background.js +21 -26
  47. package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
  48. package/es/core/models/tagstips/ElementTagTipConfig.js +34 -40
  49. package/es/core/models/topoData.js +73 -77
  50. package/es/core/models/utils/linkUtils.js +46 -51
  51. package/es/core/services/alarm.js +14 -16
  52. package/es/core/services/background.js +59 -67
  53. package/es/core/services/cmdb/metric.js +14 -18
  54. package/es/core/services/cmdb.js +23 -27
  55. package/es/core/services/index.js +48 -68
  56. package/es/core/services/overview.js +131 -151
  57. package/es/core/services/topo/basic.js +11 -13
  58. package/es/core/services/topo/tagtip.js +15 -19
  59. package/es/core/store/models/ciModel.js +58 -62
  60. package/es/core/store/models/customIcon.js +126 -145
  61. package/es/core/store/models/displayConfig.js +15 -19
  62. package/es/core/store/models/selection.js +4 -6
  63. package/es/core/store/models/topoAlarm.js +162 -145
  64. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  65. package/es/core/store/models/topoBizMod.js +28 -32
  66. package/es/core/store/models/topoConfig.js +217 -233
  67. package/es/core/store/models/topoGraphView.js +4 -6
  68. package/es/core/store/models/topoMod.js +379 -401
  69. package/es/core/utils/imageUtil.js +23 -27
  70. package/es/core/utils/saveSerialize.js +14 -18
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  79. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
  80. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
  81. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  82. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
  83. package/es/networkTopo/components/Link/hook.js +85 -96
  84. package/es/networkTopo/components/Link/index copy.js +104 -126
  85. package/es/networkTopo/components/Link/index.js +104 -126
  86. package/es/networkTopo/components/Link/setting.js +48 -52
  87. package/es/networkTopo/getTopoData.js +73 -92
  88. package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
  89. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  90. package/es/networkTopo/models/TopoCenter.js +28 -46
  91. package/es/networkTopo/services/alert.js +18 -22
  92. package/es/networkTopo/services/authorization.js +45 -55
  93. package/es/networkTopo/services/cmdb.js +548 -696
  94. package/es/networkTopo/services/funcAuth.js +22 -24
  95. package/es/networkTopo/services/link.js +107 -117
  96. package/es/networkTopo/services/mdc.js +33 -48
  97. package/es/networkTopo/services/metric.js +38 -47
  98. package/es/networkTopo/services/model.js +616 -809
  99. package/es/networkTopo/services/risk.js +9 -11
  100. package/es/networkTopo/services/topo/auth.js +27 -33
  101. package/es/networkTopo/services/topo/basic.js +274 -314
  102. package/es/networkTopo/services/topo/blacklist.js +20 -24
  103. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  104. package/es/networkTopo/services/topo/icon.js +49 -59
  105. package/es/networkTopo/services/topo/networkLink.js +32 -36
  106. package/es/networkTopo/services/topo/relation.js +9 -11
  107. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  108. package/es/networkTopo/store/functionAuth.js +31 -37
  109. package/es/networkTopo/store/linkDynamicStyle.js +102 -108
  110. package/es/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  111. package/es/networkTopo/store/linkManager.js +4 -6
  112. package/es/networkTopo/store/topoCenter.js +142 -152
  113. package/es/networkTopo/store/topoLinkMod.js +4 -6
  114. package/es/networkTopo/store/topoTreeMod.js +170 -182
  115. package/es/networkTopo/utils/exportData.js +57 -61
  116. package/lib/components/IndexSettingDrawer/index.js +6 -5
  117. package/lib/components/MultiResourceDrawer/index.js +22 -26
  118. package/lib/components/ResourceList/ResourceSelect.js +54 -58
  119. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
  120. package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  121. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
  122. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +82 -104
  123. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  124. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -4
  125. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  126. package/lib/core/editor/components/BackgroundView/index.js +148 -177
  127. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
  128. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  129. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
  130. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
  131. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  132. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  133. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  134. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
  135. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
  136. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  137. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
  138. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
  139. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  140. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  141. package/lib/core/editor/store/background.js +8 -10
  142. package/lib/core/editor/store/topoEdit.js +4 -6
  143. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  144. package/lib/core/hooks/useCanvasTheme.js +1 -1
  145. package/lib/core/hooks/usePolling.js +108 -120
  146. package/lib/core/hooks/useResourceConfig.js +76 -100
  147. package/lib/core/hooks/useTopoEdit.js +530 -629
  148. package/lib/core/models/Alarm.js +308 -391
  149. package/lib/core/models/AttributeMetricDisplay.js +118 -146
  150. package/lib/core/models/PluginManager.js +4 -3
  151. package/lib/core/models/SelectionModel.js +4 -5
  152. package/lib/core/models/TopoApp.js +287 -454
  153. package/lib/core/models/TopoGraphView.js +28 -41
  154. package/lib/core/models/cache/CiCache.js +39 -44
  155. package/lib/core/models/cache/CiTypeCache.js +71 -85
  156. package/lib/core/models/cache/DictCache.js +39 -45
  157. package/lib/core/models/graph/Background.js +22 -27
  158. package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
  159. package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -40
  160. package/lib/core/models/topoData.js +73 -78
  161. package/lib/core/models/utils/linkUtils.js +45 -51
  162. package/lib/core/services/alarm.js +18 -20
  163. package/lib/core/services/background.js +70 -78
  164. package/lib/core/services/cmdb/metric.js +14 -19
  165. package/lib/core/services/cmdb.js +24 -29
  166. package/lib/core/services/index.js +53 -72
  167. package/lib/core/services/overview.js +131 -151
  168. package/lib/core/services/topo/basic.js +13 -15
  169. package/lib/core/services/topo/tagtip.js +16 -21
  170. package/lib/core/store/models/ciModel.js +66 -70
  171. package/lib/core/store/models/customIcon.js +126 -145
  172. package/lib/core/store/models/displayConfig.js +15 -19
  173. package/lib/core/store/models/selection.js +4 -6
  174. package/lib/core/store/models/topoAlarm.js +163 -145
  175. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  176. package/lib/core/store/models/topoBizMod.js +34 -38
  177. package/lib/core/store/models/topoConfig.js +224 -240
  178. package/lib/core/store/models/topoGraphView.js +4 -6
  179. package/lib/core/store/models/topoMod.js +381 -403
  180. package/lib/core/utils/imageUtil.js +26 -31
  181. package/lib/core/utils/saveSerialize.js +13 -18
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
  185. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
  186. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
  187. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
  188. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  189. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  190. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
  191. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
  192. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  193. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
  194. package/lib/networkTopo/components/Link/hook.js +86 -98
  195. package/lib/networkTopo/components/Link/index copy.js +105 -127
  196. package/lib/networkTopo/components/Link/index.js +105 -127
  197. package/lib/networkTopo/components/Link/setting.js +48 -52
  198. package/lib/networkTopo/getTopoData.js +73 -92
  199. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
  200. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  201. package/lib/networkTopo/models/TopoCenter.js +28 -46
  202. package/lib/networkTopo/services/alert.js +18 -22
  203. package/lib/networkTopo/services/authorization.js +55 -65
  204. package/lib/networkTopo/services/cmdb.js +551 -700
  205. package/lib/networkTopo/services/funcAuth.js +24 -26
  206. package/lib/networkTopo/services/link.js +108 -118
  207. package/lib/networkTopo/services/mdc.js +35 -51
  208. package/lib/networkTopo/services/metric.js +37 -47
  209. package/lib/networkTopo/services/model.js +615 -809
  210. package/lib/networkTopo/services/risk.js +11 -13
  211. package/lib/networkTopo/services/topo/auth.js +27 -33
  212. package/lib/networkTopo/services/topo/basic.js +277 -317
  213. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  214. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  215. package/lib/networkTopo/services/topo/icon.js +59 -69
  216. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  217. package/lib/networkTopo/services/topo/relation.js +11 -13
  218. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  219. package/lib/networkTopo/store/functionAuth.js +31 -37
  220. package/lib/networkTopo/store/linkDynamicStyle.js +103 -109
  221. package/lib/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  222. package/lib/networkTopo/store/linkManager.js +4 -6
  223. package/lib/networkTopo/store/topoCenter.js +142 -152
  224. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  225. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  226. package/lib/networkTopo/utils/exportData.js +63 -68
  227. package/package.json +3 -3
@@ -8,9 +8,12 @@ import { isAvailableArray } from "@riil-frontend/utils";
8
8
  import { createTopoEventListener } from "../event/topoEventListener";
9
9
 
10
10
  var Alarm = /*#__PURE__*/function () {
11
+ var _open, _hmGetTopoAlarmByDoc, _hmGetTopoAlarm, _setAlarmDataByMock, _switchAlarmPopPanel, _openTopoAlarm, _closeTopoAlarm, _restart, _handleAlarmEvent;
12
+
11
13
  function Alarm() {
12
14
  this.topo = void 0;
13
15
  this.currentTopoId = void 0;
16
+ // 告警通道id
14
17
  this.secretKey = null;
15
18
  this.alarmSwitch = true;
16
19
  }
@@ -31,51 +34,41 @@ var Alarm = /*#__PURE__*/function () {
31
34
  */
32
35
  ;
33
36
 
34
- _proto.open =
35
- /*#__PURE__*/
36
- function () {
37
- var _open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
37
+ _proto.open = function open() {
38
+ return (_open = _open || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
38
39
  var _this = this;
39
40
 
40
41
  var nodeCount;
41
42
  return _regeneratorRuntime.wrap(function _callee$(_context) {
42
- while (1) {
43
- switch (_context.prev = _context.next) {
44
- case 0:
45
- this.resetData();
46
-
47
- if (!(!this.isEnabled() || this.topo.isEditMode())) {
48
- _context.next = 3;
49
- break;
50
- }
43
+ while (1) switch (_context.prev = _context.next) {
44
+ case 0:
45
+ this.resetData();
51
46
 
52
- return _context.abrupt("return");
47
+ if (!(!this.isEnabled() || this.topo.isEditMode())) {
48
+ _context.next = 3;
49
+ break;
50
+ }
53
51
 
54
- case 3:
55
- nodeCount = this.topo.dataModel.getNodes().length;
52
+ return _context.abrupt("return");
56
53
 
57
- if (nodeCount < 1500) {
58
- this.doOpen();
59
- } else {
60
- this.confirmOpenWhenLargeResource(function () {
61
- _this.doOpen();
62
- });
63
- }
54
+ case 3:
55
+ nodeCount = this.topo.dataModel.getNodes().length;
56
+
57
+ if (nodeCount < 1500) {
58
+ this.doOpen();
59
+ } else {
60
+ this.confirmOpenWhenLargeResource(function () {
61
+ _this.doOpen();
62
+ });
63
+ }
64
64
 
65
- case 5:
66
- case "end":
67
- return _context.stop();
68
- }
65
+ case 5:
66
+ case "end":
67
+ return _context.stop();
69
68
  }
70
69
  }, _callee, this);
71
- }));
72
-
73
- function open() {
74
- return _open.apply(this, arguments);
75
- }
76
-
77
- return open;
78
- }();
70
+ }))).apply(this, arguments);
71
+ };
79
72
 
80
73
  _proto.doOpen = function doOpen() {
81
74
  // 获得拓扑id
@@ -179,191 +172,155 @@ var Alarm = /*#__PURE__*/function () {
179
172
  };
180
173
  };
181
174
 
182
- _proto.hmGetTopoAlarmByDoc = /*#__PURE__*/function () {
183
- var _hmGetTopoAlarmByDoc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
175
+ _proto.hmGetTopoAlarmByDoc = function hmGetTopoAlarmByDoc(_x) {
176
+ return (_hmGetTopoAlarmByDoc = _hmGetTopoAlarmByDoc || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
184
177
  var result, alarms, state, _this$topo$store$getM, alarmListDefaultOpen;
185
178
 
186
179
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
187
- while (1) {
188
- switch (_context2.prev = _context2.next) {
189
- case 0:
190
- result = this.getAlarms();
191
- rlog.debug("hmGetTopoAlarmByDoc", result);
192
- alarms = result.map(function (item) {
193
- return item.obj;
194
- });
195
- state = {
196
- alarmData: alarms.length > 0 ? alarms : []
197
- };
198
- _this$topo$store$getM = this.topo.store.getModelState('displayConfig'), alarmListDefaultOpen = _this$topo$store$getM.alarmListDefaultOpen;
199
-
200
- if (alarmListDefaultOpen) {
201
- state.alarmPanelIsOpen = alarms.length > 0;
202
- }
203
-
204
- this.updateState(state);
205
-
206
- case 7:
207
- case "end":
208
- return _context2.stop();
209
- }
180
+ while (1) switch (_context2.prev = _context2.next) {
181
+ case 0:
182
+ result = this.getAlarms();
183
+ rlog.debug("hmGetTopoAlarmByDoc", result);
184
+ alarms = result.map(function (item) {
185
+ return item.obj;
186
+ });
187
+ state = {
188
+ alarmData: alarms.length > 0 ? alarms : []
189
+ };
190
+ _this$topo$store$getM = this.topo.store.getModelState('displayConfig'), alarmListDefaultOpen = _this$topo$store$getM.alarmListDefaultOpen;
191
+
192
+ if (alarmListDefaultOpen) {
193
+ state.alarmPanelIsOpen = alarms.length > 0;
194
+ }
195
+
196
+ this.updateState(state);
197
+
198
+ case 7:
199
+ case "end":
200
+ return _context2.stop();
210
201
  }
211
202
  }, _callee2, this);
212
- }));
213
-
214
- function hmGetTopoAlarmByDoc(_x) {
215
- return _hmGetTopoAlarmByDoc.apply(this, arguments);
216
- }
217
-
218
- return hmGetTopoAlarmByDoc;
219
- }();
203
+ }))).apply(this, arguments);
204
+ };
220
205
 
221
- _proto.hmGetTopoAlarm = /*#__PURE__*/function () {
222
- var _hmGetTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
206
+ _proto.hmGetTopoAlarm = function hmGetTopoAlarm(_x2) {
207
+ return (_hmGetTopoAlarm = _hmGetTopoAlarm || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
223
208
  var mainCiIdList, endTime, startTime, parms, result;
224
209
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
225
- while (1) {
226
- switch (_context3.prev = _context3.next) {
227
- case 0:
228
- mainCiIdList = this.topo.dataModel.getDatas().filter(function (ci) {
229
- return !!ci.operation;
230
- }) // 过滤掉权限
231
- .map(function (ci) {
232
- return ci.id;
233
- });
234
-
235
- if (!(mainCiIdList.length === 0)) {
236
- _context3.next = 4;
237
- break;
210
+ while (1) switch (_context3.prev = _context3.next) {
211
+ case 0:
212
+ mainCiIdList = this.topo.dataModel.getDatas().filter(function (ci) {
213
+ return !!ci.operation;
214
+ }) // 过滤掉权限
215
+ .map(function (ci) {
216
+ return ci.id;
217
+ });
218
+
219
+ if (!(mainCiIdList.length === 0)) {
220
+ _context3.next = 4;
221
+ break;
222
+ }
223
+
224
+ this.updateState({
225
+ alarmData: [],
226
+ alarmPanelIsOpen: false
227
+ });
228
+ return _context3.abrupt("return");
229
+
230
+ case 4:
231
+ //rlog.debug("获取告警列表", mainCiIdList);
232
+ endTime = null; // new Date().valueOf();
233
+
234
+ startTime = null; // moment().subtract(1, "months").valueOf();
235
+
236
+ parms = {
237
+ mainCiIdList: mainCiIdList,
238
+ alertStatusList: ["toDeal", "dealing"],
239
+ pageNum: 1,
240
+ pageSize: 10,
241
+ sortField: "alertLevel",
242
+ alertLevelList: [],
243
+ orders: [{
244
+ property: "alertLevel",
245
+ direction: "ASC"
246
+ }, {
247
+ property: "createTime",
248
+ direction: "DESC"
249
+ }],
250
+ createTime: {
251
+ startTime: startTime,
252
+ endTime: endTime
238
253
  }
239
-
240
- this.updateState({
241
- alarmData: [],
242
- alarmPanelIsOpen: false
243
- });
244
- return _context3.abrupt("return");
245
-
246
- case 4:
247
- //rlog.debug("获取告警列表", mainCiIdList);
248
- endTime = null; // new Date().valueOf();
249
-
250
- startTime = null; // moment().subtract(1, "months").valueOf();
251
-
252
- parms = {
253
- mainCiIdList: mainCiIdList,
254
- alertStatusList: ["toDeal", "dealing"],
255
- pageNum: 1,
256
- pageSize: 10,
257
- sortField: "alertLevel",
258
- alertLevelList: [],
259
- orders: [{
260
- property: "alertLevel",
261
- direction: "ASC"
262
- }, {
263
- property: "createTime",
264
- direction: "DESC"
265
- }],
266
- createTime: {
267
- startTime: startTime,
268
- endTime: endTime
269
- }
270
- };
271
- _context3.next = 9;
272
- return topoService.getAlarmByIds(parms);
273
-
274
- case 9:
275
- result = _context3.sent;
276
- rlog.debug("getAlarmById-result", result); // if (alarmIsOpened) {
277
- // //this.topo.loadAlarm(result.datas);
278
- // this.handleAlarmEvent({ type: "alarm", data: result.datas });
279
- // }
280
- // this.updateState({
281
- // alarmData: result.datas.length > 0 ? result.datas : [],
282
- // alarmPanelIsOpen: result.datas.length > 0,
283
- // });
284
-
285
- case 11:
286
- case "end":
287
- return _context3.stop();
288
- }
254
+ };
255
+ _context3.next = 9;
256
+ return topoService.getAlarmByIds(parms);
257
+
258
+ case 9:
259
+ result = _context3.sent;
260
+ rlog.debug("getAlarmById-result", result); // if (alarmIsOpened) {
261
+ // //this.topo.loadAlarm(result.datas);
262
+ // this.handleAlarmEvent({ type: "alarm", data: result.datas });
263
+ // }
264
+ // this.updateState({
265
+ // alarmData: result.datas.length > 0 ? result.datas : [],
266
+ // alarmPanelIsOpen: result.datas.length > 0,
267
+ // });
268
+
269
+ case 11:
270
+ case "end":
271
+ return _context3.stop();
289
272
  }
290
273
  }, _callee3, this);
291
- }));
292
-
293
- function hmGetTopoAlarm(_x2) {
294
- return _hmGetTopoAlarm.apply(this, arguments);
295
- }
296
-
297
- return hmGetTopoAlarm;
298
- }()
274
+ }))).apply(this, arguments);
275
+ }
299
276
  /**
300
277
  * 直接装载告警数据(可装载mock列表)
301
278
  *
302
279
  */
303
280
  ;
304
281
 
305
- _proto.setAlarmDataByMock =
306
- /*#__PURE__*/
307
- function () {
308
- var _setAlarmDataByMock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(datas) {
282
+ _proto.setAlarmDataByMock = function setAlarmDataByMock(_x3) {
283
+ return (_setAlarmDataByMock = _setAlarmDataByMock || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(datas) {
309
284
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
310
- while (1) {
311
- switch (_context4.prev = _context4.next) {
312
- case 0:
313
- this.updateState({
314
- alarmData: datas.length > 0 ? datas : [],
315
- alarmPanelIsOpen: datas.length > 0
316
- });
317
-
318
- case 1:
319
- case "end":
320
- return _context4.stop();
321
- }
285
+ while (1) switch (_context4.prev = _context4.next) {
286
+ case 0:
287
+ this.updateState({
288
+ alarmData: datas.length > 0 ? datas : [],
289
+ alarmPanelIsOpen: datas.length > 0
290
+ });
291
+
292
+ case 1:
293
+ case "end":
294
+ return _context4.stop();
322
295
  }
323
296
  }, _callee4, this);
324
- }));
325
-
326
- function setAlarmDataByMock(_x3) {
327
- return _setAlarmDataByMock.apply(this, arguments);
328
- }
329
-
330
- return setAlarmDataByMock;
331
- }()
297
+ }))).apply(this, arguments);
298
+ }
332
299
  /**
333
300
  * 打开\关闭告警列表弹窗
334
301
  *
335
302
  */
336
303
  ;
337
304
 
338
- _proto.switchAlarmPopPanel =
339
- /*#__PURE__*/
340
- function () {
341
- var _switchAlarmPopPanel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(flag) {
305
+ _proto.switchAlarmPopPanel = function switchAlarmPopPanel(_x4) {
306
+ return (_switchAlarmPopPanel = _switchAlarmPopPanel || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(flag) {
342
307
  var topoDispatchers;
343
308
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
344
- while (1) {
345
- switch (_context5.prev = _context5.next) {
346
- case 0:
347
- // console.log("switchAlarmPopPanel", flag);
348
- topoDispatchers = this.topo.store.getModelDispatchers("topoAlarm");
349
- topoDispatchers.update({
350
- alarmPanelIsOpen: flag
351
- });
352
-
353
- case 2:
354
- case "end":
355
- return _context5.stop();
356
- }
309
+ while (1) switch (_context5.prev = _context5.next) {
310
+ case 0:
311
+ // console.log("switchAlarmPopPanel", flag);
312
+ topoDispatchers = this.topo.store.getModelDispatchers("topoAlarm");
313
+ topoDispatchers.update({
314
+ alarmPanelIsOpen: flag
315
+ });
316
+
317
+ case 2:
318
+ case "end":
319
+ return _context5.stop();
357
320
  }
358
321
  }, _callee5, this);
359
- }));
360
-
361
- function switchAlarmPopPanel(_x4) {
362
- return _switchAlarmPopPanel.apply(this, arguments);
363
- }
364
-
365
- return switchAlarmPopPanel;
366
- }()
322
+ }))).apply(this, arguments);
323
+ }
367
324
  /**
368
325
  * 打开告警推送。
369
326
  *
@@ -371,61 +328,51 @@ var Alarm = /*#__PURE__*/function () {
371
328
  */
372
329
  ;
373
330
 
374
- _proto.openTopoAlarm =
375
- /*#__PURE__*/
376
- function () {
377
- var _openTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
331
+ _proto.openTopoAlarm = function openTopoAlarm(_x5) {
332
+ return (_openTopoAlarm = _openTopoAlarm || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
378
333
  var _this$getState2, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
379
334
 
380
335
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
381
- while (1) {
382
- switch (_context6.prev = _context6.next) {
383
- case 0:
384
- // 如果当前拓扑图开启中或已开启则退出
385
- _this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
386
-
387
- if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
388
- _context6.next = 3;
389
- break;
390
- }
391
-
392
- return _context6.abrupt("return");
393
-
394
- case 3:
395
- this.currentTopoId = id;
396
- this.updateState({
397
- alarmOpening: true
398
- });
399
- alarmDispatchers = this.topo.store.getModelDispatchers("topoAlarm");
400
- _context6.next = 8;
401
- return alarmDispatchers.resetAlarmDoc();
402
-
403
- case 8:
404
- _context6.next = 10;
405
- return this.topo.serverApi.openTopoAlarm(id);
406
-
407
- case 10:
408
- this.secretKey = _context6.sent;
409
- // rlog.debug("openTopoAlarm 获取初始化告警-------------------开始");
410
- this.updateState({
411
- alarmOpening: false,
412
- alarmIsOpened: true
413
- });
336
+ while (1) switch (_context6.prev = _context6.next) {
337
+ case 0:
338
+ // 如果当前拓扑图开启中或已开启则退出
339
+ _this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
414
340
 
415
- case 12:
416
- case "end":
417
- return _context6.stop();
418
- }
341
+ if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
342
+ _context6.next = 3;
343
+ break;
344
+ }
345
+
346
+ return _context6.abrupt("return");
347
+
348
+ case 3:
349
+ this.currentTopoId = id;
350
+ this.updateState({
351
+ alarmOpening: true
352
+ });
353
+ alarmDispatchers = this.topo.store.getModelDispatchers("topoAlarm");
354
+ _context6.next = 8;
355
+ return alarmDispatchers.resetAlarmDoc();
356
+
357
+ case 8:
358
+ _context6.next = 10;
359
+ return this.topo.serverApi.openTopoAlarm(id);
360
+
361
+ case 10:
362
+ this.secretKey = _context6.sent;
363
+ // rlog.debug("openTopoAlarm 获取初始化告警-------------------开始");
364
+ this.updateState({
365
+ alarmOpening: false,
366
+ alarmIsOpened: true
367
+ });
368
+
369
+ case 12:
370
+ case "end":
371
+ return _context6.stop();
419
372
  }
420
373
  }, _callee6, this);
421
- }));
422
-
423
- function openTopoAlarm(_x5) {
424
- return _openTopoAlarm.apply(this, arguments);
425
- }
426
-
427
- return openTopoAlarm;
428
- }()
374
+ }))).apply(this, arguments);
375
+ }
429
376
  /**
430
377
  * 关闭告警推送。
431
378
  *
@@ -433,51 +380,41 @@ var Alarm = /*#__PURE__*/function () {
433
380
  */
434
381
  ;
435
382
 
436
- _proto.closeTopoAlarm =
437
- /*#__PURE__*/
438
- function () {
439
- var _closeTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
383
+ _proto.closeTopoAlarm = function closeTopoAlarm(_x6) {
384
+ return (_closeTopoAlarm = _closeTopoAlarm || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
440
385
  var _this$getState3, alarmIsOpened, alarmOpening;
441
386
 
442
387
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
443
- while (1) {
444
- switch (_context7.prev = _context7.next) {
445
- case 0:
446
- // 如果未开启则退出
447
- _this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
448
-
449
- if (!(!alarmIsOpened && !alarmOpening)) {
450
- _context7.next = 3;
451
- break;
452
- }
453
-
454
- return _context7.abrupt("return");
455
-
456
- case 3:
457
- this.currentTopoId = null;
458
- rlog.debug("useAlarm.useEffect 告警WebSocket 结束");
459
- this.updateState({
460
- topoAlarmIsOpen: false,
461
- alarmOpening: false,
462
- alarmPanelIsOpen: false
463
- });
464
- _context7.next = 8;
465
- return this.topo.serverApi.closeTopoAlarm(id, this.secretKey);
388
+ while (1) switch (_context7.prev = _context7.next) {
389
+ case 0:
390
+ // 如果未开启则退出
391
+ _this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
466
392
 
467
- case 8:
468
- case "end":
469
- return _context7.stop();
470
- }
393
+ if (!(!alarmIsOpened && !alarmOpening)) {
394
+ _context7.next = 3;
395
+ break;
396
+ }
397
+
398
+ return _context7.abrupt("return");
399
+
400
+ case 3:
401
+ this.currentTopoId = null;
402
+ rlog.debug("useAlarm.useEffect 告警WebSocket 结束");
403
+ this.updateState({
404
+ topoAlarmIsOpen: false,
405
+ alarmOpening: false,
406
+ alarmPanelIsOpen: false
407
+ });
408
+ _context7.next = 8;
409
+ return this.topo.serverApi.closeTopoAlarm(id, this.secretKey);
410
+
411
+ case 8:
412
+ case "end":
413
+ return _context7.stop();
471
414
  }
472
415
  }, _callee7, this);
473
- }));
474
-
475
- function closeTopoAlarm(_x6) {
476
- return _closeTopoAlarm.apply(this, arguments);
477
- }
478
-
479
- return closeTopoAlarm;
480
- }()
416
+ }))).apply(this, arguments);
417
+ }
481
418
  /**
482
419
  * 打开\关闭告警列表弹窗
483
420
  *
@@ -494,144 +431,124 @@ var Alarm = /*#__PURE__*/function () {
494
431
  */
495
432
  ;
496
433
 
497
- _proto.restart =
498
- /*#__PURE__*/
499
- function () {
500
- var _restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
434
+ _proto.restart = function restart() {
435
+ return (_restart = _restart || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
501
436
  var id;
502
437
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
503
- while (1) {
504
- switch (_context8.prev = _context8.next) {
505
- case 0:
506
- id = this.currentTopoId;
507
- _context8.next = 3;
508
- return this.openTopoAlarm(id);
509
-
510
- case 3:
511
- case "end":
512
- return _context8.stop();
513
- }
438
+ while (1) switch (_context8.prev = _context8.next) {
439
+ case 0:
440
+ id = this.currentTopoId;
441
+ _context8.next = 3;
442
+ return this.openTopoAlarm(id);
443
+
444
+ case 3:
445
+ case "end":
446
+ return _context8.stop();
514
447
  }
515
448
  }, _callee8, this);
516
- }));
517
-
518
- function restart() {
519
- return _restart.apply(this, arguments);
520
- }
521
-
522
- return restart;
523
- }()
449
+ }))).apply(this, arguments);
450
+ }
524
451
  /**
525
452
  * 处理告警推送事件
526
453
  */
527
454
  ;
528
455
 
529
- _proto.handleAlarmEvent =
530
- /*#__PURE__*/
531
- function () {
532
- var _handleAlarmEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(alertData) {
533
- var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
456
+ _proto.handleAlarmEvent = function handleAlarmEvent(_x7) {
457
+ return (_handleAlarmEvent = _handleAlarmEvent || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(alertData) {
458
+ var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche2, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
534
459
 
535
460
  return _regeneratorRuntime.wrap(function _callee9$(_context9) {
536
- while (1) {
537
- switch (_context9.prev = _context9.next) {
538
- case 0:
539
- _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
540
- resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
541
- resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
542
- alarmDispatchers = this.topo.store.getModelDispatchers("topoAlarm"); // 添加事件
543
- // console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
544
-
545
- if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
546
- _context9.next = 24;
547
- break;
461
+ while (1) switch (_context9.prev = _context9.next) {
462
+ case 0:
463
+ _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
464
+ resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
465
+ resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
466
+ alarmDispatchers = this.topo.store.getModelDispatchers("topoAlarm"); // 添加事件
467
+ // console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
468
+
469
+ if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
470
+ _context9.next = 24;
471
+ break;
472
+ }
473
+
474
+ sendAl = [];
475
+ idsList = [].concat(nodeIdsList, linkIdsList);
476
+ operations = [];
477
+ idsList.map(function (idItem) {
478
+ if (idItem.operation === null) {
479
+ operations.push(idItem.ciId);
548
480
  }
481
+ });
482
+ alertData.map(function (item, index) {
483
+ var _item$resourceId;
484
+
485
+ var ciId = (_item$resourceId = item.resourceId) !== null && _item$resourceId !== void 0 ? _item$resourceId : item.ciId;
486
+ var obj = {
487
+ id: ciId,
488
+ level: item.alertLevel,
489
+ alertId: item.alertId,
490
+ status: item.status,
491
+ obj: item,
492
+ info: item.alertType,
493
+ ciCode: item === null || item === void 0 ? void 0 : item.ciCode,
494
+ ruleId: item === null || item === void 0 ? void 0 : item.ruleId
495
+ };
549
496
 
550
- sendAl = [];
551
- idsList = [].concat(nodeIdsList, linkIdsList);
552
- operations = [];
553
- idsList.map(function (idItem) {
554
- if (idItem.operation === null) {
555
- operations.push(idItem.ciId);
556
- }
557
- });
558
- alertData.map(function (item, index) {
559
- var _item$resourceId;
560
-
561
- var ciId = (_item$resourceId = item.resourceId) !== null && _item$resourceId !== void 0 ? _item$resourceId : item.ciId;
562
- var obj = {
563
- id: ciId,
564
- level: item.alertLevel,
565
- alertId: item.alertId,
566
- status: item.status,
567
- obj: item,
568
- info: item.alertType,
569
- ciCode: item === null || item === void 0 ? void 0 : item.ciCode,
570
- ruleId: item === null || item === void 0 ? void 0 : item.ruleId
571
- };
572
-
573
- if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
574
- sendAl.push(obj);
575
- }
576
-
577
- return obj;
578
- }); // console.log("before-combAlarmData", sendAl, idsList);
579
-
580
- if (!(sendAl.length > 0)) {
581
- _context9.next = 24;
582
- break;
497
+ if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
498
+ sendAl.push(obj);
583
499
  }
584
500
 
585
- rlog.debug("过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl", alarmIsOpened, sendAl);
586
- _context9.prev = 12;
587
- _context9.next = 15;
588
- return alarmDispatchers.combAlarmData({
589
- alarmdata: sendAl
590
- });
591
-
592
- case 15:
593
- _yield$alarmDispatche = _context9.sent;
594
- eqFlag = _yield$alarmDispatche.eqFlag;
595
- alarmlist = _yield$alarmDispatche.alarmlist;
596
-
597
- // console.log("handleAlarmEvent", alarmIsOpened,eqFlag);
598
- // console.log("handleAlarmEvent-topo.viewProps", this.topo.viewProps);
599
- if (alarmIsOpened) {
600
- this.hmGetTopoAlarmByDoc(); // 通知所有告警
601
-
602
- if ((_this$topo$viewProps = this.topo.viewProps) !== null && _this$topo$viewProps !== void 0 && _this$topo$viewProps.onAlarm) {
603
- this.topo.viewProps.onAlarm(this.getAlarms().map(function (item) {
604
- return item.obj;
605
- }));
606
- }
607
-
608
- if ((_this$topo$viewProps2 = this.topo.viewProps) !== null && _this$topo$viewProps2 !== void 0 && _this$topo$viewProps2.onResourceEvent) {
609
- this.topo.viewProps.onResourceEvent(this.getEvents());
610
- }
611
- }
501
+ return obj;
502
+ }); // console.log("before-combAlarmData", sendAl, idsList);
612
503
 
504
+ if (!(sendAl.length > 0)) {
613
505
  _context9.next = 24;
614
506
  break;
507
+ }
508
+
509
+ rlog.debug("过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl", alarmIsOpened, sendAl);
510
+ _context9.prev = 12;
511
+ _context9.next = 15;
512
+ return alarmDispatchers.combAlarmData({
513
+ alarmdata: sendAl
514
+ });
515
+
516
+ case 15:
517
+ _yield$alarmDispatche2 = _context9.sent;
518
+ eqFlag = _yield$alarmDispatche2.eqFlag;
519
+ alarmlist = _yield$alarmDispatche2.alarmlist;
520
+
521
+ // console.log("handleAlarmEvent", alarmIsOpened,eqFlag);
522
+ // console.log("handleAlarmEvent-topo.viewProps", this.topo.viewProps);
523
+ if (alarmIsOpened) {
524
+ this.hmGetTopoAlarmByDoc(); // 通知所有告警
525
+
526
+ if ((_this$topo$viewProps = this.topo.viewProps) !== null && _this$topo$viewProps !== void 0 && _this$topo$viewProps.onAlarm) {
527
+ this.topo.viewProps.onAlarm(this.getAlarms().map(function (item) {
528
+ return item.obj;
529
+ }));
530
+ }
615
531
 
616
- case 21:
617
- _context9.prev = 21;
618
- _context9.t0 = _context9["catch"](12);
619
- rlog.error("告警发送异常", _context9.t0);
532
+ if ((_this$topo$viewProps2 = this.topo.viewProps) !== null && _this$topo$viewProps2 !== void 0 && _this$topo$viewProps2.onResourceEvent) {
533
+ this.topo.viewProps.onResourceEvent(this.getEvents());
534
+ }
535
+ }
620
536
 
621
- case 24:
622
- case "end":
623
- return _context9.stop();
624
- }
625
- }
626
- }, _callee9, this, [[12, 21]]);
627
- }));
537
+ _context9.next = 24;
538
+ break;
628
539
 
629
- function handleAlarmEvent(_x7) {
630
- return _handleAlarmEvent.apply(this, arguments);
631
- }
540
+ case 21:
541
+ _context9.prev = 21;
542
+ _context9.t0 = _context9["catch"](12);
543
+ rlog.error("告警发送异常", _context9.t0);
632
544
 
633
- return handleAlarmEvent;
634
- }();
545
+ case 24:
546
+ case "end":
547
+ return _context9.stop();
548
+ }
549
+ }, _callee9, this, [[12, 21]]);
550
+ }))).apply(this, arguments);
551
+ };
635
552
 
636
553
  _proto.getState = function getState() {
637
554
  return this.topo.store.getModelState("topoAlarm");