@riil-frontend/component-topology 11.0.33 → 11.0.35

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